diff --git a/src/vmm/LibVirtDriverKVM.cc b/src/vmm/LibVirtDriverKVM.cc index 4fdd14a4c1..2a8e71f614 100644 --- a/src/vmm/LibVirtDriverKVM.cc +++ b/src/vmm/LibVirtDriverKVM.cc @@ -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" << endl; - if (emulator == "kvm") - { - file << "\t\thvm" << 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\thvm" << 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(); diff --git a/src/vmm_mad/ssh/vmm_ssh_kvm.conf b/src/vmm_mad/ssh/vmm_ssh_kvm.conf index 17b50215d5..fc11a10ca9 100644 --- a/src/vmm_mad/ssh/vmm_ssh_kvm.conf +++ b/src/vmm_mad/ssh/vmm_ssh_kvm.conf @@ -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" ]