# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1226593726 28800
# Node ID 0ef4058624c9383119f9550eb410efaf7b057c88
# Parent be6fcb7b57d4cc727c5ee904e0c2e55444eafe81
Make HostedResourcePool work from root/cimv2 and register it there
...so we can get back from HostSystem to our pools.
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r be6fcb7b57d4 -r 0ef4058624c9 Makefile.am
--- a/Makefile.am Thu Nov 13 08:25:41 2008 -0800
+++ b/Makefile.am Thu Nov 13 08:28:46 2008 -0800
@@ -61,6 +61,8 @@
schema/ElementConformsToProfile.mof \
schema/ReferencedProfile.mof
+CIMV2_MOFS = \
+ schema/HostedResourcePool.mof
REGS = \
schema/ComputerSystem.registration \
@@ -112,6 +114,9 @@
schema/ElementConformsToProfile.registration \
schema/ReferencedProfile.registration
+CIMV2_REGS = \
+ schema/HostedResourcePool.registration
+
pkgdata_DATA = $(MOFS) $(REGS) $(INTEROP_MOFS) $(INTEROP_REGS)
pkgdata_SCRIPTS = provider-register.sh
@@ -129,12 +134,14 @@
postinstall:
sh provider-register.sh -v -t @CIMSERVER@ -n @CIM_VIRT_NS@ -r $(REGS) -m $(MOFS)
sh provider-register.sh -v -t @CIMSERVER@ -n root/interop -r $(INTEROP_REGS) -m
$(INTEROP_MOFS)
+ sh provider-register.sh -v -t @CIMSERVER@ -n root/cimv2 -r $(CIMV2_REGS) -m
$(CIMV2_MOFS)
virsh -v | grep -q '^0.3' && cp examples/diskpool.conf
$(DISK_POOL_CONFIG) || true
mkdir -p $(INFO_STORE)
preuninstall:
sh provider-register.sh -v -d -t @CIMSERVER@ -n @CIM_VIRT_NS@ -r $(REGS) -m $(MOFS)
sh provider-register.sh -v -d -t @CIMSERVER@ -n root/interop -r $(INTEROP_REGS) -m
$(INTEROP_MOFS)
+ sh provider-register.sh -v -d -t @CIMSERVER@ -n root/cimv2 -r $(CIMV2_REGS) -m
$(CIMV2_MOFS)
rpm: clean
@(unset CDPATH ; $(MAKE) dist && rpmbuild -ta $(distdir).tar.gz)
diff -r be6fcb7b57d4 -r 0ef4058624c9 base_schema/cimv216-cimv2_mof
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/base_schema/cimv216-cimv2_mof Thu Nov 13 08:28:46 2008 -0800
@@ -0,0 +1,11 @@
+Qualifier IsPUnit : boolean = false,
+ Scope(property, method, parameter);
+
+Qualifier Experimental : boolean = false,
+ Scope(any),
+ Flavor(EnableOverride, Restricted);
+
+#pragma include ("Core/CIM_ResourcePool.mof")
+#pragma include ("Core/CIM_HostedResourcePool.mof")
+#pragma include ("Core/CIM_ElementCapabilities.mof")
+#pragma include ("Core/CIM_HostedService.mof")
diff -r be6fcb7b57d4 -r 0ef4058624c9 base_schema/install_base_schema.sh.in
--- a/base_schema/install_base_schema.sh.in Thu Nov 13 08:25:41 2008 -0800
+++ b/base_schema/install_base_schema.sh.in Thu Nov 13 08:28:46 2008 -0800
@@ -22,6 +22,8 @@
fix_schema() {
(cd ${TMPDIR} && patch -p0 < ${DATA}/fix_schema.patch)
cp -a ${DATA}/cimv216-interop_mof ${TMPDIR}/cimv216-interop.mof
+ cp -a ${DATA}/cimv216-cimv2_mof ${TMPDIR}/cimv216-cimv2.mof
+
}
detect_peg_repo() {
@@ -72,6 +74,7 @@
cimmofl -uc -aEV -R$repo -n $NS qualifiers.mof
cimmofl -uc -aEV -R$repo -n $NS qualifiers_optional.mof
cimmofl -uc -aEV -R$repo -n /root/interop cimv???-interop.mof
+ cimmofl -uc -aEV -R$repo -n /root/cimv2 cimv???-cimv2.mof
}
install_schema_sfcb() {
diff -r be6fcb7b57d4 -r 0ef4058624c9 schema/HostedResourcePool.registration
--- a/schema/HostedResourcePool.registration Thu Nov 13 08:25:41 2008 -0800
+++ b/schema/HostedResourcePool.registration Thu Nov 13 08:28:46 2008 -0800
@@ -3,3 +3,6 @@
Xen_HostedResourcePool root/virt Virt_HostedResourcePool Virt_HostedResourcePool
association
KVM_HostedResourcePool root/virt Virt_HostedResourcePool Virt_HostedResourcePool
association
LXC_HostedResourcePool root/virt Virt_HostedResourcePool Virt_HostedResourcePool
association
+Xen_HostedResourcePool root/cimv2 Virt_HostedResourcePool Virt_HostedResourcePool
association
+KVM_HostedResourcePool root/cimv2 Virt_HostedResourcePool Virt_HostedResourcePool
association
+LXC_HostedResourcePool root/cimv2 Virt_HostedResourcePool Virt_HostedResourcePool
association
diff -r be6fcb7b57d4 -r 0ef4058624c9 src/Virt_HostedResourcePool.c
--- a/src/Virt_HostedResourcePool.c Thu Nov 13 08:25:41 2008 -0800
+++ b/src/Virt_HostedResourcePool.c Thu Nov 13 08:28:46 2008 -0800
@@ -31,6 +31,8 @@
#include <libcmpiutil/libcmpiutil.h>
#include "misc_util.h"
#include <libcmpiutil/std_association.h>
+
+#include <config.h>
#include "Virt_HostSystem.h"
#include "Virt_DevicePool.h"
@@ -68,15 +70,21 @@
{
CMPIStatus s = {CMPI_RC_OK, NULL};
CMPIInstance *inst = NULL;
+ CMPIObjectPath *virtref = NULL;
- if (!match_hypervisor_prefix(ref, info))
+ if (!STARTS_WITH(CLASSNAME(ref), "Linux_") &&
+ !match_hypervisor_prefix(ref, info))
+ goto out;
+
+ virtref = convert_sblim_hostsystem(_BROKER, ref, info);
+ if (virtref == NULL)
goto out;
s = get_host(_BROKER, info->context, ref, &inst, true);
if (s.rc != CMPI_RC_OK)
goto out;
- s = enum_pools(_BROKER, ref, CIM_RES_TYPE_ALL, list);
+ s = enum_pools(_BROKER, virtref, CIM_RES_TYPE_ALL, list);
out:
return s;
@@ -88,6 +96,7 @@
"Xen_HostSystem",
"KVM_HostSystem",
"LXC_HostSystem",
+ "Linux_ComputerSystem",
NULL
};