qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 18/24] scsi: hotplug windup


From: Gerd Hoffmann
Subject: [Qemu-devel] [PATCH 18/24] scsi: hotplug windup
Date: Fri, 25 Sep 2009 21:42:43 +0200

Signed-off-by: Gerd Hoffmann <address@hidden>
---
 hw/scsi-bus.c |    2 ++
 hw/usb-msd.c  |    1 +
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c
index 27defc4..fe8991e 100644
--- a/hw/scsi-bus.c
+++ b/hw/scsi-bus.c
@@ -23,6 +23,7 @@ void scsi_bus_new(SCSIBus *bus, DeviceState *host, int tcq, 
int ndev,
     bus->tcq = tcq;
     bus->ndev = ndev;
     bus->complete = complete;
+    bus->qbus.allow_hotplug = 1;
 }
 
 static int scsi_qdev_init(DeviceState *qdev, DeviceInfo *base)
@@ -75,6 +76,7 @@ void scsi_qdev_register(SCSIDeviceInfo *info)
 {
     info->qdev.bus_info = &scsi_bus_info;
     info->qdev.init     = scsi_qdev_init;
+    info->qdev.unplug   = qdev_simple_unplug_cb;
     info->qdev.exit     = scsi_qdev_exit;
     qdev_register(&info->qdev);
 }
diff --git a/hw/usb-msd.c b/hw/usb-msd.c
index 843a22f..a19b31d 100644
--- a/hw/usb-msd.c
+++ b/hw/usb-msd.c
@@ -527,6 +527,7 @@ static int usb_msd_initfn(USBDevice *dev)
     s->dev.speed = USB_SPEED_FULL;
     scsi_bus_new(&s->bus, &s->dev.qdev, 0, 1, usb_msd_command_complete);
     s->scsi_dev = scsi_bus_legacy_add_drive(&s->bus, s->dinfo, 0);
+    s->bus.qbus.allow_hotplug = 0;
     usb_msd_handle_reset(dev);
     return 0;
 }
-- 
1.6.2.5





reply via email to

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