# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1220475492 25200
# Node ID d0c38e61be2dc6a895c4e9d837d871df551df774
# Parent 2796fd3e2eaa202206430ad59c01dd01cd982ccd
Add Central Class to profile implementation
This allows us to split out and expose several GDRV profiles, one per type
and point to the appropriate ResourcePool as the central class.
Since using the SBLIM hostsystem makes things a little tricky, this
reconnects many of the profiles with the instance they're referring to.
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r 2796fd3e2eaa -r d0c38e61be2d src/Virt_ElementConformsToProfile.c
--- a/src/Virt_ElementConformsToProfile.c Tue Sep 02 14:48:07 2008 -0700
+++ b/src/Virt_ElementConformsToProfile.c Wed Sep 03 13:58:12 2008 -0700
@@ -50,8 +50,8 @@
static CMPIStatus elem_instances(const CMPIObjectPath *ref,
struct std_assoc_info *info,
struct inst_list *list,
- struct reg_prof *profile,
- virConnectPtr conn)
+ virConnectPtr conn,
+ const char *class)
{
CMPIStatus s = {CMPI_RC_OK, NULL};
CMPIObjectPath *op;
@@ -59,11 +59,11 @@
CMPIData data ;
char *classname;
- if (profile->scoping_class == NULL)
+ if (class == NULL)
return s;
classname = get_typed_class(pfx_from_conn(conn),
- profile->scoping_class);
+ class);
if (classname == NULL) {
cu_statusf(_BROKER, &s,
CMPI_RC_ERR_FAILED,
@@ -134,8 +134,13 @@
s = elem_instances(ref,
info,
list,
- profiles[i],
- conn);
+ conn,
+ profiles[i]->scoping_class);
+ s = elem_instances(ref,
+ info,
+ list,
+ conn,
+ profiles[i]->central_class);
break;
}
}
diff -r 2796fd3e2eaa -r d0c38e61be2d src/profiles.h
--- a/src/profiles.h Tue Sep 02 14:48:07 2008 -0700
+++ b/src/profiles.h Wed Sep 03 13:58:12 2008 -0700
@@ -32,6 +32,7 @@
char *other_reg_org;
char *ad_type_descriptions;
char *scoping_class;
+ char *central_class;
struct reg_prof *scoping_profile;
};
@@ -53,11 +54,32 @@
.scoping_profile = &VirtualSystem
};
-struct reg_prof GenericDeviceResourceVirtualization = {
+struct reg_prof GDRVP_Disk = {
.reg_org = 2,
- .reg_id = "CIM:DSP1059-GenericDeviceResourceVirtualization-1.0.0",
+ .reg_id = "CIM:DSP1059-GenericDeviceResourceVirtualization-1.0.0_d",
.reg_name = "Generic Device Resource Virtualization",
.reg_version = "1.0.0",
+ .central_class = "DiskPool",
+ .scoping_class = NULL,
+ .scoping_profile = &SystemVirtualization
+};
+
+struct reg_prof GDRVP_Net = {
+ .reg_org = 2,
+ .reg_id = "CIM:DSP1059-GenericDeviceResourceVirtualization-1.0.0_n",
+ .reg_name = "Generic Device Resource Virtualization",
+ .reg_version = "1.0.0",
+ .central_class = "NetworkPool",
+ .scoping_class = NULL,
+ .scoping_profile = &SystemVirtualization
+};
+
+struct reg_prof GDRVP_Proc = {
+ .reg_org = 2,
+ .reg_id = "CIM:DSP1059-GenericDeviceResourceVirtualization-1.0.0_p",
+ .reg_name = "Generic Device Resource Virtualization",
+ .reg_version = "1.0.0",
+ .central_class = "ProcessorPool",
.scoping_class = NULL,
.scoping_profile = &SystemVirtualization
};
@@ -68,6 +90,7 @@
.reg_name = "Memory Resource Virtualization",
.reg_version = "1.0.0",
.scoping_class = NULL,
+ .central_class = "MemoryPool",
.scoping_profile = &SystemVirtualization
};
@@ -77,6 +100,7 @@
.reg_name = "Virtual System Migration",
.reg_version = "1.0",
.scoping_class = NULL,
+ .central_class = "VirtualSystemMigrationService",
.scoping_profile = &SystemVirtualization
};
@@ -84,7 +108,9 @@
struct reg_prof *profiles[] = {
&SystemVirtualization,
&VirtualSystem,
- &GenericDeviceResourceVirtualization,
+ &GDRVP_Disk,
+ &GDRVP_Net,
+ &GDRVP_Proc,
&MemoryResourceVirtualization,
&VirtualSystemMigration,
NULL