From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mpdbg-0004KM-Ml for qemu-devel@nongnu.org; Mon, 21 Sep 2009 03:46:44 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mpdba-0004Jd-84 for qemu-devel@nongnu.org; Mon, 21 Sep 2009 03:46:44 -0400 Received: from [199.232.76.173] (port=53226 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mpdba-0004Ja-2v for qemu-devel@nongnu.org; Mon, 21 Sep 2009 03:46:38 -0400 Received: from mx20.gnu.org ([199.232.41.8]:39019) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MpdbZ-0001Wy-HZ for qemu-devel@nongnu.org; Mon, 21 Sep 2009 03:46:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MpdbY-0007Kz-Kz for qemu-devel@nongnu.org; Mon, 21 Sep 2009 03:46:36 -0400 Message-ID: <4AB72F56.3060507@redhat.com> Date: Mon, 21 Sep 2009 09:46:30 +0200 From: Gerd Hoffmann MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 1/4] SCSI-hotdel: Add detach method to LSI SCSI driver References: <1253287594-12905-1-git-send-email-wolfgang.mauerer@siemens.com> <1253287594-12905-2-git-send-email-wolfgang.mauerer@siemens.com> In-Reply-To: <1253287594-12905-2-git-send-email-wolfgang.mauerer@siemens.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wolfgang Mauerer Cc: jan.kiszka@siemens.com, qemu-devel@nongnu.org, wlm.libvirt@googlemail.com > 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