# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1225825186 28800
# Node ID a469400c34e0657bd01b9ef91789b0686c661ca4
# Parent 39f290b8978e20c122a7ccf3ad702feeaae4e52a
Make ElementCapabilities work from root/cimv2 and register it there
...so we can get back from HostSystem to our Capabilities
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r 39f290b8978e -r a469400c34e0 Makefile.am
--- a/Makefile.am Tue Nov 04 10:59:14 2008 -0800
+++ b/Makefile.am Tue Nov 04 10:59:46 2008 -0800
@@ -62,7 +62,8 @@
schema/ReferencedProfile.mof
CIMV2_MOFS = \
- schema/HostedResourcePool.mof
+ schema/HostedResourcePool.mof \
+ schema/ElementCapabilities.mof
REGS = \
schema/ComputerSystem.registration \
@@ -115,7 +116,8 @@
schema/ReferencedProfile.registration
CIMV2_REGS = \
- schema/HostedResourcePool.registration
+ schema/HostedResourcePool.registration \
+ schema/ElementCapabilities.registration
pkgdata_DATA = $(MOFS) $(REGS) $(INTEROP_MOFS) $(INTEROP_REGS)
pkgdata_SCRIPTS = provider-register.sh
diff -r 39f290b8978e -r a469400c34e0 schema/ElementCapabilities.registration
--- a/schema/ElementCapabilities.registration Tue Nov 04 10:59:14 2008 -0800
+++ b/schema/ElementCapabilities.registration Tue Nov 04 10:59:46 2008 -0800
@@ -3,3 +3,6 @@
Xen_ElementCapabilities root/virt Virt_ElementCapabilities Virt_ElementCapabilities
association
KVM_ElementCapabilities root/virt Virt_ElementCapabilities Virt_ElementCapabilities
association
LXC_ElementCapabilities root/virt Virt_ElementCapabilities Virt_ElementCapabilities
association
+Xen_ElementCapabilities root/cimv2 Virt_ElementCapabilities Virt_ElementCapabilities
association
+KVM_ElementCapabilities root/cimv2 Virt_ElementCapabilities Virt_ElementCapabilities
association
+LXC_ElementCapabilities root/cimv2 Virt_ElementCapabilities Virt_ElementCapabilities
association
diff -r 39f290b8978e -r a469400c34e0 src/Virt_ElementCapabilities.c
--- a/src/Virt_ElementCapabilities.c Tue Nov 04 10:59:14 2008 -0800
+++ b/src/Virt_ElementCapabilities.c Tue Nov 04 10:59:46 2008 -0800
@@ -146,27 +146,33 @@
{
CMPIInstance *inst = NULL;
CMPIStatus s = {CMPI_RC_OK, NULL};
+ CMPIObjectPath *vref = NULL;
- if (!match_hypervisor_prefix(ref, info))
+ if (!STARTS_WITH(CLASSNAME(ref), "Linux_") &&
+ !match_hypervisor_prefix(ref, info))
goto out;
s = get_host(_BROKER, info->context, ref, &inst, true);
if (s.rc != CMPI_RC_OK)
goto out;
- s = get_vsm_cap(_BROKER, ref, &inst, false);
+ vref = convert_sblim_hostsystem(_BROKER, ref, info);
+ if (vref == NULL)
+ goto out;
+
+ s = get_vsm_cap(_BROKER, vref, &inst, false);
if (s.rc == CMPI_RC_OK)
inst_list_add(list, inst);
- s = get_migration_caps(ref, &inst, _BROKER, false);
+ s = get_migration_caps(vref, &inst, _BROKER, false);
if (s.rc == CMPI_RC_OK)
inst_list_add(list, inst);
- s = get_console_rs_caps(_BROKER, ref, &inst, false);
+ s = get_console_rs_caps(_BROKER, vref, &inst, false);
if (s.rc == CMPI_RC_OK)
inst_list_add(list, inst);
- s = enum_alloc_cap_instances(_BROKER, ref, NULL, NULL, list);
+ s = enum_alloc_cap_instances(_BROKER, vref, NULL, NULL, list);
if (s.rc != CMPI_RC_OK) {
CU_DEBUG("Failed to enum AC: %s",
CMGetCharPtr(s.msg));
@@ -393,6 +399,7 @@
"Xen_HostSystem",
"KVM_HostSystem",
"LXC_HostSystem",
+ "Linux_ComputerSystem",
NULL
};
@@ -409,6 +416,7 @@
"LXC_VirtualSystemManagementService",
"LXC_VirtualSystemMigrationService",
"LXC_ConsoleRedirectionService",
+ "Linux_ComputerSystem",
NULL
};