feature #2143: add machine type to KVM deployment file

Based on a patch submited by Vladislav Gorbunov <vadikgo@icloud.com>
in http://dev.opennebula.org/issues/2143#note-2
This commit is contained in:
Javi Fontan committed 2014-02-06 15:32:34 +01:00
1 parent 869b6d5ddd
commit b2332e1250
2 files changed
+16 -2

No files matched your search

+15 -1
View File
@@ -46,6 +46,7 @@ int LibVirtDriver::deployment_description_kvm(
string kernel_cmd = "";
string bootloader = "";
string arch = "";
string machine = "";
vector<string> boots;
@@ -190,6 +191,7 @@ int LibVirtDriver::deployment_description_kvm(
kernel_cmd = os->vector_value("KERNEL_CMD");
bootloader = os->vector_value("BOOTLOADER");
arch = os->vector_value("ARCH");
machine = os->vector_value("MACHINE");
}
}
@@ -203,7 +205,19 @@ int LibVirtDriver::deployment_description_kvm(
}
}
file << "\t\t<type arch='" << arch << "'>hvm</type>" << endl;
if ( machine.empty() )
{
get_default("OS", "MACHINE", machine);
}
file << "\t\t<type arch='" << arch << "'";
if ( !machine.empty() )
{
file << " machine='" << machine << "'";
}
file << ">hvm</type>" << endl;
if ( kernel.empty() )
{
+1 -1
View File
@@ -18,7 +18,7 @@
# (all domains will use these values as defaults). These values can
# be overridden in each VM template. Valid atributes are:
# - emulator
# - os [kernel,initrd,boot,root,kernel_cmd,arch]
# - os [kernel,initrd,boot,root,kernel_cmd,arch,machine]
# - vcpu
# - features [acpi, pae, apic]
# - disk [driver, cache, io]