mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +00:00
qemu: move hostdev boot validation into domain validation
Moving the hostdev boot support validation from the command line generator code into the domain validation code. Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com> Signed-off-by: Bjoern Walk <bwalk@linux.ibm.com> Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
927d0c3e5c
commit
182659d8bd
@ -5422,18 +5422,6 @@ qemuBuildHostdevCommandLine(virCommandPtr cmd,
|
|||||||
virDomainHostdevSubsysPtr subsys = &hostdev->source.subsys;
|
virDomainHostdevSubsysPtr subsys = &hostdev->source.subsys;
|
||||||
VIR_AUTOFREE(char *) devstr = NULL;
|
VIR_AUTOFREE(char *) devstr = NULL;
|
||||||
|
|
||||||
if (hostdev->info->bootIndex) {
|
|
||||||
if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS ||
|
|
||||||
(subsys->type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI &&
|
|
||||||
subsys->type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB &&
|
|
||||||
subsys->type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI)) {
|
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
|
||||||
_("booting from assigned devices is only "
|
|
||||||
"supported for PCI, USB and SCSI devices"));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* USB */
|
/* USB */
|
||||||
if (hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS &&
|
if (hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS &&
|
||||||
subsys->type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB) {
|
subsys->type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB) {
|
||||||
|
@ -5295,9 +5295,22 @@ qemuDomainDeviceDefValidateHostdev(const virDomainHostdevDef *hostdev,
|
|||||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB:
|
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB:
|
||||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
|
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
|
||||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI:
|
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI:
|
||||||
|
break;
|
||||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST:
|
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST:
|
||||||
|
if (hostdev->info->bootIndex) {
|
||||||
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
_("booting from assigned devices is only "
|
||||||
|
"supported for PCI, USB and SCSI devices"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV:
|
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV:
|
||||||
|
if (hostdev->info->bootIndex) {
|
||||||
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
_("booting from assigned devices is only "
|
||||||
|
"supported for PCI, USB and SCSI devices"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
mdevsrc = &hostdev->source.subsys.u.mdev;
|
mdevsrc = &hostdev->source.subsys.u.mdev;
|
||||||
return qemuDomainMdevDefValidate(mdevsrc, def, qemuCaps);
|
return qemuDomainMdevDefValidate(mdevsrc, def, qemuCaps);
|
||||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
|
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
|
||||||
|
@ -1639,7 +1639,7 @@ mymain(void)
|
|||||||
|
|
||||||
DO_TEST_CAPS_ARCH_LATEST("hostdev-subsys-mdev-vfio-ap",
|
DO_TEST_CAPS_ARCH_LATEST("hostdev-subsys-mdev-vfio-ap",
|
||||||
"s390x");
|
"s390x");
|
||||||
DO_TEST_CAPS_ARCH_LATEST_FAILURE("hostdev-subsys-mdev-vfio-ap-boot-fail",
|
DO_TEST_CAPS_ARCH_LATEST_PARSE_ERROR("hostdev-subsys-mdev-vfio-ap-boot-fail",
|
||||||
"s390x");
|
"s390x");
|
||||||
|
|
||||||
DO_TEST_FULL("restore-v2",
|
DO_TEST_FULL("restore-v2",
|
||||||
@ -2444,7 +2444,7 @@ mymain(void)
|
|||||||
DO_TEST("hostdev-scsi-vhost-scsi-pci",
|
DO_TEST("hostdev-scsi-vhost-scsi-pci",
|
||||||
QEMU_CAPS_VIRTIO_SCSI,
|
QEMU_CAPS_VIRTIO_SCSI,
|
||||||
QEMU_CAPS_DEVICE_VHOST_SCSI);
|
QEMU_CAPS_DEVICE_VHOST_SCSI);
|
||||||
DO_TEST_CAPS_LATEST_FAILURE("hostdev-scsi-vhost-scsi-pci-boot-fail");
|
DO_TEST_CAPS_LATEST_PARSE_ERROR("hostdev-scsi-vhost-scsi-pci-boot-fail");
|
||||||
DO_TEST("hostdev-scsi-vhost-scsi-pcie",
|
DO_TEST("hostdev-scsi-vhost-scsi-pcie",
|
||||||
QEMU_CAPS_KVM,
|
QEMU_CAPS_KVM,
|
||||||
QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_DEVICE_VHOST_SCSI,
|
QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_DEVICE_VHOST_SCSI,
|
||||||
|
Loading…
Reference in New Issue
Block a user