summaryrefslogtreecommitdiff
path: root/hw/usb
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2016-06-15 11:46:59 +0200
committerGerd Hoffmann <kraxel@redhat.com>2016-06-22 12:53:26 +0200
commit0d4cf3e72aadc40aa866fef7ceb82dfbfdc9ac47 (patch)
tree488ac64e43de5caf205d4af6c9dc8fb7b45d5b2b /hw/usb
parentb78ecd0998094a8b7e0f14c4888f3a6b525d14ff (diff)
downloadqemu-0d4cf3e72aadc40aa866fef7ceb82dfbfdc9ac47.tar.gz
qemu-0d4cf3e72aadc40aa866fef7ceb82dfbfdc9ac47.tar.bz2
qemu-0d4cf3e72aadc40aa866fef7ceb82dfbfdc9ac47.zip
usb-uas: hotplug support
Make attached property settable and turns off auto-attach in case the device was hotplugged. Hotplugging works simliar to usb-bot now. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-id: 1465984019-28963-6-git-send-email-kraxel@redhat.com
Diffstat (limited to 'hw/usb')
-rw-r--r--hw/usb/dev-uas.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/hw/usb/dev-uas.c b/hw/usb/dev-uas.c
index 0678b1b05b..3a8ff18b1b 100644
--- a/hw/usb/dev-uas.c
+++ b/hw/usb/dev-uas.c
@@ -900,9 +900,13 @@ static void usb_uas_handle_destroy(USBDevice *dev)
static void usb_uas_realize(USBDevice *dev, Error **errp)
{
UASDevice *uas = USB_UAS(dev);
+ DeviceState *d = DEVICE(dev);
usb_desc_create_serial(dev);
usb_desc_init(dev);
+ if (d->hotplugged) {
+ uas->dev.auto_attach = 0;
+ }
QTAILQ_INIT(&uas->results);
QTAILQ_INIT(&uas->requests);
@@ -940,6 +944,7 @@ static void usb_uas_class_initfn(ObjectClass *klass, void *data)
uc->handle_control = usb_uas_handle_control;
uc->handle_data = usb_uas_handle_data;
uc->handle_destroy = usb_uas_handle_destroy;
+ uc->attached_settable = true;
set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
dc->fw_name = "storage";
dc->vmsd = &vmstate_usb_uas;