[Libguestfs] [PATCH nbdkit 2/2] nbd: In error messages, just display nbd_get_error()

Eric Blake eblake at redhat.com
Thu Feb 17 22:38:27 UTC 2022


On Thu, Feb 17, 2022 at 09:09:33PM +0000, Richard W.M. Jones wrote:
> The string returned by nbd_get_error() already includes the name of
> the call that failed, so we don't really need to see that information
> twice.  For example:
> 
>   #include <stdio.h>
>   #include <libnbd.h>
> 
>   main () {
>     nbd_is_read_only (nbd_create ());
>     fprintf (stderr, "%s\n", nbd_get_error ());
>     return 0;
>   }
> 
> prints:
> 
>   nbd_is_read_only: invalid state: START: the handle must be
>   negotiating, or connected with the server, or shut down: Transport
>   endpoint is not connected
> 
> which is enough information to track down an error to a particular
> line in this plugin.

ACK series.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org




More information about the Libguestfs mailing list