diff --git a/include/LibVirtDriver.h b/include/LibVirtDriver.h index 794a8565d0..50a201f37b 100644 --- a/include/LibVirtDriver.h +++ b/include/LibVirtDriver.h @@ -46,11 +46,13 @@ public: std::string& error) const override; private: - static const int CEPH_DEFAULT_PORT; + static const int CEPH_DEFAULT_PORT; - static const int GLUSTER_DEFAULT_PORT; + static const int GLUSTER_DEFAULT_PORT; - static const int ISCSI_DEFAULT_PORT; + static const int ISCSI_DEFAULT_PORT; + + static const int Q35_ROOT_DEFAULT_PORTS; static const char * XML_DOMAIN_RNG_PATH; diff --git a/src/vmm/LibVirtDriverKVM.cc b/src/vmm/LibVirtDriverKVM.cc index 6537a8e57f..ad90063354 100644 --- a/src/vmm/LibVirtDriverKVM.cc +++ b/src/vmm/LibVirtDriverKVM.cc @@ -38,6 +38,8 @@ const int LibVirtDriver::GLUSTER_DEFAULT_PORT = 24007; const int LibVirtDriver::ISCSI_DEFAULT_PORT = 3260; +const int LibVirtDriver::Q35_ROOT_DEFAULT_PORTS = 16; + const char * LibVirtDriver::XML_DOMAIN_RNG_PATH = "/schemas/libvirt/domain.rng"; #define set_sec_default(v, dv) if (v.empty() && !dv.empty()){v = dv;} @@ -1953,6 +1955,31 @@ int LibVirtDriver::deployment_description_kvm( file << "\t" << endl; + std::size_t found = machine.find("q35"); + + if (found != std::string::npos) + { + int q35_root_ports = 0; + get_attribute(nullptr, host, cluster, "Q35_ROOT_PORTS", q35_root_ports); + + if (!q35_root_ports) + { + q35_root_ports = Q35_ROOT_DEFAULT_PORTS; + } + + file << "\t" << endl; + file << "\t\t" << endl; + + for (int i=0; i" << endl; + } + + file << "\t\t" << endl; + file << "\t" << endl; + } + + // ------------------------------------------------------------------------ // Features // ------------------------------------------------------------------------