[Libvirt-cim] [PATCH 1 of 3] This patch exposes error messages from libvirt calls in VirtualSystemManagementService

Richard Maciel rmaciel at linux.vnet.ibm.com
Wed Feb 18 18:28:29 UTC 2009


# HG changeset patch
# User Richard Maciel <rmaciel at linux.vnet.ibm.com>
# Date 1234981382 10800
# Node ID 9aeb111b89fb3b1428f8b21af5368a6b5c57f948
# Parent  72dc446be12ca8ae1dc60a1aad97ff72eecd7b66
This patch exposes error messages from libvirt calls in VirtualSystemManagementService

Signed-off-by: Richard Maciel <rmaciel at linux.vnet.ibm.com>

diff -r 72dc446be12c -r 9aeb111b89fb src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c	Wed Feb 04 08:35:04 2009 -0800
+++ b/src/Virt_VirtualSystemManagementService.c	Wed Feb 18 15:23:02 2009 -0300
@@ -963,9 +963,10 @@
 
         dom = virDomainLookupByName(conn, dominfo->name);
         if (dom == NULL) {
-                cu_statusf(_BROKER, &s,
-                           CMPI_RC_ERR_NOT_FOUND,
-                           "Unable to lookup domain `%s'", dominfo->name);
+                virt_set_status(_BROKER, &s,
+                                CMPI_RC_ERR_NOT_FOUND,
+                                conn,
+                                "Unable to lookup domain `%s'", dominfo->name);
                 goto out;
         }
 
@@ -1068,6 +1069,10 @@
                 cu_statusf(_BROKER, &s,
                            CMPI_RC_ERR_NOT_FOUND,
                            "Referenced domain `%s' does not exist", name);
+                virt_set_status(_BROKER, &s,
+                                CMPI_RC_ERR_NOT_FOUND,
+                                conn,
+                                "Referenced domain `%s' does not exist", name);
                 goto out;
         }
 
@@ -1252,6 +1257,10 @@
         dom = virDomainLookupByName(conn, dom_name);
         if (dom == NULL) {
                 CU_DEBUG("No such domain `%s'", dom_name);
+                virt_set_status(_BROKER, &status,
+                                CMPI_RC_ERR_NOT_FOUND,
+                                conn,
+                                "Referenced domain `%s' does not exist", dom_name);
                 rc = IM_RC_SYS_NOT_FOUND;
                 goto error;
         }
@@ -1320,8 +1329,13 @@
                 goto out;
 
         dom = virDomainLookupByName(conn, name);
-        if (dom == NULL)
+        if (dom == NULL) {
+                virt_set_status(_BROKER, &s,
+                                CMPI_RC_ERR_NOT_FOUND,
+                                conn,
+                                "Referenced domain `%s' does not exist", name);
                 goto out;
+        }
 
         if (!get_dominfo(dom, &dominfo)) {
                 cu_statusf(_BROKER, &s,
@@ -1825,9 +1839,11 @@
 
                 dom = virDomainLookupByName(conn, name);
                 if (dom == NULL) {
-                        cu_statusf(_BROKER, &s,
-                                   CMPI_RC_ERR_FAILED,
-                                   "Unknown system `%s'", name);
+                        virt_set_status(_BROKER, &s,
+                                        CMPI_RC_ERR_NOT_FOUND,
+                                        conn,
+                                        "Referenced domain `%s' \
+                                        does not exist", name);
                         goto end;
                 }
 




More information about the Libvirt-cim mailing list