# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1200676457 28800
# Node ID 2075a32590ec9036aa058fbd148fdc6a28902cd8
# Parent 9a7e8d8094a2cd22c441f894578489bc9ca96d70
Changes to VSSD for fullvirt schema additions
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r 9a7e8d8094a2 -r 2075a32590ec src/Virt_VSSD.c
--- a/src/Virt_VSSD.c Fri Jan 18 09:14:17 2008 -0800
+++ b/src/Virt_VSSD.c Fri Jan 18 09:14:17 2008 -0800
@@ -38,6 +38,41 @@
const static CMPIBroker *_BROKER;
+static void _set_fv_prop(struct domain *dominfo,
+ CMPIInstance *inst)
+{
+ bool fv = true;
+
+ if (dominfo->type == DOMAIN_XENFV)
+ CMSetProperty(inst, "IsFullVirt",
+ (CMPIValue *)&fv, CMPI_boolean);
+
+ if (dominfo->os_info.fv.boot != NULL)
+ CMSetProperty(inst,
+ "BootDevice",
+ (CMPIValue *)dominfo->os_info.fv.boot,
+ CMPI_chars);
+}
+
+static void _set_pv_prop(struct domain *dominfo,
+ CMPIInstance *inst)
+{
+ bool fv = false;
+
+ CMSetProperty(inst, "IsFullVirt",
+ (CMPIValue *)&fv, CMPI_boolean);
+
+ if (dominfo->bootloader != NULL)
+ CMSetProperty(inst, "Bootloader",
+ (CMPIValue *)dominfo->bootloader,
+ CMPI_chars);
+
+ if (dominfo->bootloader_args != NULL)
+ CMSetProperty(inst, "BootloaderArgs",
+ (CMPIValue *)dominfo->bootloader_args,
+ CMPI_chars);
+}
+
static int instance_from_dom(virDomainPtr dom,
CMPIInstance *inst)
{
@@ -75,15 +110,14 @@ static int instance_from_dom(virDomainPt
CMSetProperty(inst, "AutomaticRecoveryAction",
(CMPIValue *)&dominfo->on_crash, CMPI_uint16);
- if (dominfo->bootloader)
- CMSetProperty(inst, "Bootloader",
- (CMPIValue *)dominfo->bootloader,
- CMPI_chars);
-
- if (dominfo->bootloader_args)
- CMSetProperty(inst, "BootloaderArgs",
- (CMPIValue *)dominfo->bootloader_args,
- CMPI_chars);
+ if ((dominfo->type == DOMAIN_XENFV) ||
+ (dominfo->type == DOMAIN_KVM))
+ _set_fv_prop(dominfo, inst);
+ else if (dominfo->type == DOMAIN_XENPV)
+ _set_pv_prop(dominfo, inst);
+ else
+ CU_DEBUG("Unknown domain type %i for creating VSSD",
+ dominfo->type);
if (asprintf(&vsid, "%s:%s", pfx, dominfo->name) == -1) {
ret = 0;