# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1237310504 25200
# Node ID 6195f98ebe5ef0bb1db1bb8ca946d5449393c21c
# Parent 1aff0d0e9bf49e738827b7157c0df407b814ae7d
Add Emulator attribute so users can specify an emulator for the guest.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 1aff0d0e9bf4 -r 6195f98ebe5e schema/VSSD.mof
--- a/schema/VSSD.mof Wed Mar 04 15:25:33 2009 -0800
+++ b/schema/VSSD.mof Tue Mar 17 10:21:44 2009 -0700
@@ -29,6 +29,9 @@
"One of hd,fd,cdrom.")]
string BootDevice;
+ [Description ("The emulator the guest should use during runtime.")]
+ string Emulator;
+
};
[Description (
@@ -42,6 +45,9 @@
[Description ("The device to boot from. One of hd,fd,cdrom.")]
string BootDevice;
+ [Description ("The emulator the guest should use during runtime.")]
+ string Emulator;
+
};
[Description (
diff -r 1aff0d0e9bf4 -r 6195f98ebe5e src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c Wed Mar 04 15:25:33 2009 -0800
+++ b/src/Virt_VirtualSystemManagementService.c Tue Mar 17 10:21:44 2009 -0700
@@ -148,9 +148,15 @@
return 1;
}
-static bool fv_default_emulator(struct domain *domain)
+static bool fv_set_emulator(struct domain *domain,
+ const char *emu)
{
- const char *emul = XEN_EMULATOR;
+ if ((domain->type == DOMAIN_XENFV) && (emu == NULL))
+ emu = XEN_EMULATOR;
+
+ /* No emulator value to set */
+ if (emu == NULL)
+ return true;
cleanup_virt_device(domain->dev_emu);
@@ -161,7 +167,7 @@
}
domain->dev_emu->type = CIM_RES_TYPE_EMU;
- domain->dev_emu->dev.emu.path = strdup(emul);
+ domain->dev_emu->dev.emu.path = strdup(emu);
domain->dev_emu->id = strdup("emulator");
return true;
@@ -178,8 +184,6 @@
domain->type = DOMAIN_KVM;
} else if (STREQC(pfx, "Xen")) {
domain->type = DOMAIN_XENFV;
- if (!fv_default_emulator(domain))
- return 0;
} else {
CU_DEBUG("Unknown fullvirt domain type: %s", pfx);
return 0;
@@ -192,6 +196,17 @@
free(domain->os_info.fv.boot);
domain->os_info.fv.boot = strdup(val);
+ ret = cu_get_str_prop(inst, "Emulator", &val);
+ if (ret != CMPI_RC_OK)
+ val = NULL;
+ else if (disk_type_from_file(val) == DISK_UNKNOWN) {
+ CU_DEBUG("Emulator path does not exist: %s", val);
+ return 0;
+ }
+
+ if (!fv_set_emulator(domain, val))
+ return 0;
+
return 1;
}
_______________________________________________
Libvirt-cim mailing list
Libvirt-cim(a)redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-cim
--
Thanks and Regards,
Deepti B. Kalakeri
IBM Linux Technology Center
deeptik(a)linux.vnet.ibm.com