From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57311) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XXRxF-0004mP-Po for qemu-devel@nongnu.org; Fri, 26 Sep 2014 05:36:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XXRx9-0000zZ-D1 for qemu-devel@nongnu.org; Fri, 26 Sep 2014 05:36:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:19085) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XXRx9-0000z3-2j for qemu-devel@nongnu.org; Fri, 26 Sep 2014 05:36:39 -0400 From: Igor Mammedov Date: Fri, 26 Sep 2014 09:28:35 +0000 Message-Id: <1411723721-20484-31-git-send-email-imammedo@redhat.com> In-Reply-To: <1411723721-20484-1-git-send-email-imammedo@redhat.com> References: <1411723721-20484-1-git-send-email-imammedo@redhat.com> Subject: [Qemu-devel] [PATCH v2 30/36] usb-bot: mark device as non hotpluggable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: cornelia.huck@de.ibm.com, mst@redhat.com, amit.shah@redhat.com, agraf@suse.de, borntraeger@de.ibm.com, kraxel@redhat.com, dmitry@daynix.com, pbonzini@redhat.com, rth@twiddle.net usb-bot creates SCSI bus and immediately makes it non hotpluggable which was making not possible to hotplug usb-bot since QEMU would abort at bus_add_child(scsi-hd) time when usb-bot is realized. Mark usb-bot as not hotpluggable so that attempt to hotplug it would error out even before it gets to device initialization point. Signed-off-by: Igor Mammedov --- hw/usb/dev-storage.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c index bd7cc53..a207507 100644 --- a/hw/usb/dev-storage.c +++ b/hw/usb/dev-storage.c @@ -770,9 +770,11 @@ static void usb_msd_class_initfn_storage(ObjectClass *klass, void *data) static void usb_msd_class_initfn_bot(ObjectClass *klass, void *data) { USBDeviceClass *uc = USB_DEVICE_CLASS(klass); + DeviceClass *dc = DEVICE_CLASS(klass); uc->realize = usb_msd_realize_bot; usb_msd_class_initfn_common(klass); + dc->hotpluggable = false; } static const TypeInfo msd_info = { -- 1.8.3.1