block/backup: use backup-top instead of write notifiers
commit00e30f05de1d19586345ec373970ef4c192c6270
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Tue, 1 Oct 2019 13:14:09 +0000 (1 16:14 +0300)
committerMax Reitz <mreitz@redhat.com>
Thu, 10 Oct 2019 08:56:18 +0000 (10 10:56 +0200)
tree5ac9d5f5464b9f6c8ff64a47495ce3e03a66afc4
parent7df7868b9640402c465eec93c8e0fa9fc2cf5744
block/backup: use backup-top instead of write notifiers

Drop write notifiers and use filter node instead.

= Changes =

1. Add filter-node-name argument for backup qmp api. We have to do it
in this commit, as 257 needs to be fixed.

2. There are no more write notifiers here, so is_write_notifier
parameter is dropped from block-copy paths.

3. To sync with in-flight requests at job finish we now have drained
removing of the filter, we don't need rw-lock.

4. Block-copy is now using BdrvChildren instead of BlockBackends

5. As backup-top owns these children, we also move block-copy state
into backup-top's ownership.

= Iotest changes =

56: op-blocker doesn't shoot now, as we set it on source, but then
check on filter, when trying to start second backup.
To keep the test we instead can catch another collision: both jobs will
get 'drive0' job-id, as job-id parameter is unspecified. To prevent
interleaving with file-posix locks (as they are dependent on config)
let's use another target for second backup.

Also, it's obvious now that we'd like to drop this op-blocker at all
and add a test-case for two backups from one node (to different
destinations) actually works. But not in these series.

141: Output changed: prepatch, "Node is in use" comes from bdrv_has_blk
check inside qmp_blockdev_del. But we've dropped block-copy blk
objects, so no more blk objects on source bs (job blk is on backup-top
filter bs). New message is from op-blocker, which is the next check in
qmp_blockdev_add.

257: The test wants to emulate guest write during backup. They should
go to filter node, not to original source node, of course. Therefore we
need to specify filter node name and use it.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-id: 20191001131409.14202-6-vsementsov@virtuozzo.com
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
12 files changed:
block/backup-top.c
block/backup.c
block/block-copy.c
block/replication.c
blockdev.c
include/block/block-copy.h
include/block/block_int.h
qapi/block-core.json
tests/qemu-iotests/056
tests/qemu-iotests/141.out
tests/qemu-iotests/257
tests/qemu-iotests/257.out