qemu_command.c: move DISK_BUS_VIRTIO validation to qemu_validate.c

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
Daniel Henrique Barboza 2020-10-08 15:45:28 -03:00
parent da1748cab1
commit 216e4b1c45
2 changed files with 9 additions and 7 deletions

View File

@ -1683,13 +1683,6 @@ qemuBuildDiskDeviceStr(const virDomainDef *def,
}
if (disk->queues) {
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_BLK_NUM_QUEUES)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("num-queues property isn't supported by this "
"QEMU binary"));
return NULL;
}
virBufferAsprintf(&opt, ",num-queues=%u", disk->queues);
}

View File

@ -2263,6 +2263,15 @@ qemuValidateDomainDeviceDefDiskFrontend(const virDomainDiskDef *disk,
break;
case VIR_DOMAIN_DISK_BUS_VIRTIO:
if (disk->queues &&
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_BLK_NUM_QUEUES)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("num-queues property isn't supported by this "
"QEMU binary"));
return -1;
}
break;
case VIR_DOMAIN_DISK_BUS_XEN:
case VIR_DOMAIN_DISK_BUS_SD:
break;