qemu_validate: Validate that QEMU's capable of guestReset

Now that we have a capability, validate that the QEMU we are
talking to has everything we need for guestReset.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Michal Privoznik 2022-07-12 12:27:20 +02:00
parent 0738d339a3
commit 10a353c92c

View File

@ -2543,6 +2543,14 @@ qemuValidateDomainDeviceDefHostdev(const virDomainHostdevDef *hostdev,
if (hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) { if (hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) {
switch ((virDomainHostdevSubsysType) hostdev->source.subsys.type) { switch ((virDomainHostdevSubsysType) hostdev->source.subsys.type) {
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB: case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB:
if (hostdev->source.subsys.u.usb.guestReset &&
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_USB_HOST_GUESTS_RESETS_ALL)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("guestReset is not supported with this version of QEMU"));
return -1;
}
break;
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI: case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI:
break; break;