[Libvirt-cim] [PATCH 5 of 6] Changes to VSSD for fullvirt schema additions

Dan Smith danms at us.ibm.com
Thu Jan 17 15:47:51 UTC 2008


# HG changeset patch
# User Dan Smith <danms at us.ibm.com>
# Date 1200588333 28800
# Node ID 019c2959e758e9bbc71a3d7e489f16100857fc68
# Parent  e5053e45e1a4a799b0c07a96730fec7783e0b776
Changes to VSSD for fullvirt schema additions

Signed-off-by: Dan Smith <danms at us.ibm.com>

diff -r e5053e45e1a4 -r 019c2959e758 src/Virt_VSSD.c
--- a/src/Virt_VSSD.c	Thu Jan 17 08:25:10 2008 -0800
+++ b/src/Virt_VSSD.c	Thu Jan 17 08:45:33 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;




More information about the Libvirt-cim mailing list