[Libvirt-cim] [PATCH] Be sure libvirt error message is returned to user

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Mon Jun 1 21:02:22 UTC 2009


# HG changeset patch
# User Kaitlin Rupert <karupert at us.ibm.com>
# Date 1243890081 25200
# Node ID d1e566c62e287c8d98dad51e0b80ec7c6c850729
# Parent  ffea3e262ba257e0e3f8cfe70daac6bba5ffc118
Be sure libvirt error message is returned to user

If connect_and_create() fails because libvirt fails, we don't want to
overwrite the error message.  Instead, we should just return.

This can be tested by attempting to create a pool that will definitely fail -
something like a pool where the mountpoint doesn't exist.

Signed-off-by: Kaitlin Rupert <karupert at us.ibm.com>

diff -r ffea3e262ba2 -r d1e566c62e28 src/Virt_ResourcePoolConfigurationService.c
--- a/src/Virt_ResourcePoolConfigurationService.c	Mon Jun 01 13:25:03 2009 -0700
+++ b/src/Virt_ResourcePoolConfigurationService.c	Mon Jun 01 14:01:21 2009 -0700
@@ -455,6 +455,9 @@
         CU_DEBUG("Pool XML:\n%s", xml);
 
         inst = connect_and_create(xml, reference, full_id, pool->type, &s);
+        if (s.rc != CMPI_RC_OK)
+                goto out;
+
         if (inst == NULL) {
                 cu_statusf(_BROKER, &s,
                            CMPI_RC_ERR_FAILED,




More information about the Libvirt-cim mailing list