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

@ -41,16 +41,16 @@ public:
private:
static const char * vmware_vnm_name;
static const float CGROUP_BASE_CPU_SHARES;
int deployment_description(
const VirtualMachine * vm,
const string& file_name) const
{
int rc = -1;
if (emulator == "kvm")
if (emulator == "kvm" || emulator == "qemu" )
{
rc = deployment_description_kvm(vm,file_name);
}

View File

@ -223,6 +223,9 @@ IM_MAD = [
# overridden for each action.
# Valid actions: deploy, shutdown, cancel, save, restore, migrate, poll
# 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 = [
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() )
{
@ -274,18 +271,15 @@ int LibVirtDriver::deployment_description_kvm(
// ------------------------------------------------------------------------
file << "\t<devices>" << endl;
if (emulator == "kvm")
get_default("EMULATOR",emulator_path);
if(emulator_path.empty())
{
get_default("EMULATOR",emulator_path);
if(emulator_path.empty())
{
emulator_path = "/usr/bin/kvm";
}
file << "\t\t<emulator>" << emulator_path << "</emulator>" << endl;
emulator_path = "/usr/bin/kvm";
}
file << "\t\t<emulator>" << emulator_path << "</emulator>" << endl;
// ------------------------------------------------------------------------
// Disks
// ------------------------------------------------------------------------

View File

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