From: Doug Goldstein Date: Thu, 5 Aug 2010 23:02:52 +0000 (-0600) Subject: qemu: improve error if tun device is missing X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=bcc8b58be30ea66ffb9ffaee46cff29ade406897;p=people%2Fliuw%2Flibxenctrl-split%2Flibvirt.git qemu: improve error if tun device is missing Added a more detailed error message when adding a tap devices fails and the kernel is missing tun support. Signed-off-by: Doug Goldstein --- diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 2ca33502f..da1ff34d3 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'"),