From: Laine Stump <[email protected]>

Using &newdev->vlan when updating the vlan tag causes problems if the
interface is using a libvirt virtual network to get its vlan tag
info - in this case the info won't be properly pulled from the virtual network
config, but instead it will just use the (empty)
vlan object from the netdef.

The proper thing to do is to use virDomainNetGetActualVlan(), which
will pull the vlan tag from the network definition, if applicable.

Signed-off-by: Laine Stunp <[email protected]>
Signed-off-by: Laine Stump <[email protected]>
---
 src/qemu/qemu_hotplug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 6d20e3a850..c5905dba23 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -4263,7 +4263,7 @@ qemuDomainChangeNet(virQEMUDriver *driver,
              * will redo vlan setup without needing to re-attach the
              * tap device to the bridge
              */
-            if (virNetDevOpenvswitchUpdateVlan(newdev->ifname, &newdev->vlan) 
< 0)
+            if (virNetDevOpenvswitchUpdateVlan(newdev->ifname, 
virDomainNetGetActualVlan(newdev)) < 0)
                 goto cleanup;
         } else if (newType == VIR_DOMAIN_NET_TYPE_DIRECT &&
                    virDomainNetGetActualDirectMode(newdev) == 
VIR_NETDEV_MACVLAN_MODE_PASSTHRU) {
-- 
2.52.0

Reply via email to