# HG changeset patch
# User Jay Gagnon <grendel(a)linux.vnet.ibm.com>
# Date 1196197789 18000
# Node ID d798c4c8a940eeb6d24cdb89eb0bf7141c928e19
# Parent c1c0c6a064474701ec5e743d32819f179553c540
Convert CMSetStatusWithChars calls to cu_statusf, clean up.
We use cu_statusf everywhere already, the minimum call syntax is the same (plus printf
style formatting for free) and the name is about sixty characters shorter.
Also make sure the calls are formatted correctly.
Signed-off-by: Jay Gagnon <grendel(a)linux.vnet.ibm.com>
diff -r c1c0c6a06447 -r d798c4c8a940 libxkutil/misc_util.c
--- a/libxkutil/misc_util.c Mon Nov 26 10:32:08 2007 -0800
+++ b/libxkutil/misc_util.c Tue Nov 27 16:09:49 2007 -0500
@@ -60,9 +60,9 @@ virConnectPtr connect_by_classname(const
uri = cn_to_uri(classname);
if (!uri) {
- CMSetStatusWithChars(broker, s,
- CMPI_RC_ERR_FAILED,
- "Unable to generate URI from classname");
+ cu_statusf(broker, s,
+ CMPI_RC_ERR_FAILED,
+ "Unable to generate URI from classname");
return NULL;
}
diff -r c1c0c6a06447 -r d798c4c8a940 src/Virt_AllocationCapabilities.c
--- a/src/Virt_AllocationCapabilities.c Mon Nov 26 10:32:08 2007 -0800
+++ b/src/Virt_AllocationCapabilities.c Tue Nov 27 16:09:49 2007 -0500
@@ -51,15 +51,17 @@ CMPIStatus get_alloc_cap(const CMPIBroke
NAMESPACE(ref));
if (rasd_type_from_classname(CLASSNAME(ref), &type) != CMPI_RC_OK) {
- CMSetStatusWithChars(broker, &s, CMPI_RC_ERR_FAILED,
- "Could not get ResourceType.");
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "Could not get ResourceType.");
goto out;
}
ret = asprintf(&inst_id, "%hi/%s", type, "0");
if (ret == -1) {
- CMSetStatusWithChars(broker, &s, CMPI_RC_ERR_FAILED,
- "Could not get InstanceID.");
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "Could not get InstanceID.");
goto out;
}
diff -r c1c0c6a06447 -r d798c4c8a940 src/Virt_ComputerSystem.c
--- a/src/Virt_ComputerSystem.c Mon Nov 26 10:32:08 2007 -0800
+++ b/src/Virt_ComputerSystem.c Tue Nov 27 16:09:49 2007 -0500
@@ -446,9 +446,9 @@ static CMPIStatus GetInstance(CMPIInstan
if (name == NULL) {
CMPIStatus s;
- CMSetStatusWithChars(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "No domain name specified");
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "No domain name specified");
return s;
}
@@ -492,15 +492,15 @@ static CMPIStatus state_change_enable(vi
break;
default:
printf("Cannot go to enabled state from %i\n",
info->state);
- CMSetStatusWithChars(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "Invalid state transition");
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Invalid state transition");
};
if (ret != 0)
- CMSetStatusWithChars(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "Domain Operation Failed");
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Domain Operation Failed");
return s;
}
@@ -517,15 +517,15 @@ static CMPIStatus state_change_disable(v
break;
default:
printf("Cannot go to disabled state from %i\n",
info->state);
- CMSetStatusWithChars(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "Invalid state transition");
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Invalid state transition");
};
if (ret != 0)
- CMSetStatusWithChars(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "Domain Operation Failed");
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Domain Operation Failed");
return s;
}
@@ -541,15 +541,15 @@ static CMPIStatus state_change_pause(vir
ret = virDomainSuspend(dom);
break;
default:
- CMSetStatusWithChars(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "Domain not running");
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Domain not running");
};
if (ret != 0)
- CMSetStatusWithChars(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "Domain Operation Failed");
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Domain Operation Failed");
return s;
}
@@ -565,15 +565,15 @@ static CMPIStatus state_change_reboot(vi
ret = virDomainReboot(dom, 0);
break;
default:
- CMSetStatusWithChars(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "Domain not running");
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Domain not running");
};
if (ret != 0)
- CMSetStatusWithChars(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "Domain Operation Failed");
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Domain Operation Failed");
return s;
}
@@ -589,15 +589,15 @@ static CMPIStatus state_change_reset(vir
ret = domain_reset(dom);
break;
default:
- CMSetStatusWithChars(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "Domain not running");
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Domain not running");
};
if (ret != 0)
- CMSetStatusWithChars(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "Domain Operation Failed");
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Domain Operation Failed");
return s;
}
@@ -617,16 +617,16 @@ static CMPIStatus __state_change(char *n
dom = virDomainLookupByName(conn, name);
if (dom == NULL) {
- CMSetStatusWithChars(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "Domain not found");
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Domain not found");
goto out;
}
if (virDomainGetInfo(dom, &info) != 0) {
- CMSetStatusWithChars(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "Unable to get current state");
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Unable to get current state");
goto out;
}
@@ -670,9 +670,9 @@ static CMPIStatus state_change(CMPIMetho
name = cu_get_str_path(reference, "Name");
if (name == NULL) {
- CMSetStatusWithChars(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "Name key not specified");
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Name key not specified");
goto out;
}
diff -r c1c0c6a06447 -r d798c4c8a940 src/Virt_Device.c
--- a/src/Virt_Device.c Mon Nov 26 10:32:08 2007 -0800
+++ b/src/Virt_Device.c Tue Nov 27 16:09:49 2007 -0500
@@ -371,9 +371,9 @@ static CMPIStatus enum_devices(const CMP
return s;
if (!dom_list_devices(conn, reference, &list)) {
- CMSetStatusWithChars(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "Failed to list domains");
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Failed to list domains");
return s;
}
@@ -492,9 +492,9 @@ static CMPIStatus get_device(const CMPIO
CMReturnInstance(results, inst);
CMSetStatus(&s, CMPI_RC_OK);
} else {
- CMSetStatusWithChars(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "Unable to get device instance");
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Unable to get device instance");
}
virConnectClose(conn);
@@ -531,9 +531,9 @@ static CMPIStatus GetInstance(CMPIInstan
if (devid == NULL) {
CMPIStatus s;
- CMSetStatusWithChars(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "No DeviceID specified");
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "No DeviceID specified");
return s;
}
diff -r c1c0c6a06447 -r d798c4c8a940 src/Virt_ElementCapabilities.c
--- a/src/Virt_ElementCapabilities.c Mon Nov 26 10:32:08 2007 -0800
+++ b/src/Virt_ElementCapabilities.c Tue Nov 27 16:09:49 2007 -0500
@@ -67,7 +67,8 @@ static CMPIStatus sys_to_cap(const CMPIO
sys_name = cu_get_str_path(ref, "Name");
if (!STREQ(sys_name, host_name)) {
- cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED,
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
"System '%s' is not a host system.",
sys_name);
goto out;
}
@@ -203,8 +204,9 @@ static CMPIStatus pool_to_alloc(const CM
inst_id = cu_get_str_path(ref, "InstanceID");
if (inst_id == NULL) {
- CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED,
- "Could not get InstanceID.");
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Could not get InstanceID.");
goto out;
}
@@ -216,8 +218,9 @@ static CMPIStatus pool_to_alloc(const CM
ret = cu_get_u16_path(ref, "ResourceType", &type);
if (ret != 1) {
- CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED,
- "Could not get ResourceType.");
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Could not get ResourceType.");
goto out;
}
CMSetProperty(inst, "ResourceType", &type, CMPI_uint16);
diff -r c1c0c6a06447 -r d798c4c8a940 src/Virt_ElementConformsToProfile.c
--- a/src/Virt_ElementConformsToProfile.c Mon Nov 26 10:32:08 2007 -0800
+++ b/src/Virt_ElementConformsToProfile.c Tue Nov 27 16:09:49 2007 -0500
@@ -60,9 +60,9 @@ static CMPIStatus elem_instances(const C
classname = get_typed_class("Xen", profile->provider_name);
if (classname == NULL) {
- CMSetStatusWithChars(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "Can't assemble classname." );
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Can't assemble classname." );
goto out;
}
@@ -72,18 +72,18 @@ static CMPIStatus elem_instances(const C
en = CBEnumInstances(_BROKER, info->context , op, NULL, &s);
if (en == NULL) {
- CMSetStatusWithChars(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "Upcall enumInstances to target class
failed.");
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Upcall enumInstances to target class failed.");
goto error;
}
while (CMHasNext(en, &s)) {
data = CMGetNext(en, &s);
if (CMIsNullObject(data.value.inst)) {
- CMSetStatusWithChars(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "Failed to retrieve enumeration
entry.");
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Failed to retrieve enumeration entry.");
goto error;
}
@@ -106,9 +106,9 @@ static CMPIStatus prof_to_elem(const CMP
id = cu_get_str_path(ref, "InstanceID");
if (id == NULL) {
- CMSetStatusWithChars(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "No InstanceID specified");
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "No InstanceID specified");
goto out;
}
@@ -139,8 +139,9 @@ static CMPIStatus elem_to_prof(const CMP
classname = class_base_name(CLASSNAME(ref));
if (classname == NULL) {
- CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED,
- "Can't get class name.");
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Can't get class name.");
goto out;
}
@@ -154,8 +155,9 @@ static CMPIStatus elem_to_prof(const CMP
NULL,
candidate);
if (instance == NULL) {
- CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED,
- "Can't create profile
instance.");
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Can't create profile instance.");
goto error;
}
diff -r c1c0c6a06447 -r d798c4c8a940 src/Virt_EnabledLogicalElementCapabilities.c
--- a/src/Virt_EnabledLogicalElementCapabilities.c Mon Nov 26 10:32:08 2007 -0800
+++ b/src/Virt_EnabledLogicalElementCapabilities.c Tue Nov 27 16:09:49 2007 -0500
@@ -64,8 +64,9 @@ static CMPIStatus set_inst_properties(co
devid = get_fq_devid((char *)sys_name, "0");
if (devid == NULL) {
- CMSetStatusWithChars(broker, &s, CMPI_RC_ERR_FAILED,
- "Could not get full ID.");
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "Could not get full ID.");
goto error1;
}
@@ -112,34 +113,34 @@ CMPIStatus get_ele_cap(const CMPIBroker
sys_name = cu_get_str_path(ref, "Name");
if (sys_name == NULL) {
- CMSetStatusWithChars(broker, &s,
- CMPI_RC_ERR_FAILED,
- "Missing key: Name");
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "Missing key: Name");
goto out;
}
classname = get_typed_class(CLASSNAME(ref),
"EnabledLogicalElementCapabilities");
if (classname == NULL) {
- CMSetStatusWithChars(broker, &s,
- CMPI_RC_ERR_FAILED,
- "Invalid class");
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "Invalid class");
goto out;
}
op = CMNewObjectPath(broker, NAMESPACE(ref), classname, &s);
if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) {
- CMSetStatusWithChars(broker, &s,
- CMPI_RC_ERR_FAILED,
- "Cannot get object path for
ELECapabilities");
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "Cannot get object path for ELECapabilities");
goto out;
}
*inst = CMNewInstance(broker, op, &s);
if ((s.rc != CMPI_RC_OK) || (CMIsNullObject(*inst))) {
- CMSetStatusWithChars(broker, &s,
- CMPI_RC_ERR_FAILED,
- "Failed to instantiate HostSystem");
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "Failed to instantiate HostSystem");
goto out;
}
diff -r c1c0c6a06447 -r d798c4c8a940 src/Virt_HostSystem.c
--- a/src/Virt_HostSystem.c Mon Nov 26 10:32:08 2007 -0800
+++ b/src/Virt_HostSystem.c Tue Nov 27 16:09:49 2007 -0500
@@ -67,25 +67,25 @@ CMPIStatus get_host_cs(const CMPIBroker
classname = get_typed_class(CLASSNAME(reference), "HostSystem");
if (classname == NULL) {
- CMSetStatusWithChars(broker, &s,
- CMPI_RC_ERR_FAILED,
- "Invalid class");
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "Invalid class");
goto out;
}
op = CMNewObjectPath(broker, ns, classname, &s);
if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) {
- CMSetStatusWithChars(broker, &s,
- CMPI_RC_ERR_FAILED,
- "Cannot get object path for HostSystem");
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "Cannot get object path for HostSystem");
goto out;
}
inst = CMNewInstance(broker, op, &s);
if ((s.rc != CMPI_RC_OK) || (CMIsNullObject(op))) {
- CMSetStatusWithChars(broker, &s,
- CMPI_RC_ERR_FAILED,
- "Failed to instantiate HostSystem");
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "Failed to instantiate HostSystem");
goto out;
}
diff -r c1c0c6a06447 -r d798c4c8a940 src/Virt_HostedDependency.c
--- a/src/Virt_HostedDependency.c Mon Nov 26 10:32:08 2007 -0800
+++ b/src/Virt_HostedDependency.c Tue Nov 27 16:09:49 2007 -0500
@@ -66,9 +66,9 @@ static CMPIStatus host_to_vs(const CMPIO
if (ret) {
CMSetStatus(&s, CMPI_RC_OK);
} else {
- CMSetStatusWithChars(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "Failed to get domain list");
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Failed to get domain list");
}
CMSetStatus(&s, CMPI_RC_OK);
diff -r c1c0c6a06447 -r d798c4c8a940 src/Virt_HostedResourcePool.c
--- a/src/Virt_HostedResourcePool.c Mon Nov 26 10:32:08 2007 -0800
+++ b/src/Virt_HostedResourcePool.c Tue Nov 27 16:09:49 2007 -0500
@@ -71,8 +71,7 @@ static CMPIStatus sys_to_pool(const CMPI
if (prop != NULL) {
cu_statusf(_BROKER, &s,
CMPI_RC_ERR_NOT_FOUND,
- "No such HostSystem instance (%s)",
- prop);
+ "No such HostSystem instance (%s)", prop);
return s;
}
diff -r c1c0c6a06447 -r d798c4c8a940 src/Virt_RegisteredProfile.c
--- a/src/Virt_RegisteredProfile.c Mon Nov 26 10:32:08 2007 -0800
+++ b/src/Virt_RegisteredProfile.c Tue Nov 27 16:09:49 2007 -0500
@@ -103,8 +103,9 @@ static CMPIStatus enum_profs(const CMPIO
properties,
profiles[i]);
if (instance == NULL) {
- CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED,
- "Can't create profile
instance.");
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Can't create profile instance.");
goto out;
}
@@ -129,9 +130,9 @@ static CMPIStatus get_prof(const CMPIObj
id = cu_get_str_path(ref, "InstanceID");
if (id == NULL) {
- CMSetStatusWithChars(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "No InstanceID specified");
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "No InstanceID specified");
return s;
}
diff -r c1c0c6a06447 -r d798c4c8a940 src/Virt_SettingsDefineCapabilities.c
--- a/src/Virt_SettingsDefineCapabilities.c Mon Nov 26 10:32:08 2007 -0800
+++ b/src/Virt_SettingsDefineCapabilities.c Tue Nov 27 16:09:49 2007 -0500
@@ -697,8 +697,9 @@ static CMPIInstance *sdc_rasd_inst(const
range = SDC_RANGE_POINT;
break;
default:
- CMSetStatusWithChars(broker, s, CMPI_RC_ERR_FAILED,
- "Unsupported sdc_rasd type.");
+ cu_statusf(broker, s,
+ CMPI_RC_ERR_FAILED,
+ "Unsupported sdc_rasd type.");
goto out;
}
@@ -765,8 +766,9 @@ static CMPIStatus sdc_rasds_for_type(con
} else {
CU_DEBUG("Unsupported type.");
- CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED,
- "Unsupported device type.");
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Unsupported device type.");
}
out:
@@ -785,8 +787,9 @@ static CMPIStatus alloc_cap_to_rasd(cons
ret = cu_get_u16_path(ref, "ResourceType", &type);
if (ret != 1) {
- CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED,
- "Could not get ResourceType.");
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Could not get ResourceType.");
goto out;
}
diff -r c1c0c6a06447 -r d798c4c8a940 src/Virt_VSSD.c
--- a/src/Virt_VSSD.c Mon Nov 26 10:32:08 2007 -0800
+++ b/src/Virt_VSSD.c Tue Nov 27 16:09:49 2007 -0500
@@ -143,9 +143,9 @@ static CMPIStatus enum_vssd(const CMPIOb
count = get_domain_list(conn, &list);
if (count < 0) {
- CMSetStatusWithChars(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "Failed to enumerate domains");
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Failed to enumerate domains");
goto out;
} else if (count == 0) {
CMSetStatus(&s, CMPI_RC_OK);
@@ -229,7 +229,7 @@ static CMPIStatus GetInstance(CMPIInstan
if (!parse_instanceid(reference, NULL, &locid)) {
cu_statusf(_BROKER, &s,
CMPI_RC_ERR_FAILED,
- "Invalid InstanceID specified");
+ "Invalid InstanceID specified");
return s;
}
diff -r c1c0c6a06447 -r d798c4c8a940 src/Virt_VirtualSystemManagementCapabilities.c
--- a/src/Virt_VirtualSystemManagementCapabilities.c Mon Nov 26 10:32:08 2007 -0800
+++ b/src/Virt_VirtualSystemManagementCapabilities.c Tue Nov 27 16:09:49 2007 -0500
@@ -60,8 +60,9 @@ static CMPIStatus set_inst_properties(co
devid = get_fq_devid((char *)sys_name, "0");
if (devid == NULL) {
- CMSetStatusWithChars(broker, &s, CMPI_RC_ERR_FAILED,
- "Could not get full ID.");
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "Could not get full ID.");
goto out;
}
CMSetProperty(inst, "InstanceID", (CMPIValue *)devid, CMPI_chars);
@@ -99,34 +100,34 @@ CMPIStatus get_vsm_cap(const CMPIBroker
sys_name = cu_get_str_path(ref, "Name");
if (sys_name == NULL) {
- CMSetStatusWithChars(broker, &s,
- CMPI_RC_ERR_FAILED,
- "Missing key: Name");
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "Missing key: Name");
goto out;
}
classname = get_typed_class(CLASSNAME(ref),
"VirtualSystemManagementCapabilities");
if (classname == NULL) {
- CMSetStatusWithChars(broker, &s,
- CMPI_RC_ERR_FAILED,
- "Invalid class");
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "Invalid class");
goto out;
}
op = CMNewObjectPath(broker, NAMESPACE(ref), classname, &s);
if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) {
- CMSetStatusWithChars(broker, &s,
- CMPI_RC_ERR_FAILED,
- "Cannot get object path for
VSMCapabilities");
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "Cannot get object path for VSMCapabilities");
goto out;
}
*inst = CMNewInstance(broker, op, &s);
if ((s.rc != CMPI_RC_OK) || (CMIsNullObject(*inst))) {
- CMSetStatusWithChars(broker, &s,
- CMPI_RC_ERR_FAILED,
- "Failed to instantiate HostSystem");
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "Failed to instantiate HostSystem");
goto out;
}
diff -r c1c0c6a06447 -r d798c4c8a940 src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c Mon Nov 26 10:32:08 2007 -0800
+++ b/src/Virt_VirtualSystemManagementService.c Tue Nov 27 16:09:49 2007 -0500
@@ -108,9 +108,9 @@ static CMPIStatus define_system_parse_ar
sys);
if (ret) {
CU_DEBUG("Unable to parse SystemSettings instance");
- CMSetStatusWithChars(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "SystemSettings parse error");
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "SystemSettings parse error");
goto out;
}
@@ -287,9 +287,9 @@ static CMPIInstance *connect_and_create(
dom = virDomainDefineXML(conn, xml);
if (dom == NULL) {
CU_DEBUG("Failed to define domain from XML");
- CMSetStatusWithChars(_BROKER, s,
- CMPI_RC_ERR_FAILED,
- "Failed to create domain");
+ cu_statusf(_BROKER, s,
+ CMPI_RC_ERR_FAILED,
+ "Failed to create domain");
return NULL;
}
@@ -297,9 +297,9 @@ static CMPIInstance *connect_and_create(
inst = instance_from_name(_BROKER, conn, (char *)name, ref);
if (inst == NULL) {
CU_DEBUG("Failed to get new instance");
- CMSetStatusWithChars(_BROKER, s,
- CMPI_RC_ERR_FAILED,
- "Failed to lookup resulting system");
+ cu_statusf(_BROKER, s,
+ CMPI_RC_ERR_FAILED,
+ "Failed to lookup resulting system");
}
virConnectClose(conn);
@@ -636,8 +636,7 @@ static CMPIStatus _resource_dynamic(stru
if (func(dom, dev) == 0) {
cu_statusf(_BROKER, &s,
CMPI_RC_ERR_FAILED,
- "Unable to change (%i) device",
- action);
+ "Unable to change (%i) device", action);
} else {
CMSetStatus(&s, CMPI_RC_OK);
}
@@ -670,8 +669,7 @@ static CMPIStatus resource_del(struct do
else {
cu_statusf(_BROKER, &s,
CMPI_RC_ERR_FAILED,
- "Cannot delete resources of type %" PRIu16,
- type);
+ "Cannot delete resources of type %" PRIu16, type);
goto out;
}
@@ -716,8 +714,7 @@ static CMPIStatus resource_add(struct do
if ((type == CIM_RASD_TYPE_MEM) || (_list == NULL)) {
cu_statusf(_BROKER, &s,
CMPI_RC_ERR_FAILED,
- "Cannot add resources of type %" PRIu16,
- type);
+ "Cannot add resources of type %" PRIu16, type);
goto out;
}
@@ -727,8 +724,7 @@ static CMPIStatus resource_add(struct do
*/
cu_statusf(_BROKER, &s,
CMPI_RC_ERR_FAILED,
- "[TEMP] Cannot add resources of type %" PRIu16,
- type);
+ "[TEMP] Cannot add resources of type %" PRIu16,
type);
goto out;
}
@@ -781,8 +777,7 @@ static CMPIStatus resource_mod(struct do
else {
cu_statusf(_BROKER, &s,
CMPI_RC_ERR_FAILED,
- "Cannot modify resources of type %" PRIu16,
- type);
+ "Cannot modify resources of type %" PRIu16, type);
goto out;
}