[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 2/6] blockdev: Split off basic bitmap operations for qemu-
From: |
Max Reitz |
Subject: |
Re: [PATCH v2 2/6] blockdev: Split off basic bitmap operations for qemu-img |
Date: |
Thu, 30 Apr 2020 15:59:40 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 |
On 21.04.20 23:20, Eric Blake wrote:
> Upcoming patches want to add some basic bitmap manipulation abilities
> to qemu-img. But blockdev.o is too heavyweight to link into qemu-img
> (among other things, it would drag in block jobs and transaction
> support - qemu-img does offline manipulation, where atomicity is less
> important because there are no concurrent modifications to compete
> with), so it's time to split off the bare bones of what we will need
> into a new file blockbitmaps.o.
>
> In addition to exposing 6 QMP commands for use by qemu-img (add,
> remove, clear, enable, disable, merge), this also has to export three
> previously-static functions for use by blockdev.c transactions.
>
> Signed-off-by: Eric Blake <address@hidden>
> ---
> Makefile.objs | 2 +-
> include/sysemu/blockdev.h | 14 ++
> blockbitmaps.c | 324 ++++++++++++++++++++++++++++++++++++++
Hm. Can we get a better name? blockdev-bitmaps.c, for example?
> blockdev.c | 293 ----------------------------------
> MAINTAINERS | 1 +
> 5 files changed, 340 insertions(+), 294 deletions(-)
> create mode 100644 blockbitmaps.c
[...]
> diff --git a/include/sysemu/blockdev.h b/include/sysemu/blockdev.h
> index a86d99b3d875..523b7493b1cd 100644
> --- a/include/sysemu/blockdev.h
> +++ b/include/sysemu/blockdev.h
> @@ -57,4 +57,18 @@ QemuOpts *drive_add(BlockInterfaceType type, int index,
> const char *file,
> DriveInfo *drive_new(QemuOpts *arg, BlockInterfaceType block_default_type,
> Error **errp);
>
> +BdrvDirtyBitmap *block_dirty_bitmap_lookup(const char *node,
> + const char *name,
> + BlockDriverState **pbs,
> + Error **errp);
> +BdrvDirtyBitmap *do_block_dirty_bitmap_remove(const char *node,
> + const char *name, bool release,
> + BlockDriverState **bitmap_bs,
> + Error **errp);
> +BdrvDirtyBitmap *do_block_dirty_bitmap_merge(const char *node,
> + const char *target,
> + BlockDirtyBitmapMergeSourceList
> *bitmaps,
> + HBitmap **backup, Error **errp);
Putting do_* functions into a normal header seems a bit weird. Would
these fit better into block_int.h?
> +
> #endif
[...]
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 8cbc1fac2bfc..769cd357d281 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -1989,6 +1989,7 @@ T: git https://github.com/jnsnow/qemu.git jobs
> Block QAPI, monitor, command line
> M: Markus Armbruster <address@hidden>
> S: Supported
> +F: blockbitmaps.c
The natural choice for something split off of blockdev.c, but I wonder
if the Dirty Bitmaps section wouldn’t be a better fit.
Max
> F: blockdev.c
> F: blockdev-hmp-cmds.c
> F: block/qapi.c
>
signature.asc
Description: OpenPGP digital signature
- [PATCH v2 0/6] qemu-img: Add convert --bitmaps, Eric Blake, 2020/04/21
- [PATCH v2 1/6] docs: Sort sections on qemu-img subcommand parameters, Eric Blake, 2020/04/21
- [PATCH v2 4/6] qcow2: Expose bitmaps' size during measure, Eric Blake, 2020/04/21
- [PATCH v2 3/6] qemu-img: Add bitmap sub-command, Eric Blake, 2020/04/21
- [PATCH v2 5/6] qemu-img: Add convert --bitmaps option, Eric Blake, 2020/04/21
- [PATCH v2 2/6] blockdev: Split off basic bitmap operations for qemu-img, Eric Blake, 2020/04/21
- Re: [PATCH v2 2/6] blockdev: Split off basic bitmap operations for qemu-img,
Max Reitz <=
- [PATCH v2 6/6] iotests: Add test 291 to for qemu-img bitmap coverage, Eric Blake, 2020/04/21
- Re: [PATCH v2 0/6] qemu-img: Add convert --bitmaps, no-reply, 2020/04/21