[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 05/11] block: Move BDS close notifiers into B
From: |
Fam Zheng |
Subject: |
Re: [Qemu-devel] [PATCH v4 05/11] block: Move BDS close notifiers into BB |
Date: |
Tue, 3 Mar 2015 10:08:52 +0800 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
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