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 <kraxel@redhat.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Jose R. Ziviani <jziviani@suse.de>
Message-Id: <20210624103836.2382472-32-kraxel@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Gerd Hoffmann 2021-06-24 12:38:33 +02:00 committed by Paolo Bonzini
parent f0e48cbd79
commit b7b2a60b01
7 changed files with 17 additions and 36 deletions

View file

@ -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) */