[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v20 10/30] block/dirty-bitmap: add readonly fiel
From: |
Max Reitz |
Subject: |
Re: [Qemu-block] [PATCH v20 10/30] block/dirty-bitmap: add readonly field to BdrvDirtyBitmap |
Date: |
Fri, 9 Jun 2017 14:56:15 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 |
On 2017-06-02 13:21, Vladimir Sementsov-Ogievskiy wrote:
> It will be needed in following commits for persistent bitmaps.
> If bitmap is loaded from read-only storage (and we can't mark it
> "in use" in this storage) corresponding BdrvDirtyBitmap should be
> read-only.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
> ---
> block/dirty-bitmap.c | 32 ++++++++++++++++++++++++++++++++
> block/io.c | 8 ++++++++
> blockdev.c | 6 ++++++
> include/block/dirty-bitmap.h | 4 ++++
> 4 files changed, 50 insertions(+)
>
> diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c
> index f25428868c..1c9ffb292a 100644
> --- a/block/dirty-bitmap.c
> +++ b/block/dirty-bitmap.c
> @@ -45,6 +45,12 @@ struct BdrvDirtyBitmap {
> bool disabled; /* Bitmap is disabled. It skips all writes to
> the device */
> int active_iterators; /* How many iterators are active */
> + bool readonly; /* Bitmap is read-only and may be changed
> only
> + by deserialize* functions. This field
> blocks
> + any changing operations on owning image
> + (writes and discards), if bitmap is
> readonly
> + such operations must fail and not change
> + image or this bitmap */
"This fields blocks any modifying operations on the respective image
(writes and discards). If the bitmap is read-only, such operations must
fail and not change the image or this bitmap."
Or, what I'd think to be more natural:
"This fields also prevents the respective image from being modified
(i.e. blocks writes and discards). Such operations must fail and both
the image and this bitmap must remain unchanged while this flag is set."
Sorry to be so fussy about grammar and the like, but I'd just like the
comments which land in the code to be easily and clearly understandable...
But just nit picking, so:
Reviewed-by: Max Reitz <address@hidden>
signature.asc
Description: OpenPGP digital signature
- [Qemu-block] [PATCH v20 28/30] qcow2: add .bdrv_remove_persistent_dirty_bitmap, (continued)
- [Qemu-block] [PATCH v20 28/30] qcow2: add .bdrv_remove_persistent_dirty_bitmap, Vladimir Sementsov-Ogievskiy, 2017/06/02
- [Qemu-block] [PATCH v20 29/30] qmp: block-dirty-bitmap-remove: remove persistent, Vladimir Sementsov-Ogievskiy, 2017/06/02
- [Qemu-block] [PATCH v20 07/30] qcow2-refcount: rename inc_refcounts() and make it public, Vladimir Sementsov-Ogievskiy, 2017/06/02
- [Qemu-block] [PATCH v20 21/30] block: add bdrv_can_store_new_dirty_bitmap, Vladimir Sementsov-Ogievskiy, 2017/06/02
- [Qemu-block] [PATCH v20 27/30] block/dirty-bitmap: add bdrv_remove_persistent_dirty_bitmap, Vladimir Sementsov-Ogievskiy, 2017/06/02
- [Qemu-block] [PATCH v20 22/30] qcow2: add .bdrv_can_store_new_dirty_bitmap, Vladimir Sementsov-Ogievskiy, 2017/06/02
- [Qemu-block] [PATCH v20 02/30] specs/qcow2: do not use wording 'bitmap header', Vladimir Sementsov-Ogievskiy, 2017/06/02
- [Qemu-block] [PATCH v20 10/30] block/dirty-bitmap: add readonly field to BdrvDirtyBitmap, Vladimir Sementsov-Ogievskiy, 2017/06/02
- [Qemu-block] [PATCH v20 08/30] qcow2: add bitmaps extension, Vladimir Sementsov-Ogievskiy, 2017/06/02
- [Qemu-block] [PATCH v20 17/30] block: introduce persistent dirty bitmaps, Vladimir Sementsov-Ogievskiy, 2017/06/02
- [Qemu-block] [PATCH v20 30/30] block: release persistent bitmaps on inactivate, Vladimir Sementsov-Ogievskiy, 2017/06/02
- [Qemu-block] [PATCH v20 03/30] hbitmap: improve dirty iter, Vladimir Sementsov-Ogievskiy, 2017/06/02
- [Qemu-block] [PATCH v20 26/30] iotests: test qcow2 persistent dirty bitmap, Vladimir Sementsov-Ogievskiy, 2017/06/02
- [Qemu-block] [PATCH v20 09/30] block/dirty-bitmap: fix comment for BlockDirtyBitmap.disabled field, Vladimir Sementsov-Ogievskiy, 2017/06/02
- [Qemu-block] [PATCH v20 20/30] qcow2: store bitmaps on reopening image as read-only, Vladimir Sementsov-Ogievskiy, 2017/06/02