[PATCH 2/3] Add a detailed message when tap device add fails

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

 



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@xxxxxxxxxx>
---
 src/qemu/qemu_conf.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 2ca3350..e92021a 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -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'"),
-- 
1.7.2

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