]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu_validate: Validate that QEMU's capable of guestReset
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 12 Jul 2022 10:27:20 +0000 (12:27 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 13 Jul 2022 14:01:11 +0000 (16:01 +0200)
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>
src/qemu/qemu_validate.c

index 39210ba65be1a1bc533fa221e8e53d20cf03cd5a..764d5b029ea795cc082b11f161720f8fc0585b23 100644 (file)
@@ -2543,6 +2543,14 @@ qemuValidateDomainDeviceDefHostdev(const virDomainHostdevDef *hostdev,
     if (hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) {
         switch ((virDomainHostdevSubsysType) hostdev->source.subsys.type) {
         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:
             break;