1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-25 02:50:08 +03:00

bug #399: KVM/Libvirt driver support the 'arch' attribute

This commit is contained in:
Jaime Melis 2010-11-10 18:45:50 +01:00
parent 5f6b326c52
commit d4ae41fe48
2 changed files with 14 additions and 7 deletions

View File

@ -41,6 +41,7 @@ int LibVirtDriver::deployment_description_kvm(
string root = "";
string kernel_cmd = "";
string bootloader = "";
string arch = "";
const VectorAttribute * disk;
const VectorAttribute * context;
@ -142,11 +143,6 @@ int LibVirtDriver::deployment_description_kvm(
file << "\t<os>" << endl;
if (emulator == "kvm")
{
file << "\t\t<type>hvm</type>" << endl;
}
num = vm->get_template_attribute("OS",attrs);
// Get values & defaults
@ -165,9 +161,20 @@ int LibVirtDriver::deployment_description_kvm(
root = os->vector_value("ROOT");
kernel_cmd = os->vector_value("KERNEL_CMD");
bootloader = os->vector_value("BOOTLOADER");
arch = os->vector_value("ARCH");
}
}
if ( arch.empty() )
{
get_default("OS","ARCH",arch);
}
if (emulator == "kvm")
{
file << "\t\t<type arch='" << arch << "'>hvm</type>" << endl;
}
if ( kernel.empty() )
{
get_default("OS","KERNEL",kernel);

View File

@ -1,7 +1,7 @@
# Default configuration attributes for the KVM driver
# (all domains will use these values as defaults)
# Valid atributes are:
# - os [kernel,initrd,boot,root,kernel_cmd]
# - os [kernel,initrd,boot,root,kernel_cmd,arch]
# - memory
# - cpu
# - vcpu
@ -10,7 +10,7 @@
#VCPU = 1
#MEMORY = 128
OS = [ boot = "hd" ]
OS = [ boot = "hd", arch = "i686" ]
FEATURES = [ PAE = "no", ACPI = "yes" ]
DISK = [ driver = "raw" ]