Re: [libvirt] [PATCH v2] Improve error reporting for virConnectGetHostname calls

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

 



On Mon, Nov 02, 2009 at 02:44:12PM -0500, Cole Robinson wrote:
> All drivers have copy + pasted inadequate error reporting which wraps
> util.c:virGetHostname. Move all error reporting to this function, and improve
> what we report.
> 
> Changes from v1:
>   Drop the driver wrappers around virGetHostname. This means we still need
>   to keep the new conn argument to virGetHostname, but I think it's worth
>   it.
> 
> Signed-off-by: Cole Robinson <crobinso@xxxxxxxxxx>
[...]
>      r = getaddrinfo(hostname, NULL, &hints, &info);
> -    if (r != 0)
> +    if (r != 0) {
> +        ReportError(conn, VIR_ERR_INTERNAL_ERROR,
> +                    _("getaddrinfo failed for '%s': %s"),
> +                    hostname, gai_strerror(r));
>          return NULL;

  ACK, looks a good cleanup, I just hope gai_strerror() won't be a
portability problem !

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel@xxxxxxxxxxxx  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]