From c3302ceb1df0fe3a8792c55122c73098ffee2726 Mon Sep 17 00:00:00 2001 From: Adam Julis Date: Mon, 1 Jul 2024 13:17:22 +0200 Subject: [PATCH] qemuDomainChangeNet: forbid changing portgroup 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 Signed-off-by: Michal Privoznik Reviewed-by: Michal Privoznik --- src/qemu/qemu_hotplug.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 4a3f4f657e..2756d2aebd 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -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;