[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH 07/24] qcow2: add bitmaps extension
From: |
Max Reitz |
Subject: |
Re: [Qemu-block] [PATCH 07/24] qcow2: add bitmaps extension |
Date: |
Sun, 12 Feb 2017 04:11:30 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 |
On 03.02.2017 10:40, Vladimir Sementsov-Ogievskiy wrote:
> Add bitmap extension as specified in docs/specs/qcow2.txt.
> For now, just mirror extension header into Qcow2 state and check
> constraints.
>
> For now, disable image resize if it has bitmaps. It will be fixed later.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
> ---
> block/qcow2.c | 127
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++---
> block/qcow2.h | 24 +++++++++++
> 2 files changed, 145 insertions(+), 6 deletions(-)
>
> diff --git a/block/qcow2.c b/block/qcow2.c
> index 96fb8a8f16..d263ab1ed7 100644
> --- a/block/qcow2.c
> +++ b/block/qcow2.c
[...]
> @@ -1151,9 +1237,13 @@ static int qcow2_open(BlockDriverState *bs, QDict
> *options, int flags,
> goto fail;
> }
>
> - /* Clear unknown autoclear feature bits */
> - if (!bs->read_only && !(flags & BDRV_O_INACTIVE) &&
> s->autoclear_features) {
> - s->autoclear_features = 0;
> + if (!need_update_header) {
> + /* Clear unknown autoclear feature bits */
> + need_update_header = s->autoclear_features & ~QCOW2_AUTOCLEAR_MASK;
> + }
Alternatively,
need_update_header |= s->autoclear_features & ~QCOW2_AUTOCLEAR_MASK;
would have worked just as well and might have been a bit easier to read.
Anyway:
Reviewed-by: Max Reitz <address@hidden>
> +
> + if (need_update_header && !bs->read_only && !(flags & BDRV_O_INACTIVE)) {
> + s->autoclear_features &= QCOW2_AUTOCLEAR_MASK;
> ret = qcow2_update_header(bs);
> if (ret < 0) {
> error_setg_errno(errp, -ret, "Could not update qcow2 header");
signature.asc
Description: OpenPGP digital signature
- [Qemu-block] [PATCH 11/24] block: introduce persistent dirty bitmaps, (continued)
- [Qemu-block] [PATCH 16/24] qmp: add persistent flag to block-dirty-bitmap-add, Vladimir Sementsov-Ogievskiy, 2017/02/03
- [Qemu-block] [PATCH 24/24] qmp: block-dirty-bitmap-remove: remove persistent, Vladimir Sementsov-Ogievskiy, 2017/02/03
- [Qemu-block] [PATCH 20/24] qcow2-refcount: rename inc_refcounts() and make it public, Vladimir Sementsov-Ogievskiy, 2017/02/03
- [Qemu-block] [PATCH 07/24] qcow2: add bitmaps extension, Vladimir Sementsov-Ogievskiy, 2017/02/03
- [Qemu-block] [PATCH 02/24] specs/qcow2: do not use wording 'bitmap header', Vladimir Sementsov-Ogievskiy, 2017/02/03
- [Qemu-block] [PATCH 03/24] hbitmap: improve dirty iter, Vladimir Sementsov-Ogievskiy, 2017/02/03
- [Qemu-block] [PATCH 18/24] qmp: add x-debug-block-dirty-bitmap-sha256, Vladimir Sementsov-Ogievskiy, 2017/02/03
- [Qemu-block] [PATCH 13/24] qcow2: add .bdrv_store_persistent_dirty_bitmaps(), Vladimir Sementsov-Ogievskiy, 2017/02/03
[Qemu-block] [PATCH 09/24] qcow2: add .bdrv_load_autoloading_dirty_bitmaps, Vladimir Sementsov-Ogievskiy, 2017/02/03