Re: [PATCH] macvtap: log an error if on failure to connect to netlink socket

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

 



On 03/15/2011 02:32 PM, Laine Stump wrote:

In the subject, s/if //

> A bug in libnl (see https://bugzilla.redhat.com/show_bug.cgi?id=677724
> and https://bugzilla.redhat.com/show_bug.cgi?id=677725) makes it very
> easy to create a failure to connect to the netlink socket when trying
> to open a macvtap network device ("type='direct'" in domain interface
> XML). When that error occurred, there was no log message, leading
> virsh (for example) to report "unknown error".
> 
> This patch logs a message which will hopefully be more useful. (All
> other error exits from the same function were already logging a
> message).

Well, not all of them - nl_handle_alloc failure was silent instead of
calling virReportOOMError before returning -1.  Likewise for the final
nl_recv not calling virReportSystemError.

> ---
>  src/util/macvtap.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/src/util/macvtap.c b/src/util/macvtap.c
> index a71db86..66bdc73 100644
> --- a/src/util/macvtap.c
> +++ b/src/util/macvtap.c
> @@ -127,6 +127,8 @@ int nlComm(struct nl_msg *nl_msg,
>          return -1;
>  
>      if (nl_connect(nlhandle, NETLINK_ROUTE) < 0) {
> +        virReportSystemError(errno,
> +                             "%s", _("cannot connect to netlink socket"));
>          rc = -1;
>          goto err_exit;

What you have is good, but you may want to also scrub those two other
failure paths to issue an error and post a v2.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
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]