]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
qemu: improve error if tun device is missing
authorDoug Goldstein <cardoe@gentoo.org>
Thu, 5 Aug 2010 23:02:52 +0000 (17:02 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 5 Aug 2010 23:04:38 +0000 (17:04 -0600)
Added a more detailed error message when adding a tap devices fails and
the kernel is missing tun support.

Signed-off-by: Doug Goldstein <cardoe@gentoo.org>
src/qemu/qemu_conf.c

index 2ca33502fb12b2992e92fe58552da38cae8ec618..da1ff34d325426a89b42728762a3eeaf6a9f5039 100644 (file)
@@ -1694,6 +1694,13 @@ qemudNetworkIfaceConnect(virConnectPtr conn,
             qemuReportError(VIR_ERR_INTERNAL_ERROR,
                             _("Failed to add tap interface to bridge. "
                               "%s is not a bridge device"), brname);
+        } else if (err == ENOENT) {
+            /* When the tun drive is missing, give a better message. */
+            qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                            _("Failed to add tap interface to bridge. "
+                              "Your kernel is missing the 'tun' module or "
+                              "CONFIG_TUN, or you need to add the "
+                              "/dev/net/tun device node."));
         } else if (template_ifname) {
             virReportSystemError(err,
                                  _("Failed to add tap interface to bridge '%s'"),