]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemuDomainChangeNet: forbid changing portgroup
authorAdam Julis <ajulis@redhat.com>
Mon, 1 Jul 2024 11:17:22 +0000 (13:17 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 3 Jul 2024 07:59:10 +0000 (09:59 +0200)
Changing the postgroup attribute caused unexpected behavior.
Although it can be implemented, it has a non-trivial solution.
No requirement or use has yet been found for implementing this
feature, so it has been disabled for hot-plug.

Resolves: https://issues.redhat.com/browse/RHEL-7299
Signed-off-by: Adam Julis <ajulis@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_hotplug.c

index 4a3f4f657e2db96d5bb526651b16c28de57e3f7c..2756d2aebdda8bee21f667fcc05118c4cc5e4ac3 100644 (file)
@@ -3937,6 +3937,14 @@ qemuDomainChangeNet(virQEMUDriver *driver,
                 else
                     needBridgeChange = true;
             }
+
+            if (STRNEQ_NULLABLE(olddev->data.network.portgroup,
+                                newdev->data.network.portgroup)) {
+                virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
+                               _("cannot modify network device portgroup attribute"));
+                goto cleanup;
+            }
+
             /* other things handled in common code directly below this switch */
             break;