# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1195493851 28800
# Node ID 3957678edbd4b7ed01011ac08a0771529a8c335b
# Parent ea31aaa60fb3f4164ee296c349d45e73a36149a5
Make VSMS use connect_by_classname()
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r ea31aaa60fb3 -r 3957678edbd4 src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c Mon Nov 19 09:32:33 2007 -0800
+++ b/src/Virt_VirtualSystemManagementService.c Mon Nov 19 09:37:31 2007 -0800
@@ -482,7 +482,7 @@ static CMPIStatus update_system_settings
goto out;
}
- conn = lv_connect(_BROKER, &s);
+ conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s);
if (conn == NULL)
goto out;
@@ -587,7 +587,8 @@ static struct virt_device **find_list(st
static CMPIStatus _resource_dynamic(struct domain *dominfo,
struct virt_device *dev,
- enum ResourceAction action)
+ enum ResourceAction action,
+ const char *refcn)
{
CMPIStatus s;
virConnectPtr conn;
@@ -608,7 +609,7 @@ static CMPIStatus _resource_dynamic(stru
return s;
}
- conn = lv_connect(_BROKER, &s);
+ conn = connect_by_classname(_BROKER, refcn, &s);
if (conn == NULL) {
CU_DEBUG("Failed to connect");
return s;
@@ -653,11 +654,16 @@ static CMPIStatus resource_del(struct do
const char *devid)
{
CMPIStatus s;
+ CMPIObjectPath *op;
struct virt_device **_list;
struct virt_device *list;
int *count;
int i;
+ op = CMGetObjectPath(rasd, &s);
+ if ((op == NULL) || (s.rc != CMPI_RC_OK))
+ goto out;
+
_list = find_list(dominfo, type, &count);
if ((type == CIM_RASD_TYPE_MEM) || (_list != NULL))
list = *_list;
@@ -677,7 +683,10 @@ static CMPIStatus resource_del(struct do
struct virt_device *dev = &list[i];
if (STREQ(dev->id, devid)) {
- s = _resource_dynamic(dominfo, dev, RESOURCE_DEL);
+ s = _resource_dynamic(dominfo,
+ dev,
+ RESOURCE_DEL,
+ CLASSNAME(op));
dev->type = VIRT_DEV_UNKNOWN;
break;
}
@@ -693,11 +702,16 @@ static CMPIStatus resource_add(struct do
const char *devid)
{
CMPIStatus s;
+ CMPIObjectPath *op;
struct virt_device **_list;
struct virt_device *list;
struct virt_device *dev;
int *count;
+ op = CMGetObjectPath(rasd, &s);
+ if ((op == NULL) || (s.rc != CMPI_RC_OK))
+ goto out;
+
_list = find_list(dominfo, type, &count);
if ((type == CIM_RASD_TYPE_MEM) || (_list == NULL)) {
cu_statusf(_BROKER, &s,
@@ -734,7 +748,7 @@ static CMPIStatus resource_add(struct do
dev->id = strdup(devid);
rasd_to_vdev(rasd, dev);
- s = _resource_dynamic(dominfo, dev, RESOURCE_ADD);
+ s = _resource_dynamic(dominfo, dev, RESOURCE_ADD, CLASSNAME(op));
if (s.rc != CMPI_RC_OK)
goto out;
@@ -751,11 +765,16 @@ static CMPIStatus resource_mod(struct do
const char *devid)
{
CMPIStatus s;
+ CMPIObjectPath *op;
struct virt_device **_list;
struct virt_device *list;
int *count;
int i;
+ op = CMGetObjectPath(rasd, &s);
+ if ((op == NULL) || (s.rc != CMPI_RC_OK))
+ goto out;
+
_list = find_list(dominfo, type, &count);
if (_list != NULL)
list = *_list;
@@ -776,7 +795,10 @@ static CMPIStatus resource_mod(struct do
if (STREQ(dev->id, devid)) {
rasd_to_vdev(rasd, dev);
- s = _resource_dynamic(dominfo, dev, RESOURCE_MOD);
+ s = _resource_dynamic(dominfo,
+ dev,
+ RESOURCE_MOD,
+ CLASSNAME(op));
break;
}
}
@@ -850,7 +872,7 @@ static CMPIStatus _update_resource_setti
virConnectPtr conn = NULL;
CMPIStatus s;
- conn = lv_connect(_BROKER, &s);
+ conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s);
if (conn == NULL)
goto out;