]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: validate: Fix check for unsupported FS-device bootindex use on un-assigned...
authorPeter Krempa <pkrempa@redhat.com>
Thu, 30 May 2024 14:30:47 +0000 (16:30 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 31 May 2024 10:54:32 +0000 (12:54 +0200)
When hot-plugging a FS device with un-assigned address with a bootindex
the recently-added validation check would fail as validation on hotplug
is done prior to address assignment.

To fix this problem we can simply relax the check to also pass on _NONE
addresses. Unsupported configurations will still be caught as previous
commit re-checks the definition after address assignment prior to
hotplug.

Resolves: https://issues.redhat.com/browse/RHEL-39271
Fixes: 4690058b6d3dab672bd18ff69c83392245253024
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_validate.c

index ac1940cb31ad17be4233033e9ac80f85f1adc844..c08e1538f9bd5dd85c0e47cad432cc684b761f20 100644 (file)
@@ -4519,7 +4519,10 @@ qemuValidateDomainDeviceDefFS(virDomainFSDef *fs,
                 return -1;
             }
 
-            if (fs->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) {
+            /* Address type may be _NONE when validating and will be assigned
+             * later during hotplug */
+            if (fs->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE &&
+                fs->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) {
                 virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
                                _("setting virtiofs boot order is supported only with PCI bus"));
                 return -1;