]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: more verbose error when failing to create macvtap device
authorLaine Stump <laine@laine.org>
Wed, 18 Mar 2015 18:27:05 +0000 (14:27 -0400)
committerLaine Stump <laine@laine.org>
Wed, 18 Mar 2015 18:49:29 +0000 (14:49 -0400)
Investigation of a problem with creating passthrough macvtap devices
(https://bugzilla.redhat.com/show_bug.cgi?id=1185501) has shown that
this slightly more verbose failure message is useful. In particular,
the mac address can be used to determine the domain. You could also
figure this out by looking at preceding messages in a debug log, but
this gets it in a single place.

src/util/virnetdevmacvlan.c

index 72e1f65527a1adc8a2072daf8b5a11db8ffe6ab1..ec959a91c617ca3a8eb280eb327094a7ab68ac9b 100644 (file)
@@ -107,6 +107,7 @@ virNetDevMacVLanCreate(const char *ifname,
     unsigned int recvbuflen;
     struct nl_msg *nl_msg;
     struct nlattr *linkinfo, *info_data;
+    char macstr[VIR_MAC_STRING_BUFLEN];
 
     if (virNetDevGetIndex(srcdev, &ifindex) < 0)
         return -1;
@@ -177,8 +178,9 @@ virNetDevMacVLanCreate(const char *ifname,
 
         default:
             virReportSystemError(-err->error,
-                                 _("error creating %s type of interface attach to %s"),
-                                 type, srcdev);
+                                 _("error creating %s interface %s@%s (%s)"),
+                                 type, ifname, srcdev,
+                                 virMacAddrFormat(macaddress, macstr));
             goto cleanup;
         }
         break;