1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-21 18:03:38 +03:00

feature qemu: Add support for qemu emulator in LibVirtDriver

This commit is contained in:
Ruben S. Montero 2013-05-18 20:22:47 +02:00
parent 8b84eb8fa2
commit a59441392a
4 changed files with 18 additions and 16 deletions

View File

@ -50,7 +50,7 @@ private:
{ {
int rc = -1; int rc = -1;
if (emulator == "kvm") if (emulator == "kvm" || emulator == "qemu" )
{ {
rc = deployment_description_kvm(vm,file_name); rc = deployment_description_kvm(vm,file_name);
} }

View File

@ -223,6 +223,9 @@ IM_MAD = [
# overridden for each action. # overridden for each action.
# Valid actions: deploy, shutdown, cancel, save, restore, migrate, poll # Valid actions: deploy, shutdown, cancel, save, restore, migrate, poll
# An example: "-l migrate,poll=poll_ganglia,save" # An example: "-l migrate,poll=poll_ganglia,save"
#
# Note: You can use type = "qemu" to use qemu emulated guests, e.g. if your
# CPU does not have virtualization extensions or use nested Qemu-KVM hosts
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
VM_MAD = [ VM_MAD = [
name = "kvm", name = "kvm",

View File

@ -196,10 +196,7 @@ int LibVirtDriver::deployment_description_kvm(
} }
} }
if (emulator == "kvm")
{
file << "\t\t<type arch='" << arch << "'>hvm</type>" << endl; file << "\t\t<type arch='" << arch << "'>hvm</type>" << endl;
}
if ( kernel.empty() ) if ( kernel.empty() )
{ {
@ -274,8 +271,6 @@ int LibVirtDriver::deployment_description_kvm(
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
file << "\t<devices>" << endl; file << "\t<devices>" << endl;
if (emulator == "kvm")
{
get_default("EMULATOR",emulator_path); get_default("EMULATOR",emulator_path);
if(emulator_path.empty()) if(emulator_path.empty())
@ -284,7 +279,6 @@ int LibVirtDriver::deployment_description_kvm(
} }
file << "\t\t<emulator>" << emulator_path << "</emulator>" << endl; file << "\t\t<emulator>" << emulator_path << "</emulator>" << endl;
}
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
// Disks // Disks

View File

@ -2230,6 +2230,11 @@ void VirtualMachineManager::load_mads(int uid)
vmm_driver = new LibVirtDriver(uid, vattr->value(), vmm_driver = new LibVirtDriver(uid, vattr->value(),
(uid != 0),vmpool,"kvm"); (uid != 0),vmpool,"kvm");
} }
else if ( type == "QEMU" )
{
vmm_driver = new LibVirtDriver(uid, vattr->value(),
(uid != 0),vmpool,"qemu");
}
else if ( type == "VMWARE" ) else if ( type == "VMWARE" )
{ {
vmm_driver = new LibVirtDriver(uid, vattr->value(), vmm_driver = new LibVirtDriver(uid, vattr->value(),