From: Roman Bogorodskiy Date: Sun, 9 Nov 2025 10:10:54 +0000 (+0100) Subject: bhyve: domain: improve disks validation X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;p=thirdparty%2Flibvirt.git bhyve: domain: improve disks validation Do not allow to configure queues and queue size for non-NVMe disks. Signed-off-by: Roman Bogorodskiy Reviewed-by: Michal Privoznik --- diff --git a/src/bhyve/bhyve_domain.c b/src/bhyve/bhyve_domain.c index 16ca4b1d0f..4c9ed29333 100644 --- a/src/bhyve/bhyve_domain.c +++ b/src/bhyve/bhyve_domain.c @@ -316,6 +316,13 @@ bhyveDomainDeviceDefValidate(const virDomainDeviceDef *dev, return -1; } + if ((disk->queues || disk->queue_size) && + disk->bus != VIR_DOMAIN_DISK_BUS_NVME) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("queue configuration is only valid for NVMe bus")); + return -1; + } + break; } case VIR_DOMAIN_DEVICE_AUDIO: diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-disk-virtio-queue-opts.xml b/tests/bhyvexml2argvdata/bhyvexml2argv-disk-virtio-queue-opts.xml new file mode 100644 index 0000000000..1119c37b2b --- /dev/null +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-disk-virtio-queue-opts.xml @@ -0,0 +1,23 @@ + + bhyve + df3be7e7-a104-11e3-aeb0-50e5492bd3dc + 219136 + 1 + + hvm + + + + + + +
+ + + + + +
+ + + diff --git a/tests/bhyvexml2argvtest.c b/tests/bhyvexml2argvtest.c index f7411ee094..2a785ef8aa 100644 --- a/tests/bhyvexml2argvtest.c +++ b/tests/bhyvexml2argvtest.c @@ -267,6 +267,7 @@ mymain(void) DO_TEST_FAILURE("2-nvme-same-controller"); DO_TEST("sata-rotation-rate"); DO_TEST_FAILURE("disk-virtio-rotation-rate"); + DO_TEST_FAILURE("disk-virtio-queue-opts"); /* Address allocation tests */ DO_TEST("addr-single-sata-disk");