# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1196194912 28800
# Node ID 64da04a35e65ed87ee6bd144cdbf5a9d8efd9383
# Parent 57656dc04de25a4b9b4986d94f73b42c9db571b9
Fixes to SystemDevice for libcmpiutil API change
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r 57656dc04de2 -r 64da04a35e65 src/Virt_SystemDevice.c
--- a/src/Virt_SystemDevice.c Tue Nov 27 12:21:29 2007 -0800
+++ b/src/Virt_SystemDevice.c Tue Nov 27 12:21:52 2007 -0800
@@ -158,14 +158,13 @@ static CMPIStatus sys_to_dev(const CMPIO
struct std_assoc_info *info,
struct inst_list *list)
{
- char *host = NULL;
+ const char *host = NULL;
CMPIStatus s = {CMPI_RC_OK, NULL};
int ret;
ASSOC_MATCH(info->provider_name, CLASSNAME(ref));
- host = cu_get_str_path(ref, "Name");
- if (host == NULL) {
+ if (cu_get_str_path(ref, "Name", &host) != CMPI_RC_OK) {
cu_statusf(_BROKER, &s,
CMPI_RC_ERR_FAILED,
"Missing Name");
@@ -205,7 +204,7 @@ static CMPIStatus dev_to_sys(const CMPIO
struct std_assoc_info *info,
struct inst_list *list)
{
- char *devid = NULL;
+ const char *devid = NULL;
char *host = NULL;
char *dev = NULL;
CMPIInstance *sys;
@@ -213,8 +212,7 @@ static CMPIStatus dev_to_sys(const CMPIO
ASSOC_MATCH(info->provider_name, CLASSNAME(ref));
- devid = cu_get_str_path(ref, "DeviceID");
- if (devid == NULL) {
+ if (cu_get_str_path(ref, "DeviceID", &devid) != CMPI_RC_OK) {
cu_statusf(_BROKER, &s,
CMPI_RC_ERR_FAILED,
"Missing DeviceID");
@@ -242,7 +240,6 @@ static CMPIStatus dev_to_sys(const CMPIO
out:
free(dev);
free(host);
- free(devid);
return s;
}