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

Reply via email to