[Libvirt-cim] [PATCH] Be sure libvirt error message is returned to user
Richard Maciel
rmaciel at linux.vnet.ibm.com
Wed Jun 3 18:28:34 UTC 2009
+1
Kaitlin Rupert wrote:
> # 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,
>
> _______________________________________________
> Libvirt-cim mailing list
> Libvirt-cim at redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-cim
--
Richard Maciel, MSc
IBM Linux Technology Center
rmaciel at linux.vnet.ibm.com
More information about the Libvirt-cim
mailing list