From: Max Reitz <mreitz@redhat.com>
To: Eric Blake <eblake@redhat.com>, qemu-devel@nongnu.org
Cc: kwolf@redhat.com,
Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
John Snow <jsnow@redhat.com>,
qemu-block@nongnu.org
Subject: Re: [PATCH v3 3/9] block: Make it easier to learn which BDS support bitmaps
Date: Tue, 12 May 2020 08:19:41 +0200 [thread overview]
Message-ID: <b9d8e2bd-6f53-51dd-b529-4c0fefd7a310@redhat.com> (raw)
In-Reply-To: <b6c61cc5-8a7c-ef2c-76f1-def580827e14@redhat.com>
[-- Attachment #1.1: Type: text/plain, Size: 4465 bytes --]
On 11.05.20 20:16, Eric Blake wrote:
> On 5/11/20 4:21 AM, Max Reitz wrote:
>> On 08.05.20 20:03, Eric Blake wrote:
>>> Upcoming patches will enhance bitmap support in qemu-img, but in doing
>>> so, it turns out to be nice to suppress output when bitmaps make no
>>> sense (such as on a qcow2 v2 image). Add a hook to make this easier
>>> to query.
>>>
>>> In the future, when we improve the ability to look up bitmaps through
>>> a filter, we will probably also want to teach the block layer to
>>> automatically let filters pass this request on through.
>>>
>>> Signed-off-by: Eric Blake <eblake@redhat.com>
>>> ---
>>> block/qcow2.h | 1 +
>>> include/block/block_int.h | 1 +
>>> include/block/dirty-bitmap.h | 1 +
>>> block/dirty-bitmap.c | 9 +++++++++
>>> block/qcow2-bitmap.c | 7 +++++++
>>> block/qcow2.c | 1 +
>>> 6 files changed, 20 insertions(+)
>>>
>>> diff --git a/block/qcow2.h b/block/qcow2.h
>>> index f4de0a27d5c3..fb2b2b5a7b4d 100644
>>> --- a/block/qcow2.h
>>> +++ b/block/qcow2.h
>>> @@ -764,6 +764,7 @@ bool
>>> qcow2_co_can_store_new_dirty_bitmap(BlockDriverState *bs,
>>> int qcow2_co_remove_persistent_dirty_bitmap(BlockDriverState *bs,
>>> const char *name,
>>> Error **errp);
>>> +bool qcow2_dirty_bitmap_supported(BlockDriverState *bs);
>>>
>>> ssize_t coroutine_fn
>>> qcow2_co_compress(BlockDriverState *bs, void *dest, size_t dest_size,
>>> diff --git a/include/block/block_int.h b/include/block/block_int.h
>>> index df6d0273d679..cb1082da4c43 100644
>>> --- a/include/block/block_int.h
>>> +++ b/include/block/block_int.h
>>> @@ -560,6 +560,7 @@ struct BlockDriver {
>>> uint64_t parent_perm, uint64_t
>>> parent_shared,
>>> uint64_t *nperm, uint64_t *nshared);
>>>
>>> + bool (*bdrv_dirty_bitmap_supported)(BlockDriverState *bs);
>>
>> All BDSs support bitmaps, but only some support persistent dirty
>> bitmaps, so I think the name should reflect that.
>
> How about .bdrv_dirty_bitmap_supports_persistent?
Sure. Or .bdrv_supports_persistent_dirty_bitmaps. Or
.bdrv_persistent_dirty_bitmaps_supported. You decide what sounds best. :)
>> Conceptually, this looks reasonable. This information might indeed be
>> nice to have, and I’m not sure whether we should extend any existing
>> interface to return it.
>>
>> (The interfaces that come to my mind are:
>> (1) bdrv_can_store_new_dirty_bitmap() below, which we could make accept
>> a NULL @name to return basically the same information. But it’s still a
>> bit different, because I’d expect that function to return whether any
>> bitmap can be stored then, not whether the node supports bitmaps at all.
>> So e.g. if there are already too many bitmaps, it should return false,
>> even though the node itself does support bitmaps.
>
> [which reminds me - a while ago, we had patches for qcow2 handling with
> 64k bitmaps, or whatever insane number it took to overflow data
> structures, and I don't know if those ever got applied...]
I think that was a1db8733d28. As far as I remember I just didn’t merge
the test, because it took like five minutes to run.
>> (2) bdrv_get_info()/BlockDriverInfo: This information would fit in very
>> nicely here, but do we have to put it here just because it does? I
>> don’t think so. This patch adds 20 lines of code, that shows that it’s
>> very simple to add a dedicated method, and it’s certainly a bit easier
>> to use than to invoke bdrv_get_info() and throw away all the other
>> information. Perhaps this patch only shows that BlockDriverInfo doesn’t
>> make much sense in the first place, and most of its fields should have
>> been scalar return values from dedicated functions.)
>
> Indeed, you (re-)discovered some of the very reasons why I chose to make
> a new interface. I could tweak the commit message to mention
> alternatives, if that would help.
I suppose it wouldn’t help me, but it can’t harm either. So if it isn’t
too difficult, why not.
Max
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2020-05-12 6:20 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-08 18:03 [PATCH v3 0/9] qemu-img: Add convert --bitmaps Eric Blake
2020-05-08 18:03 ` [PATCH v3 1/9] docs: Sort sections on qemu-img subcommand parameters Eric Blake
2020-05-08 18:03 ` [PATCH v3 2/9] qemu-img: Fix stale comments on doc location Eric Blake
2020-05-11 9:05 ` Max Reitz
2020-05-08 18:03 ` [PATCH v3 3/9] block: Make it easier to learn which BDS support bitmaps Eric Blake
2020-05-11 9:21 ` Max Reitz
2020-05-11 18:16 ` Eric Blake
2020-05-11 21:21 ` Eric Blake
2020-05-12 6:19 ` Max Reitz [this message]
2020-05-08 18:03 ` [PATCH v3 4/9] blockdev: Promote several bitmap functions to non-static Eric Blake
2020-05-11 9:48 ` Max Reitz
2020-05-08 18:03 ` [PATCH v3 5/9] blockdev: Split off basic bitmap operations for qemu-img Eric Blake
2020-05-11 10:17 ` Max Reitz
2020-05-08 18:03 ` [PATCH v3 6/9] qemu-img: Add bitmap sub-command Eric Blake
2020-05-11 11:10 ` Max Reitz
2020-05-11 18:22 ` Eric Blake
2020-05-12 6:46 ` Max Reitz
2020-05-08 18:03 ` [PATCH v3 7/9] qcow2: Expose bitmaps' size during measure Eric Blake
2020-05-11 11:50 ` Max Reitz
2020-05-11 18:29 ` Eric Blake
2020-05-12 10:17 ` Nir Soffer
2020-05-12 11:10 ` Max Reitz
2020-05-12 19:39 ` Eric Blake
2020-05-12 20:35 ` Nir Soffer
2020-05-12 21:04 ` Eric Blake
2020-05-13 8:53 ` Max Reitz
2020-05-08 18:03 ` [PATCH v3 8/9] qemu-img: Add convert --bitmaps option Eric Blake
2020-05-11 11:58 ` Max Reitz
2020-05-08 18:03 ` [PATCH v3 9/9] iotests: Add test 291 to for qemu-img bitmap coverage Eric Blake
2020-05-11 12:03 ` Max Reitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b9d8e2bd-6f53-51dd-b529-4c0fefd7a310@redhat.com \
--to=mreitz@redhat.com \
--cc=eblake@redhat.com \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).