feature qemu: Add support for qemu emulator in LibVirtDriver

(cherry picked from commit a59441392a)
This commit is contained in:
Ruben S. Montero authored and Jaime Melis committed 2013-05-20 22:27:07 +02:00
1 parent e54a571bf4
commit 9ce29ade97
4 files changed
+18 -16

No files matched your search

+3 -3
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);
}
+3
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",
+7 -13
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
// ------------------------------------------------------------------------
+5
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(),