[Libvirt-cim] [PATCH 4 of 5] Make HostedService work from root/cimv2 and register it there

Dan Smith danms at us.ibm.com
Thu Nov 13 16:39:01 UTC 2008


# HG changeset patch
# User Dan Smith <danms at us.ibm.com>
# Date 1226594012 28800
# Node ID 542c7b726a870a1ca20b4ebae790d9287fd0cc9d
# Parent  73d746ef73a16ac4212e9c7459dfd0bfc50fb2e2
Make HostedService work from root/cimv2 and register it there
...so we can get back from HostSystem to our Services.

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

diff -r 73d746ef73a1 -r 542c7b726a87 Makefile.am
--- a/Makefile.am	Thu Nov 13 08:33:32 2008 -0800
+++ b/Makefile.am	Thu Nov 13 08:33:32 2008 -0800
@@ -63,7 +63,8 @@
 
 CIMV2_MOFS = \
 	schema/HostedResourcePool.mof \
-	schema/ElementCapabilities.mof
+	schema/ElementCapabilities.mof \
+	schema/HostedService.mof
 
 REGS = \
 	schema/ComputerSystem.registration \
@@ -117,7 +118,8 @@
 
 CIMV2_REGS = \
 	schema/HostedResourcePool.registration \
-	schema/ElementCapabilities.registration
+	schema/ElementCapabilities.registration \
+	schema/HostedService.registration
 
 pkgdata_DATA = $(MOFS) $(REGS) $(INTEROP_MOFS) $(INTEROP_REGS)
 pkgdata_SCRIPTS = provider-register.sh
diff -r 73d746ef73a1 -r 542c7b726a87 schema/HostedService.registration
--- a/schema/HostedService.registration	Thu Nov 13 08:33:32 2008 -0800
+++ b/schema/HostedService.registration	Thu Nov 13 08:33:32 2008 -0800
@@ -3,3 +3,6 @@
 Xen_HostedService root/virt Virt_HostedService Virt_HostedService association
 KVM_HostedService root/virt Virt_HostedService Virt_HostedService association
 LXC_HostedService root/virt Virt_HostedService Virt_HostedService association
+Xen_HostedService root/cimv2 Virt_HostedService Virt_HostedService association
+KVM_HostedService root/cimv2 Virt_HostedService Virt_HostedService association
+LXC_HostedService root/cimv2 Virt_HostedService Virt_HostedService association
diff -r 73d746ef73a1 -r 542c7b726a87 src/Virt_HostedService.c
--- a/src/Virt_HostedService.c	Thu Nov 13 08:33:32 2008 -0800
+++ b/src/Virt_HostedService.c	Thu Nov 13 08:33:32 2008 -0800
@@ -89,38 +89,44 @@
 {
         CMPIStatus s = {CMPI_RC_OK, NULL};
         CMPIInstance *inst = NULL;
+        CMPIObjectPath *vref = NULL;
 
-        if (!match_hypervisor_prefix(ref, info))
+        if (!STARTS_WITH(CLASSNAME(ref), "Linux_") &&
+            !match_hypervisor_prefix(ref, info))
                 return s;
 
         s = get_host(_BROKER, info->context, ref, &inst, true);
         if (s.rc != CMPI_RC_OK)
                 return s;
 
-        s = get_rpcs(ref, &inst, _BROKER, info->context, false);
+        vref = convert_sblim_hostsystem(_BROKER, ref, info);
+        if (vref == NULL)
+                goto out;
+
+        s = get_rpcs(vref, &inst, _BROKER, info->context, false);
         if (s.rc != CMPI_RC_OK)
                 return s;
         if (!CMIsNullObject(inst))
                 inst_list_add(list, inst);
 
-        s = get_vsms(ref, &inst, _BROKER, info->context, false);
+        s = get_vsms(vref, &inst, _BROKER, info->context, false);
         if (s.rc != CMPI_RC_OK)
                 return s;
         if (!CMIsNullObject(inst))
             inst_list_add(list, inst);
 
-        s = get_migration_service(ref, &inst, _BROKER, info->context, false);
+        s = get_migration_service(vref, &inst, _BROKER, info->context, false);
         if (s.rc != CMPI_RC_OK)
                 return s;
         if (!CMIsNullObject(inst))
                 inst_list_add(list, inst);
 
-        s = get_console_rs(ref, &inst, _BROKER, info->context, false);
+        s = get_console_rs(vref, &inst, _BROKER, info->context, false);
         if (s.rc != CMPI_RC_OK)
                 return s;
         if (!CMIsNullObject(inst))
                 inst_list_add(list, inst);
-
+ out:
         return s;
 }
 
@@ -130,6 +136,7 @@
         "Xen_HostSystem",
         "KVM_HostSystem",
         "LXC_HostSystem",
+        "Linux_ComputerSystem",
         NULL
 };
 




More information about the Libvirt-cim mailing list