# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1225825186 28800
# Node ID 3471549119039b87933a07cc55ba0d4a2911149e
# Parent a469400c34e0657bd01b9ef91789b0686c661ca4
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(a)us.ibm.com>
diff -r a469400c34e0 -r 347154911903 Makefile.am
--- a/Makefile.am Tue Nov 04 10:59:46 2008 -0800
+++ b/Makefile.am Tue Nov 04 10:59:46 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 a469400c34e0 -r 347154911903 schema/HostedService.registration
--- a/schema/HostedService.registration Tue Nov 04 10:59:46 2008 -0800
+++ b/schema/HostedService.registration Tue Nov 04 10:59:46 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 a469400c34e0 -r 347154911903 src/Virt_HostedService.c
--- a/src/Virt_HostedService.c Tue Nov 04 10:59:46 2008 -0800
+++ b/src/Virt_HostedService.c Tue Nov 04 10:59:46 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
};