# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1226594012 28800
# Node ID 73d746ef73a16ac4212e9c7459dfd0bfc50fb2e2
# Parent 0ef4058624c9383119f9550eb410efaf7b057c88
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 0ef4058624c9 -r 73d746ef73a1 Makefile.am
--- a/Makefile.am Thu Nov 13 08:28:46 2008 -0800
+++ b/Makefile.am Thu Nov 13 08:33:32 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 0ef4058624c9 -r 73d746ef73a1 schema/ElementCapabilities.registration
--- a/schema/ElementCapabilities.registration Thu Nov 13 08:28:46 2008 -0800
+++ b/schema/ElementCapabilities.registration Thu Nov 13 08:33:32 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 0ef4058624c9 -r 73d746ef73a1 src/Virt_ElementCapabilities.c
--- a/src/Virt_ElementCapabilities.c Thu Nov 13 08:28:46 2008 -0800
+++ b/src/Virt_ElementCapabilities.c Thu Nov 13 08:33:32 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
};