[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 14/18] block/fleecing-hook: internal api
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH v3 14/18] block/fleecing-hook: internal api |
Date: |
Thu, 4 Oct 2018 14:50:35 +0200 |
User-agent: |
Mutt/1.9.1 (2017-09-22) |
Am 01.10.2018 um 12:29 hat Vladimir Sementsov-Ogievskiy geschrieben:
> Add some functions to use fleecing-hook internally from backup job in
> further commit.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
> ---
> include/block/block.h | 9 ++++++++
> block/fleecing-hook.c | 51 +++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 60 insertions(+)
>
> diff --git a/include/block/block.h b/include/block/block.h
> index 4edc1e8afa..018751b6ea 100644
> --- a/include/block/block.h
> +++ b/include/block/block.h
> @@ -710,4 +710,13 @@ int coroutine_fn bdrv_co_copy_range(BdrvChild *src,
> uint64_t src_offset,
> BdrvChild *dst, uint64_t dst_offset,
> uint64_t bytes, BdrvRequestFlags
> read_flags,
> BdrvRequestFlags write_flags);
> +
> +
> +BlockDriverState *bdrv_fleecing_hook_append(BlockDriverState *source,
> + BlockDriverState *target,
> + const char *copy_bitmap_name,
> + Error **errp);
> +void bdrv_fleecing_hook_drop(BlockDriverState *hook);
> +uint64_t bdrv_fleecing_hook_progress(BlockDriverState *hook);
Public block.h interfaces that are specific to a single driver are bad
design. If at all possible, the generic block layer shouldn't know
anything about specific drivers.
Luckily, if you make the driver more consistent with what mirror and
commit are doing, you won't need public interfaces any more and the
functions will just become part of the backup job driver. (The backup
driver can still be split into multiple source files if necessary, and
then use a separate internal header; I'm not sure if this is the case
here, though.)
Kevin
- [Qemu-devel] [PATCH v3 00/18] fleecing-hook driver for backup, Vladimir Sementsov-Ogievskiy, 2018/10/01
- [Qemu-devel] [PATCH v3 10/18] iotests: handle -f argument correctly for qemu_io_silent, Vladimir Sementsov-Ogievskiy, 2018/10/01
- [Qemu-devel] [PATCH v3 04/18] block/backup: move from HBitmap to BdrvDirtyBitmap, Vladimir Sementsov-Ogievskiy, 2018/10/01
- [Qemu-devel] [PATCH v3 08/18] block: allow serialized reads to intersect, Vladimir Sementsov-Ogievskiy, 2018/10/01
- [Qemu-devel] [PATCH v3 02/18] block/io: allow BDRV_REQ_SERIALISING for read, Vladimir Sementsov-Ogievskiy, 2018/10/01
- [Qemu-devel] [PATCH v3 06/18] block/backup: give a name to copy-bitmap, Vladimir Sementsov-Ogievskiy, 2018/10/01
- [Qemu-devel] [PATCH v3 03/18] block/backup: simplify backup_incremental_init_copy_bitmap, Vladimir Sementsov-Ogievskiy, 2018/10/01
- [Qemu-devel] [PATCH v3 14/18] block/fleecing-hook: internal api, Vladimir Sementsov-Ogievskiy, 2018/10/01
- Re: [Qemu-devel] [PATCH v3 14/18] block/fleecing-hook: internal api,
Kevin Wolf <=
- [Qemu-devel] [PATCH v3 01/18] block/dirty-bitmap: allow set/reset bits in disabled bitmaps, Vladimir Sementsov-Ogievskiy, 2018/10/01
- [Qemu-devel] [PATCH v3 05/18] util/id: add block-bitmap subsystem, Vladimir Sementsov-Ogievskiy, 2018/10/01
- [Qemu-devel] [PATCH v3 13/18] block: introduce new filter driver: fleecing-hook, Vladimir Sementsov-Ogievskiy, 2018/10/01