# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1206730931 25200
# Node ID 95caba1628c467332ffb129f663cef5289039744
# Parent 321e3b4320ff3c849c684f1d940f0fa917f6555c
Set status in all error cases for DestroySystem in VSMS.
Be sure to set a status message for the IM_RC_FAILED case. In the case that
connect_by_classname() fails, set rc = -1 because connect_by_classname() sets the status.
Remove domain_exists() - this has been replaced by virDomainLookupByName().
Fix typo in CU_DEBUG() statement.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 321e3b4320ff -r 95caba1628c4 src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c Wed Apr 09 10:57:05 2008 -0700
+++ b/src/Virt_VirtualSystemManagementService.c Fri Mar 28 12:02:11 2008 -0700
@@ -488,8 +488,10 @@ static CMPIStatus destroy_system(CMPIMet
conn = connect_by_classname(_BROKER,
CLASSNAME(reference),
&status);
- if (conn == NULL)
+ if (conn == NULL) {
+ rc = -1;
goto error;
+ }
if (cu_get_ref_arg(argsin, "AffectedSystem", &sys) != CMPI_RC_OK)
goto error;
@@ -498,13 +500,9 @@ static CMPIStatus destroy_system(CMPIMet
if (dom_name == NULL)
goto error;
- // Make sure system exists and destroy it.
- if (!domain_exists(conn, dom_name))
- goto error;
-
dom = virDomainLookupByName(conn, dom_name);
if (dom == NULL) {
- CU_DEBUG("No such domain `%s', dom_name");
+ CU_DEBUG("No such domain `%s'", dom_name);
rc = IM_RC_SYS_NOT_FOUND;
goto error;
}
@@ -522,6 +520,10 @@ error:
cu_statusf(_BROKER, &status,
CMPI_RC_ERR_FAILED,
"Failed to find domain");
+ else if (rc == IM_RC_FAILED)
+ cu_statusf(_BROKER, &status,
+ CMPI_RC_ERR_FAILED,
+ "Unable to retrieve domain name.");
else if (rc == IM_RC_OK)
status = (CMPIStatus){CMPI_RC_OK, NULL};
Show replies by date