qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 26/30] usb-storage: make its storage SCSI bus hotplu


From: Igor Mammedov
Subject: [Qemu-devel] [PATCH 26/30] usb-storage: make its storage SCSI bus hotpluggable explicitly
Date: Wed, 24 Sep 2014 11:48:15 +0000

usb-storage uses SCSI bus to provide underling storage
(i.e. scsi-disk) and it's hotpluggable. In addition
during usb-storage hotplug bus_add_child() won't allow
to add scsi-disk to SCSI bus owned by usb-storage
if bus is not hotpluggable.

By default SCSI bus was alway hotpluggable even if
an owner didn't support hotplug. It will change
once BusState.allow_hotplug field is dropped and
SCSI bus will be only hotpluggable only if bus owner
implements HOTPLUG_HANDLER interface.

So make usb-storage implement HOTPLUG_HANDLER interface
to keep its SCSI bus hotpluggable.

Signed-off-by: Igor Mammedov <address@hidden>
---
 hw/usb/dev-storage.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c
index bfa71c7..4ad4ec7 100644
--- a/hw/usb/dev-storage.c
+++ b/hw/usb/dev-storage.c
@@ -779,6 +779,10 @@ static const TypeInfo msd_info = {
     .parent        = TYPE_USB_DEVICE,
     .instance_size = sizeof(MSDState),
     .class_init    = usb_msd_class_initfn_storage,
+    .interfaces = (InterfaceInfo[]) {
+        { TYPE_HOTPLUG_HANDLER },
+        { }
+    }
 };
 
 static const TypeInfo bot_info = {
-- 
1.8.3.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]