diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2021-06-24 12:38:33 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2021-07-09 18:21:33 +0200 |
commit | b7b2a60b01036c6e7c21e7dc41829c7b5f6011b4 (patch) | |
tree | d5feef8607825f503e319186917f1d9d46abd6be /include | |
parent | f0e48cbd791e88728fcea65366dbb6d9a63a16e5 (diff) | |
download | qemu-b7b2a60b01036c6e7c21e7dc41829c7b5f6011b4.zip qemu-b7b2a60b01036c6e7c21e7dc41829c7b5f6011b4.tar.gz qemu-b7b2a60b01036c6e7c21e7dc41829c7b5f6011b4.tar.bz2 |
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>
Diffstat (limited to 'include')
-rw-r--r-- | include/hw/usb.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/hw/usb.h b/include/hw/usb.h index 436e07b..33668dd 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) */ |