[Libvirt-cim] [PATCH] Improve error messages for resource manipulation and migration

Jim Fehlig jfehlig at novell.com
Wed Jan 14 19:44:00 UTC 2009


# HG changeset patch
# User Jim Fehlig <jfehlig at novell.com>
# Date 1231965788 25200
# Node ID 611757263eddd2bb97383d250ee636300a91a9e6
# Parent  b4f1d84b87c20350fdfe0651a684a24b7e03ba28
Improve error messages for resource manipulation and migration

This patch extends on c/s 768, adding use of virt_set_status() in
resource manipulation extrinsics in Virt_VirtualSystemManagementService
and migration extrinsic in Virt_VSMigrationService.

     Signed-off-by: Jim Fehlig <jfehlig at novell.com>

diff -r b4f1d84b87c2 -r 611757263edd src/Virt_VSMigrationService.c
--- a/src/Virt_VSMigrationService.c	Wed Jan 14 13:33:20 2009 -0700
+++ b/src/Virt_VSMigrationService.c	Wed Jan 14 13:43:08 2009 -0700
@@ -939,9 +939,10 @@ static CMPIStatus handle_migrate(virConn
         ddom = virDomainMigrate(dom, dconn, type, NULL, NULL, 0);
         if (ddom == NULL) {
                 CU_DEBUG("Migration failed");
-                cu_statusf(_BROKER, &s,
-                           CMPI_RC_ERR_FAILED,
-                           "Migration Failed");
+                virt_set_status(_BROKER, &s,
+                                CMPI_RC_ERR_FAILED,
+                                virDomainGetConnect(dom),
+                                "Migration Failed");
         }
  out:
         virDomainFree(ddom);
diff -r b4f1d84b87c2 -r 611757263edd src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c	Wed Jan 14 13:33:20 2009 -0700
+++ b/src/Virt_VirtualSystemManagementService.c	Wed Jan 14 13:43:08 2009 -0700
@@ -1479,9 +1479,10 @@ static CMPIStatus _resource_dynamic(stru
         CU_DEBUG("Doing dynamic device update for `%s'", dominfo->name);
 
         if (func(dom, dev) == 0) {
-                cu_statusf(_BROKER, &s,
-                           CMPI_RC_ERR_FAILED,
-                           "Unable to change (%i) device", action);
+                virt_set_status(_BROKER, &s,
+                                CMPI_RC_ERR_FAILED,
+                                conn,
+                                "Unable to change (%i) device", action);
         } else {
                 cu_statusf(_BROKER, &s,
                            CMPI_RC_OK,




More information about the Libvirt-cim mailing list