]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Always assume QEMU_CAPS_USB_STORAGE_REMOVABLE
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 19 Jul 2023 11:26:31 +0000 (13:26 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 19 Jul 2023 11:26:31 +0000 (13:26 +0200)
Introduced in QEMU commit of v0.14.0-rc0~83^2~1 and not being
able to compile the .removable attribute of the "usb-storage"
object out, renders our corresponding capability
QEMU_CAPS_USB_STORAGE_REMOVABLE always set. Stop using it in
command generation / domain validation.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_command.c
src/qemu/qemu_validate.c

index ad224571f33794611c7de96c5dd97a8534638107..9f04bfc57d2f3b795705d764c80538f8a0af9216 100644 (file)
@@ -1842,12 +1842,10 @@ qemuBuildDiskDeviceProps(const virDomainDef *def,
     case VIR_DOMAIN_DISK_BUS_USB:
         driver = "usb-storage";
 
-        if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_USB_STORAGE_REMOVABLE)) {
-            if (disk->removable == VIR_TRISTATE_SWITCH_ABSENT)
-                removable = VIR_TRISTATE_SWITCH_OFF;
-            else
-                removable = disk->removable;
-        }
+        if (disk->removable == VIR_TRISTATE_SWITCH_ABSENT)
+            removable = VIR_TRISTATE_SWITCH_OFF;
+        else
+            removable = disk->removable;
 
         break;
 
index 7e09e2c52f889612dd1f99d36be766aa9de917ce..477ae997fec3b20d5fbc4ca941a7efeb5fa1d830 100644 (file)
@@ -3006,14 +3006,6 @@ qemuValidateDomainDeviceDefDiskFrontend(const virDomainDiskDef *disk,
             return -1;
         }
 
-        if (disk->removable != VIR_TRISTATE_SWITCH_ABSENT &&
-            !virQEMUCapsGet(qemuCaps, QEMU_CAPS_USB_STORAGE_REMOVABLE)) {
-            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                           _("This QEMU doesn't support setting the "
-                             "removable flag of USB storage devices"));
-            return -1;
-        }
-
         break;
 
     case VIR_DOMAIN_DISK_BUS_XEN: