]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: log error on attempts to modify ACPI index of active device
authorLaine Stump <laine@redhat.com>
Thu, 9 Sep 2021 17:02:56 +0000 (13:02 -0400)
committerLaine Stump <laine@redhat.com>
Thu, 16 Sep 2021 13:29:24 +0000 (09:29 -0400)
The ACPI index of a device in a running guest can't be modified, and
libvirt doesn't actually attempt to modify it, but it was possible for
a user to request such a modification, and libvirt wouldn't complain,
thus misleading the user into thinking that it had actually been changed.

Resolves: https://bugzilla.redhat.com/1998920

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/conf/domain_conf.c

index 73f8aade966cf3ca0e9be6d0e69d48e3eb239772..6c32609431b55b332f6340c6a639cedf7370157c 100644 (file)
@@ -28485,6 +28485,12 @@ virDomainDefCompatibleDevice(virDomainDef *def,
                            _("changing device alias is not allowed"));
             return -1;
         }
+
+        if (data.newInfo->acpiIndex != data.oldInfo->acpiIndex) {
+            virReportError(VIR_ERR_OPERATION_DENIED, "%s",
+                           _("changing device 'acpi index' is not allowed"));
+            return -1;
+        }
     }
 
     if (!virDomainDefHasUSB(def) &&