From: Laine Stump Date: Thu, 25 Aug 2016 05:18:25 +0000 (-0400) Subject: qemu: remove unnecessary setting of tap device online state X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=dbb790393293b9cb9597d5e230ea595088a26126;p=libvirt.git qemu: remove unnecessary setting of tap device online state The linkstate setting of an is only meant to change the online status reported to the guest system by the emulated network device driver in qemu, but when support for auto-creating tap devices for was added in commit 9717d6, a chunk of code was also added to qemuDomainChangeNetLinkState() that sets the online status of the tap device (i.e. the *host* side of the interface) for type='ethernet'. This was never done for tap devices used in type='bridge' or type='network' interfaces, nor was it done in the past for tap devices created by external scripts for type='ethernet', so we shouldn't be doing it now. This patch removes the bit of code in qemuDomainChangeNetLinkState() that modifies online status of the tap device. --- diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 1bdde5bed6..d13474afcb 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -2324,21 +2324,6 @@ int qemuDomainChangeNetLinkState(virQEMUDriverPtr driver, if (ret < 0) goto cleanup; - if (virDomainNetGetActualType(dev) == VIR_DOMAIN_NET_TYPE_ETHERNET) { - switch (linkstate) { - case VIR_DOMAIN_NET_INTERFACE_LINK_STATE_UP: - case VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DEFAULT: - if ((ret = virNetDevSetOnline(dev->ifname, true)) < 0) - goto cleanup; - break; - - case VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DOWN: - if ((ret = virNetDevSetOnline(dev->ifname, false)) < 0) - goto cleanup; - break; - } - } - /* modify the device configuration */ dev->linkstate = linkstate;