]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: use actual/effective vlan when updating OVS-based interface vlan tag
authorLaine Stump <laine@redhat.com>
Wed, 14 Jan 2026 02:00:39 +0000 (21:00 -0500)
committerLaine Stump <laine@redhat.com>
Fri, 16 Jan 2026 17:32:36 +0000 (12:32 -0500)
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 <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_hotplug.c

index 78d9d18218ff4c9e2be38d39ccfdf8891ad9313c..f786248e70d077437bdab0e98893e2f4203d7d44 100644 (file)
@@ -4272,7 +4272,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) {