From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49887) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YScGd-0002oX-L5 for qemu-devel@nongnu.org; Mon, 02 Mar 2015 21:09:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YScGc-0005nF-Pk for qemu-devel@nongnu.org; Mon, 02 Mar 2015 21:09:03 -0500 Date: Tue, 3 Mar 2015 10:08:52 +0800 From: Fam Zheng Message-ID: <20150303020852.GC13472@ad.nay.redhat.com> References: <1425055440-18038-1-git-send-email-mreitz@redhat.com> <1425055440-18038-6-git-send-email-mreitz@redhat.com> <20150228025520.GA27129@ad.nay.redhat.com> <54F47F5A.10803@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54F47F5A.10803@redhat.com> Subject: Re: [Qemu-devel] [PATCH v4 05/11] block: Move BDS close notifiers into BB List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: Kevin Wolf , qemu-block@nongnu.org, qemu-devel@nongnu.org, Markus Armbruster , Stefan Hajnoczi , Paolo Bonzini On Mon, 03/02 10:18, Max Reitz wrote: > On 2015-02-27 at 21:55, Fam Zheng wrote: > >On Fri, 02/27 11:43, Max Reitz wrote: > >> static void virtio_scsi_hotplug(HotplugHandler *hotplug_dev, DeviceState *dev, > >> Error **errp) > >> { > >>@@ -763,12 +794,26 @@ static void virtio_scsi_hotplug(HotplugHandler *hotplug_dev, DeviceState *dev, > >> SCSIDevice *sd = SCSI_DEVICE(dev); > >> if (s->ctx && !s->dataplane_disabled) { > >>+ VirtIOSCSIBlkChangeNotifier *insert_notifier, *remove_notifier; > >>+ > >>+ insert_notifier = g_new0(VirtIOSCSIBlkChangeNotifier, 1); > >>+ insert_notifier->n.notify = virtio_scsi_blk_insert_notifier; > >>+ insert_notifier->s = s; > >>+ insert_notifier->sd = sd; > >>+ blk_add_insert_bs_notifier(sd->conf.blk, &insert_notifier->n); > >>+ QTAILQ_INSERT_TAIL(&s->insert_notifiers, insert_notifier, next); > >Could you instead embed a Notifier into SCSIDevice, similarly? That way there > >is no need to maintain a list in VirtIOSCSI. > > I thought about that, but somehow SCSIDevice seemed so generic to me... I > didn't really want to add a VirtIOSCSI pointer to it (or even just a > notifier only to be used by virtio-scsi). > I see. Then it is better done as now. Fam