]> xenbits.xensource.com Git - libvirt.git/commitdiff
give a more useful diagnostic for tap-add failure w/ENOTSUP
authorJim Meyering <meyering@redhat.com>
Wed, 9 Jul 2008 05:24:08 +0000 (05:24 +0000)
committerJim Meyering <meyering@redhat.com>
Wed, 9 Jul 2008 05:24:08 +0000 (05:24 +0000)
* src/qemu_conf.c (qemudNetworkIfaceConnect):
Suggestion from Daniel P. Berrange.

ChangeLog
src/qemu_conf.c

index 1d44d79258102dd02c27d5ea0caacf6c028fda71..8b76e7693a5740dbf34002f43ed962576e5ebc94 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Wed Jul  9 07:23:31 CEST 2008 Jim Meyering <meyering@redhat.com>
+
+       give a more useful diagnostic for tap-add failure w/ENOTSUP
+       * src/qemu_conf.c (qemudNetworkIfaceConnect):
+       Suggestion from Daniel P. Berrange.
+
 Tue Jul  8 18:47:56 BST 2008 Daniel P. Berrange <berrange@redhat.com>
 
        * src/xs_internal.c: Fix typo in domain state constant (Toth
@@ -49,7 +55,7 @@ Fri Jun 27 15:05:31 PDT 2008 Dan Smith <danms@us.ibm.com>
        Fix compiler warnings in LXC
        * src/veth.c: remove unused and fix uninitialized variable
 
-Thu Jun 26 19:51:19 JST 2008 Atsushi SAKAI <sakaia@jp.fujitsu.com> 
+Thu Jun 26 19:51:19 JST 2008 Atsushi SAKAI <sakaia@jp.fujitsu.com>
 
        fix make syntax-check
        * src/xm_internal.c: replace tabs to spaces
index 17f0162cd9efb7706c5e3e10ad1d4896267e0896..4b8c01ecaefad3328a9fd65beebf7350e8909618 100644 (file)
@@ -2304,9 +2304,17 @@ qemudNetworkIfaceConnect(virConnectPtr conn,
 
     if ((err = brAddTap(driver->brctl, brname,
                         ifname, BR_IFNAME_MAXLEN, &tapfd))) {
-        qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
-                     _("Failed to add tap interface '%s' to bridge '%s' : %s"),
-                         ifname, brname, strerror(err));
+        if (errno == ENOTSUP) {
+            /* In this particular case, give a better diagnostic. */
+            qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+                             _("Failed to add tap interface to bridge. "
+                               "%s is not a bridge device"), brname);
+        } else {
+            qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+                             _("Failed to add tap interface '%s' "
+                               "to bridge '%s' : %s"),
+                             ifname, brname, strerror(err));
+        }
         goto error;
     }