# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1220640957 25200
# Node ID e4e78fce79575db03c1629d625a53ec13f33992b
# Parent f0f2c7bf7ec73c937ec24c2c7e1d1c455174c39c
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 f0f2c7bf7ec7 -r e4e78fce7957 src/Virt_ElementConformsToProfile.c
--- a/src/Virt_ElementConformsToProfile.c Thu Sep 04 11:02:56 2008 -0700
+++ b/src/Virt_ElementConformsToProfile.c Fri Sep 05 11:55:57 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 f0f2c7bf7ec7 -r e4e78fce7957 src/profiles.h
--- a/src/profiles.h Thu Sep 04 11:02:56 2008 -0700
+++ b/src/profiles.h Fri Sep 05 11:55:57 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 = "0.8.1",
.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