qemu: validate: Fix check for unsupported FS-device bootindex use on un-assigned addresses

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: 4690058b6d
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Peter Krempa 2024-05-30 16:30:47 +02:00
parent 63b32dbe8b
commit f3e8c10fe4

View File

@ -4519,7 +4519,10 @@ qemuValidateDomainDeviceDefFS(virDomainFSDef *fs,
return -1; 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", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("setting virtiofs boot order is supported only with PCI bus")); _("setting virtiofs boot order is supported only with PCI bus"));
return -1; return -1;