[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

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



2010/4/5 Eric Blake <eblake redhat com>:
> 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.
>

Thanks, pushed.

Matthias


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]