# HG changeset patch
# User Jay Gagnon <grendel(a)linux.vnet.ibm.com>
# Date 1196452080 18000
# Node ID fcb3c7a237ed6640c38265ce82db0a664fb57013
# Parent 7e9965cdb91e44722c345bc497774057ff72f652
Status and debug cleanup.
After encountering various somewhat trivial but oft-occurring user output issues, I've
just lumped them all in. This is, unfortunately, somewhat at odds with brand new the
"stay on track" guideline (which I wrote), but making these all separate would
have created a lot of that "patching a patch" thing where many lines get changed
in more than one patch, which is much more obnoxious. So...
CMSetStatusWithChars -> cu_statusf conversion
Clean up formatting of cu_statusf calls
Remove trailing '.' from cu_statusf and CU_DEBUG calls.
Signed-off-by: Jay Gagnon <grendel(a)linux.vnet.ibm.com>
diff -r 7e9965cdb91e -r fcb3c7a237ed libxkutil/misc_util.c
--- a/libxkutil/misc_util.c Fri Nov 30 13:56:48 2007 -0500
+++ b/libxkutil/misc_util.c Fri Nov 30 14:48:00 2007 -0500
@@ -61,9 +61,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 7e9965cdb91e -r fcb3c7a237ed src/Virt_AllocationCapabilities.c
--- a/src/Virt_AllocationCapabilities.c Fri Nov 30 13:56:48 2007 -0500
+++ b/src/Virt_AllocationCapabilities.c Fri Nov 30 14:48:00 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 7e9965cdb91e -r fcb3c7a237ed src/Virt_ComputerSystem.c
--- a/src/Virt_ComputerSystem.c Fri Nov 30 13:56:48 2007 -0500
+++ b/src/Virt_ComputerSystem.c Fri Nov 30 14:48:00 2007 -0500
@@ -445,9 +445,9 @@ static CMPIStatus GetInstance(CMPIInstan
if (cu_get_str_path(reference, "Name", &name) != CMPI_RC_OK) {
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;
}
@@ -491,15 +491,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;
}
@@ -516,15 +516,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;
}
@@ -540,15 +540,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;
}
@@ -564,15 +564,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;
}
@@ -588,15 +588,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;
}
@@ -616,16 +616,16 @@ static CMPIStatus __state_change(const c
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;
}
@@ -668,9 +668,9 @@ static CMPIStatus state_change(CMPIMetho
}
if (cu_get_str_path(reference, "Name", &name) != CMPI_RC_OK) {
- 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 7e9965cdb91e -r fcb3c7a237ed src/Virt_Device.c
--- a/src/Virt_Device.c Fri Nov 30 13:56:48 2007 -0500
+++ b/src/Virt_Device.c Fri Nov 30 14:48:00 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);
@@ -530,9 +530,9 @@ static CMPIStatus GetInstance(CMPIInstan
if (cu_get_str_path(reference, "DeviceID", &devid) != CMPI_RC_OK)
{
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 7e9965cdb91e -r fcb3c7a237ed src/Virt_ElementCapabilities.c
--- a/src/Virt_ElementCapabilities.c Fri Nov 30 13:56:48 2007 -0500
+++ b/src/Virt_ElementCapabilities.c Fri Nov 30 14:48:00 2007 -0500
@@ -73,8 +73,9 @@ static CMPIStatus sys_to_cap(const CMPIO
}
if (!STREQ(sys_name, host_name)) {
- cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED,
- "System '%s' is not a host system.",
sys_name);
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "System '%s' is not a host system",
sys_name);
goto out;
}
@@ -100,14 +101,14 @@ static CMPIStatus cap_to_sys(const CMPIO
if (cu_get_str_path(ref, "InstanceID", &inst_id) != CMPI_RC_OK) {
cu_statusf(_BROKER, &s,
CMPI_RC_ERR_FAILED,
- "Could not get InstanceID.");
+ "Could not get InstanceID");
goto out;
}
if (!parse_fq_devid(inst_id, &host, &device)) {
cu_statusf(_BROKER, &s,
CMPI_RC_ERR_FAILED,
- "Could not get system name.");
+ "Could not get system name");
goto out;
}
@@ -139,9 +140,9 @@ static CMPIStatus cs_to_cap(const CMPIOb
const char *sys_name = NULL;
if (cu_get_str_path(ref, "Name", &sys_name) != CMPI_RC_OK) {
- CMSetStatusWithChars(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "Missing key: Name");
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Missing key: Name");
goto out;
}
@@ -167,14 +168,14 @@ static CMPIStatus cap_to_cs(const CMPIOb
if (cu_get_str_path(ref, "InstanceID", &inst_id) != CMPI_RC_OK) {
cu_statusf(_BROKER, &s,
CMPI_RC_ERR_FAILED,
- "Could not get InstanceID.");
+ "Could not get InstanceID");
goto error1;
}
if (!parse_fq_devid(inst_id, &host, &device)) {
cu_statusf(_BROKER, &s,
CMPI_RC_ERR_FAILED,
- "Could not get system name.");
+ "Could not get system name");
goto error1;
}
@@ -213,8 +214,9 @@ static CMPIStatus pool_to_alloc(const CM
CMPIStatus s = {CMPI_RC_OK};
if (cu_get_str_path(ref, "InstanceID", &inst_id) != CMPI_RC_OK) {
- 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;
}
@@ -226,8 +228,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 7e9965cdb91e -r fcb3c7a237ed src/Virt_ElementConformsToProfile.c
--- a/src/Virt_ElementConformsToProfile.c Fri Nov 30 13:56:48 2007 -0500
+++ b/src/Virt_ElementConformsToProfile.c Fri Nov 30 14:48:00 2007 -0500
@@ -62,9 +62,9 @@ static CMPIStatus elem_instances(const C
classname = get_typed_class(pfx_from_conn(conn),
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;
}
@@ -74,18 +74,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 out;
}
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 out;
}
@@ -115,9 +115,9 @@ static CMPIStatus prof_to_elem(const CMP
return s;
if (cu_get_str_path(ref, "InstanceID", &id) != CMPI_RC_OK) {
- CMSetStatusWithChars(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "No InstanceID specified");
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "No InstanceID specified");
goto out;
}
@@ -157,8 +157,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;
}
@@ -173,9 +174,9 @@ static CMPIStatus elem_to_prof(const CMP
conn,
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 out;
}
diff -r 7e9965cdb91e -r fcb3c7a237ed src/Virt_EnabledLogicalElementCapabilities.c
--- a/src/Virt_EnabledLogicalElementCapabilities.c Fri Nov 30 13:56:48 2007 -0500
+++ b/src/Virt_EnabledLogicalElementCapabilities.c Fri Nov 30 14:48:00 2007 -0500
@@ -65,8 +65,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;
}
@@ -114,25 +115,25 @@ CMPIStatus get_ele_cap(const CMPIBroker
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 7e9965cdb91e -r fcb3c7a237ed src/Virt_HostSystem.c
--- a/src/Virt_HostSystem.c Fri Nov 30 13:56:48 2007 -0500
+++ b/src/Virt_HostSystem.c Fri Nov 30 14:48:00 2007 -0500
@@ -76,9 +76,9 @@ CMPIStatus get_host_cs(const CMPIBroker
NAMESPACE(reference));
if (inst == NULL) {
- CMSetStatusWithChars(broker, &s,
- CMPI_RC_ERR_FAILED,
- "Can't create HostSystem instance.");
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "Can't create HostSystem instance");
goto out;
}
diff -r 7e9965cdb91e -r fcb3c7a237ed src/Virt_HostedDependency.c
--- a/src/Virt_HostedDependency.c Fri Nov 30 13:56:48 2007 -0500
+++ b/src/Virt_HostedDependency.c Fri Nov 30 14:48:00 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 7e9965cdb91e -r fcb3c7a237ed src/Virt_HostedResourcePool.c
--- a/src/Virt_HostedResourcePool.c Fri Nov 30 13:56:48 2007 -0500
+++ b/src/Virt_HostedResourcePool.c Fri Nov 30 14:48:00 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 7e9965cdb91e -r fcb3c7a237ed src/Virt_RegisteredProfile.c
--- a/src/Virt_RegisteredProfile.c Fri Nov 30 13:56:48 2007 -0500
+++ b/src/Virt_RegisteredProfile.c Fri Nov 30 14:48:00 2007 -0500
@@ -55,9 +55,9 @@ CMPIInstance *reg_prof_instance(const CM
namespace);
if (instance == NULL) {
- CMSetStatusWithChars(broker, &s,
- CMPI_RC_ERR_FAILED,
- "Can't create RegisteredProfile
instance.");
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "Can't create RegisteredProfile instance");
goto out;
}
@@ -105,8 +105,9 @@ static CMPIStatus enum_profs(const CMPIO
conn,
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;
}
@@ -137,9 +138,9 @@ static CMPIStatus get_prof(const CMPIObj
return s;
if (cu_get_str_path(ref, "InstanceID", &id) != CMPI_RC_OK) {
- CMSetStatusWithChars(_BROKER, &s,
- CMPI_RC_ERR_FAILED,
- "No InstanceID specified");
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "No InstanceID specified");
goto out;
}
diff -r 7e9965cdb91e -r fcb3c7a237ed src/Virt_SettingsDefineCapabilities.c
--- a/src/Virt_SettingsDefineCapabilities.c Fri Nov 30 13:56:48 2007 -0500
+++ b/src/Virt_SettingsDefineCapabilities.c Fri Nov 30 14:48:00 2007 -0500
@@ -55,7 +55,7 @@ static bool rasd_prop_copy_value(struct
{
bool rc = true;
- CU_DEBUG("Copying '%s'.", src.field);
+ CU_DEBUG("Copying '%s'", src.field);
if (src.type & CMPI_string) {
dest->value = (CMPIValue *)strdup((char *)src.value);
} else if (src.type & CMPI_INTEGER) {
@@ -120,7 +120,7 @@ static struct sdc_rasd_prop *mem_max(con
if (!ret) {
cu_statusf(_BROKER, s,
CMPI_RC_ERR_FAILED,
- "Could not copy RASD.");
+ "Could not copy RASD");
}
return rasd;
@@ -144,7 +144,7 @@ static struct sdc_rasd_prop *mem_min(con
if (!ret) {
cu_statusf(_BROKER, s,
CMPI_RC_ERR_FAILED,
- "Could not copy RASD.");
+ "Could not copy RASD");
}
return rasd;
@@ -168,7 +168,7 @@ static struct sdc_rasd_prop *mem_def(con
if (!ret) {
cu_statusf(_BROKER, s,
CMPI_RC_ERR_FAILED,
- "Could not copy RASD.");
+ "Could not copy RASD");
}
return rasd;
@@ -192,7 +192,7 @@ static struct sdc_rasd_prop *mem_inc(con
if (!ret) {
cu_statusf(_BROKER, s,
CMPI_RC_ERR_FAILED,
- "Could not copy RASD.");
+ "Could not copy RASD");
}
return rasd;
@@ -216,7 +216,7 @@ static struct sdc_rasd_prop *proc_min(co
if (!ret) {
cu_statusf(_BROKER, s,
CMPI_RC_ERR_FAILED,
- "Could not copy RASD.");
+ "Could not copy RASD");
}
return rasd;
@@ -236,7 +236,7 @@ static struct sdc_rasd_prop *proc_max(co
if (conn == NULL) {
cu_statusf(_BROKER, s,
CMPI_RC_ERR_FAILED,
- "Could not connect to hypervisor.");
+ "Could not connect to hypervisor");
goto out;
}
@@ -254,7 +254,7 @@ static struct sdc_rasd_prop *proc_max(co
if (!ret) {
cu_statusf(_BROKER, s,
CMPI_RC_ERR_FAILED,
- "Could not copy RASD.");
+ "Could not copy RASD");
}
out:
@@ -279,7 +279,7 @@ static struct sdc_rasd_prop *proc_def(co
if (!ret) {
cu_statusf(_BROKER, s,
CMPI_RC_ERR_FAILED,
- "Could not copy RASD.");
+ "Could not copy RASD");
}
return rasd;
@@ -303,7 +303,7 @@ static struct sdc_rasd_prop *proc_inc(co
if (!ret) {
cu_statusf(_BROKER, s,
CMPI_RC_ERR_FAILED,
- "Could not copy RASD.");
+ "Could not copy RASD");
}
return rasd;
@@ -326,7 +326,7 @@ static struct sdc_rasd_prop *net_min(con
if (!ret) {
cu_statusf(_BROKER, s,
CMPI_RC_ERR_FAILED,
- "Could not copy RASD.");
+ "Could not copy RASD");
}
return rasd;
@@ -350,7 +350,7 @@ static uint16_t net_max_xen(const CMPIOb
if (s->rc != CMPI_RC_OK) {
cu_statusf(_BROKER, s,
CMPI_RC_ERR_FAILED,
- "Could not get connection.");
+ "Could not get connection");
goto out;
}
@@ -359,7 +359,7 @@ static uint16_t net_max_xen(const CMPIOb
if (rc != 0) {
cu_statusf(_BROKER, s,
CMPI_RC_ERR_FAILED,
- "Could not get xen version.");
+ "Could not get xen version");
goto out;
}
@@ -385,7 +385,7 @@ static struct sdc_rasd_prop *net_max(con
if (prefix == NULL) {
cu_statusf(_BROKER, s,
CMPI_RC_ERR_FAILED,
- "Could not get prefix from reference.");
+ "Could not get prefix from reference");
goto out;
}
@@ -418,7 +418,7 @@ static struct sdc_rasd_prop *net_max(con
if (!ret) {
cu_statusf(_BROKER, s,
CMPI_RC_ERR_FAILED,
- "Could not copy RASD.");
+ "Could not copy RASD");
}
out:
free(prefix);
@@ -442,7 +442,7 @@ static struct sdc_rasd_prop *net_def(con
if (!ret) {
cu_statusf(_BROKER, s,
CMPI_RC_ERR_FAILED,
- "Could not copy RASD.");
+ "Could not copy RASD");
}
return rasd;
@@ -465,7 +465,7 @@ static struct sdc_rasd_prop *net_inc(con
if (!ret) {
cu_statusf(_BROKER, s,
CMPI_RC_ERR_FAILED,
- "Could not copy RASD.");
+ "Could not copy RASD");
}
return rasd;
@@ -489,7 +489,7 @@ static struct sdc_rasd_prop *disk_min(co
if (!ret) {
cu_statusf(_BROKER, s,
CMPI_RC_ERR_FAILED,
- "Could not copy RASD.");
+ "Could not copy RASD");
}
return rasd;
@@ -510,7 +510,7 @@ static struct sdc_rasd_prop *disk_max(co
if (cu_get_str_path(ref, "InstanceID", &inst_id) != CMPI_RC_OK) {
cu_statusf(_BROKER, s,
CMPI_RC_ERR_FAILED,
- "Could not get InstanceID.");
+ "Could not get InstanceID");
goto out;
}
@@ -518,7 +518,7 @@ static struct sdc_rasd_prop *disk_max(co
if (s->rc != CMPI_RC_OK) {
cu_statusf(_BROKER, s,
CMPI_RC_ERR_FAILED,
- "Could not get connection.");
+ "Could not get connection");
goto out;
}
@@ -528,7 +528,7 @@ static struct sdc_rasd_prop *disk_max(co
if (pool_inst == NULL) {
cu_statusf(_BROKER, s,
CMPI_RC_ERR_FAILED,
- "Could not get pool instance.");
+ "Could not get pool instance");
goto out;
}
@@ -536,7 +536,7 @@ static struct sdc_rasd_prop *disk_max(co
if (prop_ret != CMPI_RC_OK) {
cu_statusf(_BROKER, s,
CMPI_RC_ERR_FAILED,
- "Could not get capacity from instance.");
+ "Could not get capacity from instance");
goto out;
}
CU_DEBUG("Got capacity from pool_inst: %lld", free_64);
@@ -553,7 +553,7 @@ static struct sdc_rasd_prop *disk_max(co
if (!ret) {
cu_statusf(_BROKER, s,
CMPI_RC_ERR_FAILED,
- "Could not copy RASD.");
+ "Could not copy RASD");
}
out:
@@ -578,7 +578,7 @@ static struct sdc_rasd_prop *disk_def(co
if (!ret) {
cu_statusf(_BROKER, s,
CMPI_RC_ERR_FAILED,
- "Could not copy RASD.");
+ "Could not copy RASD");
}
return rasd;
@@ -602,7 +602,7 @@ static struct sdc_rasd_prop *disk_inc(co
if (!ret) {
cu_statusf(_BROKER, s,
CMPI_RC_ERR_FAILED,
- "Could not copy RASD.");
+ "Could not copy RASD");
}
return rasd;
@@ -695,8 +695,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;
}
@@ -717,15 +718,15 @@ static CMPIInstance *sdc_rasd_inst(const
CMSetProperty(inst, "ResourceType", &resource_type, CMPI_uint16);
for (i = 0; prop_list[i].field != NULL; i++) {
- CU_DEBUG("Setting property '%s'.",
prop_list[i].field);
+ CU_DEBUG("Setting property '%s'", prop_list[i].field);
CMSetProperty(inst, prop_list[i].field,
prop_list[i].value, prop_list[i].type);
}
- CU_DEBUG("freeing prop_list.");
+ CU_DEBUG("freeing prop_list");
free_rasd_prop_list(prop_list);
out:
- CU_DEBUG("Returning inst.");
+ CU_DEBUG("Returning inst");
return inst;
}
@@ -749,22 +750,23 @@ static CMPIStatus sdc_rasds_for_type(con
for (i = SDC_RASD_MIN; i <= SDC_RASD_INC; i++) {
inst = sdc_rasd_inst(_BROKER, &s, ref, rasd, i);
if (s.rc != CMPI_RC_OK) {
- CU_DEBUG("Problem getting inst.");
+ CU_DEBUG("Problem getting inst");
goto out;
}
- CU_DEBUG("Got inst.");
+ CU_DEBUG("Got inst");
if (inst != NULL) {
inst_list_add(list, inst);
- CU_DEBUG("Added inst.");
+ CU_DEBUG("Added inst");
} else {
- CU_DEBUG("Inst is null, not added.");
+ CU_DEBUG("Inst is null, not added");
}
}
} else {
- CU_DEBUG("Unsupported type.");
- CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED,
- "Unsupported device type.");
+ CU_DEBUG("Unsupported type");
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Unsupported device type");
}
out:
@@ -779,16 +781,17 @@ static CMPIStatus alloc_cap_to_rasd(cons
int ret;
uint16_t type;
- CU_DEBUG("Getting ResourceType.");
+ CU_DEBUG("Getting ResourceType");
ret = cu_get_u16_path(ref, "ResourceType", &type);
if (ret != CMPI_RC_OK) {
- CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED,
- "Could not get ResourceType.");
- goto out;
- }
-
- CU_DEBUG("ResourceType: %hi.", type);
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Could not get ResourceType");
+ goto out;
+ }
+
+ CU_DEBUG("ResourceType: %hi", type);
s = sdc_rasds_for_type(ref, list, type);
diff -r 7e9965cdb91e -r fcb3c7a237ed src/Virt_VSSD.c
--- a/src/Virt_VSSD.c Fri Nov 30 13:56:48 2007 -0500
+++ b/src/Virt_VSSD.c Fri Nov 30 14:48:00 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 7e9965cdb91e -r fcb3c7a237ed src/Virt_VirtualSystemManagementCapabilities.c
--- a/src/Virt_VirtualSystemManagementCapabilities.c Fri Nov 30 13:56:48 2007 -0500
+++ b/src/Virt_VirtualSystemManagementCapabilities.c Fri Nov 30 14:48:00 2007 -0500
@@ -61,8 +61,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);
@@ -101,25 +102,25 @@ CMPIStatus get_vsm_cap(const CMPIBroker
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 7e9965cdb91e -r fcb3c7a237ed src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c Fri Nov 30 13:56:48 2007 -0500
+++ b/src/Virt_VirtualSystemManagementService.c Fri Nov 30 14:48:00 2007 -0500
@@ -107,9 +107,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;
}
@@ -294,9 +294,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;
}
@@ -304,9 +304,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);
@@ -639,8 +639,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);
}
@@ -673,8 +672,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;
}
@@ -719,8 +717,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;
}
@@ -730,8 +727,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;
}
@@ -784,8 +780,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;
}