]> git.ipfire.org Git - thirdparty/libvirt.git/commit
macvtap: log an error if on failure to connect to netlink socket
authorLaine Stump <laine@laine.org>
Tue, 15 Mar 2011 20:22:25 +0000 (16:22 -0400)
committerLaine Stump <laine@laine.org>
Wed, 16 Mar 2011 17:46:29 +0000 (13:46 -0400)
commit12775d9491f0d98de6eb4593be4cacfaff1c4e47
treeb26ff9c5c78e13871ca7f812f1ea1efe8d462d68
parent98a4e5a301eb96b4d6c80b859e9986491e1eae06
macvtap: log an error if on failure to connect to netlink socket

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 (during a call to libnl's nl_connect()
from libvirt's nlComm(), there was no log message, leading virsh (for
example) to report "unknown error".

There were two other cases in nlComm where an error in a libnl
function might return with failure but no error reported. In all three
cases, this patch logs a message which will hopefully be more useful.

Note that more detailed information about the failure might be
available from libnl's nl_geterror() function, but it calls
strerror(), which is not threadsafe, so we can't use it.
src/util/macvtap.c