From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41374) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aO146-0001hG-Gk for qemu-devel@nongnu.org; Tue, 26 Jan 2016 05:41:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aO145-0007mt-Gd for qemu-devel@nongnu.org; Tue, 26 Jan 2016 05:41:38 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47739) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aO145-0007mC-Aw for qemu-devel@nongnu.org; Tue, 26 Jan 2016 05:41:37 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 725EC1C5F59 for ; Tue, 26 Jan 2016 10:41:35 +0000 (UTC) From: Gerd Hoffmann Date: Tue, 26 Jan 2016 11:41:21 +0100 Message-Id: <1453804885-15544-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 0/4] usb: hotplug support for usb-bot and usb-uas List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Markus Armbruster , Gerd Hoffmann Hi, Composite device hotplug is a long-standing issue in qemu. PCI multifunction hotplug has been solved recently in a pci-specific way, by simply not showing hot-plugged functions to the guest until function #0 is plugged. So I figured we maybe should check whenever we can apply a simliar trick to USB composite devices. As the usb subsystem already can hide usb devices from the guest (used for example with usb-host, in case the physical usb device is not plugged in the host machine) this turned out to be surprisingly simple. So, here we go. Basic idea is the "attached" state becomes settable via monitor. Now you can create a usb-bot (or usb-uas) device, then attach the scsi device(s) you want, and when you are done you flip attached to true to make the composed device visible to the guest. pleae review & comment, Gerd Gerd Hoffmann (4): usb: make USBDevice->attached bool usb: add attached property usb-bot: hotplug support usb-uas: hotplug support hw/usb/bus.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++---- hw/usb/dev-storage.c | 8 ++++++-- hw/usb/dev-uas.c | 5 +++++ include/hw/usb.h | 3 ++- 4 files changed, 59 insertions(+), 7 deletions(-) -- 1.8.3.1