[PATCH v2 3/3] qcow2: Tweak comment about bitmaps vs. resize

Eric Blake posted 3 patches 5 years, 9 months ago
Maintainers: Stefan Hajnoczi <stefanha@redhat.com>, Stefan Weil <sw@weilnetz.de>, Kevin Wolf <kwolf@redhat.com>, "Denis V. Lunev" <den@openvz.org>, Liu Yuan <namei.unix@gmail.com>, John Snow <jsnow@redhat.com>, Fam Zheng <fam@euphon.net>, Markus Armbruster <armbru@redhat.com>, Max Reitz <mreitz@redhat.com>, Jeff Cody <codyprime@gmail.com>
[PATCH v2 3/3] qcow2: Tweak comment about bitmaps vs. resize
Posted by Eric Blake 5 years, 9 months ago
Our comment did not actually match the code.  Rewrite the comment to
be less sensitive to any future changes to qcow2-bitmap.c that might
implement scenarios that we currently reject.

Signed-off-by: Eric Blake <eblake@redhat.com>
---
 block/qcow2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/qcow2.c b/block/qcow2.c
index 34888a793354..6b6d1c3fa8b9 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -3997,7 +3997,7 @@ static int coroutine_fn qcow2_co_truncate(BlockDriverState *bs, int64_t offset,
         goto fail;
     }

-    /* cannot proceed if image has bitmaps */
+    /* See qcow2-bitmap.c for which bitmap scenarios prevent a resize. */
     if (qcow2_truncate_bitmaps_check(bs, errp)) {
         ret = -ENOTSUP;
         goto fail;
-- 
2.26.2


Re: [PATCH v2 3/3] qcow2: Tweak comment about bitmaps vs. resize
Posted by Max Reitz 5 years, 9 months ago
On 24.04.20 00:17, Eric Blake wrote:
> Our comment did not actually match the code.  Rewrite the comment to
> be less sensitive to any future changes to qcow2-bitmap.c that might
> implement scenarios that we currently reject.
> 
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---
>  block/qcow2.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/block/qcow2.c b/block/qcow2.c
> index 34888a793354..6b6d1c3fa8b9 100644
> --- a/block/qcow2.c
> +++ b/block/qcow2.c
> @@ -3997,7 +3997,7 @@ static int coroutine_fn qcow2_co_truncate(BlockDriverState *bs, int64_t offset,
>          goto fail;
>      }
> 
> -    /* cannot proceed if image has bitmaps */
> +    /* See qcow2-bitmap.c for which bitmap scenarios prevent a resize. */

Clever. ;)

Reviewed-by: Max Reitz <mreitz@redhat.com>

>      if (qcow2_truncate_bitmaps_check(bs, errp)) {
>          ret = -ENOTSUP;
>          goto fail;
>