mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-28 17:47:03 +03:00
Merge branch 'bug-399' into one-2.0
This commit is contained in:
commit
f4a8baebec
@ -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,25 @@ 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 ( arch.empty() )
|
||||
{
|
||||
goto error_arch;
|
||||
}
|
||||
}
|
||||
|
||||
if (emulator == "kvm")
|
||||
{
|
||||
file << "\t\t<type arch='" << arch << "'>hvm</type>" << endl;
|
||||
}
|
||||
|
||||
if ( kernel.empty() )
|
||||
{
|
||||
get_default("OS","KERNEL",kernel);
|
||||
@ -621,6 +633,11 @@ error_memory:
|
||||
file.close();
|
||||
return -1;
|
||||
|
||||
error_arch:
|
||||
vm->log("VMM", Log::ERROR, "No ARCH defined and no default provided.");
|
||||
file.close();
|
||||
return -1;
|
||||
|
||||
error_boot:
|
||||
vm->log("VMM", Log::ERROR, "No BOOT device defined and no default provided.");
|
||||
file.close();
|
||||
|
@ -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" ]
|
||||
|
Loading…
x
Reference in New Issue
Block a user