From f3e8c10fe4a929a0f109ee39d8fb2171a79fb20d Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Thu, 30 May 2024 16:30:47 +0200 Subject: [PATCH] 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: 4690058b6d3dab672bd18ff69c83392245253024 Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- src/qemu/qemu_validate.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index ac1940cb31..c08e1538f9 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -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;