[libvirt] [PATCH 28/30] remote: Replace some virRaiseError with remoteError

Eric Blake eblake at redhat.com
Mon Apr 5 17:43:46 UTC 2010


On 04/04/2010 11:36 AM, Matthias Bolte wrote:
> ---
>  src/remote/remote_driver.c |   29 ++++++++++++-----------------
>  1 files changed, 12 insertions(+), 17 deletions(-)
> 
> diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
> index 19a4c03..16ffe21 100644
> --- a/src/remote/remote_driver.c
> +++ b/src/remote/remote_driver.c
> @@ -6583,11 +6583,9 @@ static char *addrToString(struct sockaddr_storage *sa, socklen_t salen)
>                             host, sizeof(host),
>                             port, sizeof(port),
>                             NI_NUMERICHOST | NI_NUMERICSERV)) != 0) {
> -        virRaiseError (VIR_FROM_REMOTE,
> -                       VIR_ERR_UNKNOWN_HOST, VIR_ERR_ERROR,
> -                       NULL, NULL, NULL, 0, 0,
> -                       _("Cannot resolve address %d: %s"),
> -                       err, gai_strerror(err));
> +        remoteError(VIR_ERR_UNKNOWN_HOST,
> +                    _("Cannot resolve address %d: %s"),
> +                    err, gai_strerror(err));

Unrelated to your patch, but it seems like %d err is less than helpful
here, particularly given that we immediately translate it into a string
with gai_strerror(err).  More useful would be "Cannot resolve address
%s: %s", some_conversion_to_string(host, port), to let the user know
what address could not be translated.

At any rate, ACK to this patch.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 323 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20100405/309fe001/attachment-0001.sig>


More information about the libvir-list mailing list