qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/4] SCSI-hotdel: Add detach method to LSI SCSI


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [PATCH 1/4] SCSI-hotdel: Add detach method to LSI SCSI driver
Date: Mon, 21 Sep 2009 09:46:30 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090814 Fedora/3.0-2.6.b3.fc11 Lightning/1.0pre Thunderbird/3.0b3

diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c
index 62bdca8..7e975b4 100644
--- a/hw/lsi53c895a.c
+++ b/hw/lsi53c895a.c
@@ -1959,6 +1959,22 @@ static void lsi_mmio_mapfunc(PCIDevice *pci_dev, int 
region_num,
      cpu_register_physical_memory(addr + 0, 0x400, s->mmio_io_addr);
  }

+void lsi_scsi_detach(DeviceState *host, BlockDriverState *bd, int id)
+{
+    LSIState *s = (LSIState *)host;
+
+    if (id>= LSI_MAX_DEVS || id<  0) {
+        BADF("Bad Device ID %d\n", id);
+        return;
+    }
+
+    if (s->bus->devs[id]) {
+        DPRINTF("Destroying device %d\n", id);
+        s->bus->devs[id]->info->destroy(s->bus->devs[id]);
+    }
+    s->bus->devs[id] = NULL;
+}
+

Wrong place. It should go to scsi-bus.c, it is the reverse of the scsi_qdev_init function.

cheers,
  Gerd




reply via email to

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