From: Laine Stump Date: Thu, 25 Aug 2016 05:46:37 +0000 (-0400) Subject: qemu: set tap device online for type='ethernet' X-Git-Tag: v2.2.0-rc1~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=07262221234af0902cc649c1c991e8f11fa350d9;p=thirdparty%2Flibvirt.git qemu: set tap device online for type='ethernet' When support for auto-creating tap devices was added to in commit 9c17d6, the code assumed that virNetDevTapCreate() would honor the VIR_NETDEV_TAP__CREATE_IFUP flag that is supported by virNetDevTapCreateInBridgePort(). That isn't the case - the latter function performs several operations, and one of them is setting the tap device online. But virNetDevTapCreate() *only* creates the tap device, and relies on the caller to do everything else, so qemuInterfaceEthernetConnect() needs to call virNetDevSetOnline() after the device is successfully created. --- diff --git a/src/qemu/qemu_interface.c b/src/qemu/qemu_interface.c index e327133308..455c2d0532 100644 --- a/src/qemu/qemu_interface.c +++ b/src/qemu/qemu_interface.c @@ -453,6 +453,9 @@ qemuInterfaceEthernetConnect(virDomainDefPtr def, if (virNetDevSetMAC(net->ifname, &tapmac) < 0) goto cleanup; + if (virNetDevSetOnline(net->ifname, true) < 0) + goto cleanup; + if (net->script && virNetDevRunEthernetScript(net->ifname, net->script) < 0) goto cleanup;