From b7b2a60b01036c6e7c21e7dc41829c7b5f6011b4 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Thu, 24 Jun 2021 12:38:33 +0200 Subject: usb: drop usb_host_dev_is_scsi_storage hook Introduce an usb device flag instead, set it when usb-host looks at the device descriptors anyway. Also set it for emulated storage devices, for consistency. Add an inline helper function to check the flag. Signed-off-by: Gerd Hoffmann Acked-by: David Gibson Reviewed-by: Jose R. Ziviani Message-Id: <20210624103836.2382472-32-kraxel@redhat.com> Signed-off-by: Paolo Bonzini --- include/hw/usb.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/hw/usb.h b/include/hw/usb.h index 436e07b304..33668dd0a9 100644 --- a/include/hw/usb.h +++ b/include/hw/usb.h @@ -219,6 +219,7 @@ enum USBDeviceFlags { USB_DEV_FLAG_IS_HOST, USB_DEV_FLAG_MSOS_DESC_ENABLE, USB_DEV_FLAG_MSOS_DESC_IN_USE, + USB_DEV_FLAG_IS_SCSI_STORAGE, }; /* definition of a USB device */ @@ -465,7 +466,6 @@ void usb_generic_async_ctrl_complete(USBDevice *s, USBPacket *p); /* usb-linux.c */ void hmp_info_usbhost(Monitor *mon, const QDict *qdict); -bool usb_host_dev_is_scsi_storage(USBDevice *usbdev); /* usb ports of the VM */ @@ -561,6 +561,11 @@ const char *usb_device_get_product_desc(USBDevice *dev); const USBDesc *usb_device_get_usb_desc(USBDevice *dev); +static inline bool usb_device_is_scsi_storage(USBDevice *dev) +{ + return dev->flags & (1 << USB_DEV_FLAG_IS_SCSI_STORAGE); +} + /* quirks.c */ /* In bulk endpoints are streaming data sources (iow behave like isoc eps) */ -- cgit v1.2.3