[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v9 12/13] block: introduce backup-top filter dri
From: |
Max Reitz |
Subject: |
Re: [Qemu-devel] [PATCH v9 12/13] block: introduce backup-top filter driver |
Date: |
Wed, 28 Aug 2019 19:52:14 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 |
On 26.08.19 18:13, Vladimir Sementsov-Ogievskiy wrote:
> Backup-top filter caches write operations and does copy-before-write
> operations.
>
> The driver will be used in backup instead of write-notifiers.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
> ---
> block/backup-top.h | 37 +++++++
> block/backup-top.c | 245 ++++++++++++++++++++++++++++++++++++++++++++
> block/Makefile.objs | 2 +
> 3 files changed, 284 insertions(+)
> create mode 100644 block/backup-top.h
> create mode 100644 block/backup-top.c
[...]
> +static void backup_top_refresh_filename(BlockDriverState *bs)
> +{
> + if (bs->backing == NULL) {
> + /*
> + * we can be here after failed bdrv_attach_child in
> + * bdrv_set_backing_hd
> + */
> + return;
> + }
> + bdrv_refresh_filename(bs->backing->bs);
bdrv_refresh_filename() should have done this already.
> + pstrcpy(bs->exact_filename, sizeof(bs->exact_filename),
> + bs->backing->bs->filename);
> +}
[...]
> +BlockDriverState *bdrv_backup_top_append(BlockDriverState *source,
> + const char *filter_node_name,
> + Error **errp)
> +{
[...]
> + assert(!(top->backing->shared_perm & BLK_PERM_WRITE));
Not wrong, but why?
> +
> + return top;
> +}
> +
> +void bdrv_backup_top_set_bcs(BlockDriverState *bs, BlockCopyState
> *copy_state)
> +{
> + BDRVBackupTopState *s = bs->opaque;
> +
> + assert(blk_bs(copy_state->source) == bs->backing->bs);
> + s->bcs = copy_state;
> +}
> +
> +void bdrv_backup_top_drop(BlockDriverState *bs)
> +{
> + AioContext *aio_context = bdrv_get_aio_context(bs);
> +
> + aio_context_acquire(aio_context);
> +
> + bdrv_drained_begin(bs);
> +
> + bdrv_child_try_set_perm(bs->backing, 0, BLK_PERM_ALL, &error_abort);
I would prefer a state->active = false and bdrv_child_refresh_perms().
Max
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v9 10/13] block/io: refactor wait_serialising_requests, (continued)
- [Qemu-devel] [PATCH v9 10/13] block/io: refactor wait_serialising_requests, Vladimir Sementsov-Ogievskiy, 2019/08/26
- [Qemu-devel] [PATCH v9 04/13] block/backup: adjust block-copy functions style, Vladimir Sementsov-Ogievskiy, 2019/08/26
- [Qemu-devel] [PATCH v9 11/13] block: add lock/unlock range functions, Vladimir Sementsov-Ogievskiy, 2019/08/26
- [Qemu-devel] [PATCH v9 01/13] block/backup: fix backup_cow_with_offload for last cluster, Vladimir Sementsov-Ogievskiy, 2019/08/26
- [Qemu-devel] [PATCH v9 12/13] block: introduce backup-top filter driver, Vladimir Sementsov-Ogievskiy, 2019/08/26
- Re: [Qemu-devel] [PATCH v9 12/13] block: introduce backup-top filter driver,
Max Reitz <=
- [Qemu-devel] [PATCH v9 09/13] iotests: 257: drop device_add, Vladimir Sementsov-Ogievskiy, 2019/08/26
- [Qemu-devel] [PATCH v9 03/13] block/backup: introduce BlockCopyState, Vladimir Sementsov-Ogievskiy, 2019/08/26
- [Qemu-devel] [PATCH v9 05/13] block: move block_copy from block/backup.c to separate file, Vladimir Sementsov-Ogievskiy, 2019/08/26
- [Qemu-devel] [PATCH v9 06/13] block: teach bdrv_debug_breakpoint skip filters with backing, Vladimir Sementsov-Ogievskiy, 2019/08/26