[PATCH] qemuDomainChangeNet: forbid changing portgroup

Adam Julis posted 1 patch 3 months, 2 weeks ago
Failed in applying to current master (apply log)
src/qemu/qemu_hotplug.c | 7 +++++++
1 file changed, 7 insertions(+)
[PATCH] qemuDomainChangeNet: forbid changing portgroup
Posted by Adam Julis 3 months, 2 weeks ago
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>
---
 src/qemu/qemu_hotplug.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 4a3f4f657e..08ca7ab973 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -3937,6 +3937,13 @@ 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;
 
-- 
2.45.2
Re: [PATCH] qemuDomainChangeNet: forbid changing portgroup
Posted by Michal Prívozník 3 months, 2 weeks ago
On 7/1/24 13:17, Adam Julis wrote:
> 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>
> ---
>  src/qemu/qemu_hotplug.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
> index 4a3f4f657e..08ca7ab973 100644
> --- a/src/qemu/qemu_hotplug.c
> +++ b/src/qemu/qemu_hotplug.c
> @@ -3937,6 +3937,13 @@ qemuDomainChangeNet(virQEMUDriver *driver,
>                  else
>                      needBridgeChange = true;
>              }
> +
> +            if (STRNEQ_NULLABLE(olddev->data.network.portgroup, newdev->data.network.portgroup)) {

Nitpick, this long line can be broken into two, short ones.

> +                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;
>  

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>

Michal