[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 05/11] block: Move BDS close notifiers into B
From: |
Fam Zheng |
Subject: |
Re: [Qemu-devel] [PATCH v3 05/11] block: Move BDS close notifiers into BB |
Date: |
Thu, 26 Feb 2015 10:19:10 +0800 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Wed, 02/25 09:12, Max Reitz wrote:
> Because I need a Notifier pointer to give to
> blk_add_{insert,remove}_bs_notifier(), and most importantly because the only
> "opaque" object the callbacks will receive is that Notifier pointer (which
> in this case is actually a DataPlaneBlkChangeNotifier pointer). I cannot
> influence the @data parameter, and I cannot (easily) identify the
> VirtIOBlockDataPlane object from the BlockBackend (which is @data) alone.
Probably like this:
struct VirtIOBlockDataPlane {
...
Notifier insert_notifier, remove_notifier;
...
};
static void data_plane_blk_insert_notifier(Notifier *n, void *data)
{
VirtIOBlockDataPlane *s = container_of(n, VirtIOBlockDataPlane,
insert_notifier);
assert(s->conf->conf.blk == data);
data_plane_set_up_op_blockers(s);
}
void virtio_blk_data_plane_create(VirtIODevice *vdev, VirtIOBlkConf *conf,
VirtIOBlockDataPlane **dataplane,
{
...
s->insert_notifier.notify = data_plane_blk_insert_notifier;
blk_add_insert_bs_notifier(conf->conf.blk, &s->insert_notifier);
...
}
?
> Won't virtio_scsi_hotunplug() (which frees s->{insert,remove}_notifier) be
> called before a second device is plugged?
>
No, multiple SCSIDevice objects (scsi-disk, scsi-generic, etc...) can be
attached to the same virtio-scsi bus.
Fam
- Re: [Qemu-devel] [PATCH v3 01/11] iotests: Move _filter_nbd into common.filter, (continued)
- [Qemu-devel] [PATCH v3 04/11] quorum: Fix close path, Max Reitz, 2015/02/24
- [Qemu-devel] [PATCH v3 03/11] iotests: Add test for eject under NBD server, Max Reitz, 2015/02/24
- [Qemu-devel] [PATCH v3 07/11] blockdev: Use blk_remove_bs() in do_drive_del(), Max Reitz, 2015/02/24
- [Qemu-devel] [PATCH v3 11/11] iotests: Add test for multiple BB on BDS tree, Max Reitz, 2015/02/24
- [Qemu-devel] [PATCH v3 05/11] block: Move BDS close notifiers into BB, Max Reitz, 2015/02/24
[Qemu-devel] [PATCH v3 06/11] block: Use blk_remove_bs() in blk_delete(), Max Reitz, 2015/02/24
[Qemu-devel] [PATCH v3 02/11] iotests: Do not redirect qemu's stderr, Max Reitz, 2015/02/24
[Qemu-devel] [PATCH v3 08/11] block: Make bdrv_close() static, Max Reitz, 2015/02/24
[Qemu-devel] [PATCH v3 09/11] blockdev: Keep track of monitor-owned BDS, Max Reitz, 2015/02/24
[Qemu-devel] [PATCH v3 10/11] block: Eject BDS tree from BB at bdrv_close_all(), Max Reitz, 2015/02/24