# HG changeset patch
# User Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
# Date 1204541458 -3600
# Node ID 15e12adf6218a512063fe87b836b87e8e3aed569
# Parent 7a93b0ab4de3663e75f43176cce67b70e2064fd7
SD: adopt changes in ComputerSystem provider interface
Signed-off-by: Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
diff -r 7a93b0ab4de3 -r 15e12adf6218 src/Virt_SystemDevice.c
--- a/src/Virt_SystemDevice.c Mon Mar 03 11:50:57 2008 +0100
+++ b/src/Virt_SystemDevice.c Mon Mar 03 11:50:58 2008 +0100
@@ -97,37 +97,6 @@ static int get_all_devices(const char *n
return i;
}
-static CMPIInstance *host_instance(char *name,
- const CMPIObjectPath *ref)
-{
- CMPIInstance *inst = NULL;
- virConnectPtr conn = NULL;
- CMPIStatus s;
- CMPIObjectPath *op;
- char *host_class;
-
- host_class = get_typed_class(CLASSNAME(ref),
- "ComputerSystem");
- if (host_class == NULL)
- goto out;
-
- op = CMNewObjectPath(_BROKER, NAMESPACE(ref), host_class, &s);
- if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op))
- goto out;
-
- conn = connect_by_classname(_BROKER, host_class, &s);
- if (conn == NULL)
- goto out;
-
- inst = instance_from_name(_BROKER, conn, name, op);
-
- out:
- free(host_class);
- virConnectClose(conn);
-
- return inst;
-}
-
static CMPIStatus sys_to_dev(const CMPIObjectPath *ref,
struct std_assoc_info *info,
struct inst_list *list)
@@ -140,7 +109,7 @@ static CMPIStatus sys_to_dev(const CMPIO
if (!match_hypervisor_prefix(ref, info))
return s;
- s = get_domain(_BROKER, ref, &inst);
+ s = get_domain_by_ref(_BROKER, ref, &inst);
if (s.rc != CMPI_RC_OK)
goto out;
@@ -177,7 +146,6 @@ static CMPIStatus dev_to_sys(const CMPIO
const char *devid = NULL;
char *host = NULL;
char *dev = NULL;
- CMPIInstance *sys;
CMPIInstance *inst = NULL;
CMPIStatus s = {CMPI_RC_OK, NULL};
@@ -202,18 +170,11 @@ static CMPIStatus dev_to_sys(const CMPIO
goto out;
}
- sys = host_instance(host, ref);
-
- if (sys == NULL)
- cu_statusf(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "Unable to find DeviceID `%s'", devid);
- else {
- inst_list_add(list, sys);
- cu_statusf(_BROKER, &s,
- CMPI_RC_OK,
- "");
- }
+ s = get_domain_by_name(_BROKER, ref, host, &inst);
+ if (s.rc != CMPI_RC_OK)
+ goto out;
+
+ inst_list_add(list, inst);
out:
free(dev);