qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jean-Louis Dupond <jean-louis@dupond.be>
To: Hanna Czenczek <hreitz@redhat.com>, qemu-devel@nongnu.org
Cc: Eric Blake <eblake@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	Kevin Wolf <kwolf@redhat.com>,
	qemu-block@nongnu.org
Subject: Re: [PATCH 1/3] block: add for_commit option to measure
Date: Tue, 13 May 2025 16:10:33 +0200	[thread overview]
Message-ID: <bd78687d-2be5-4ad1-9493-2513af223f6d@dupond.be> (raw)
In-Reply-To: <a1aa1173-5362-44f6-8b64-6d44f1b5eb82@redhat.com>


On 5/12/25 13:16, Hanna Czenczek wrote:
> On 16.04.25 09:16, Jean-Louis Dupond wrote:
>> To specify we use measure call for commit size calculations, we add a
>> new 'for_commit' option to the measure call.
>> This will be used in following commit to do a different measurement.
>
> Why not allow specifying the node name (or filename) of the commit 
> target instead of this just being a boolean?
Honestly didn't even thought about that option :)
>
> (That was my main problem with the original series, that it wasn’t 
> possible to specify the commit target (in an obvious way at least). 
> I’m not a fan of deferring to JSON parameters for this, although I’m 
> aware that to specify the node name of the commit target you would 
> have to use JSON again, unless qemu-img can do some translation on 
> behalf of the user: Looking at `commit -b`, that takes a filename; it 
> could make sense to have the internal QAPI parameter use a node name, 
> and qemu-img translating the filename parameter into a node name.  
> Actually, `measure` could just accept the same `-b` option as 
> `commit`, which it would then translate into the QAPI 
> `for-commit=<node-name>` option.)
And you will need to use JSON parameters if you want to specify 
something special, like for example to note that the commit target has 
discard-no-unref enabled.
I think not many people will call the command with the for_commit 
option, but it will be (always) called from code where the JSON 
parameters give much more flexibility to add some additional options 
(like discard-no-unref).

We could of course support both (JSON + for-commit=<node-name>).
But then we will also need to validate somehow that the for-commit 
node-name is equal to the target specified in the JSON somehow.
Or have something like for-commit=true/false + json or 
for-commit-node=<node-name> if you don't use a JSON?

Do you think it's worth the effort ? :)
>
> Hanna
>
>
Thanks for the review!
Jean-Louis
>
>> Signed-off-by: Jean-Louis Dupond <jean-louis@dupond.be>
>> ---
>>   block/qcow2.c                    | 16 +++++++++++++
>>   include/block/block_int-common.h |  4 ++++
>>   qapi/block-core.json             | 28 ++++++++++++++++++++++
>>   qemu-img.c                       | 40 ++++++++++++++++++++++++++++----
>>   4 files changed, 83 insertions(+), 5 deletions(-)
>


  reply	other threads:[~2025-05-13 14:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-16  7:16 [PATCH 0/3] Add a for_commit option to qemu-img measure Jean-Louis Dupond
2025-04-16  7:16 ` [PATCH 1/3] block: add for_commit option to measure Jean-Louis Dupond
2025-05-12 11:16   ` Hanna Czenczek
2025-05-13 14:10     ` Jean-Louis Dupond [this message]
2025-08-29  9:44       ` Jean-Louis Dupond
2025-04-16  7:16 ` [PATCH 2/3] qcow2: make measure for_commit aware Jean-Louis Dupond
2025-04-16  7:16 ` [PATCH 3/3] iotests/290: add test case for for_commit measure Jean-Louis Dupond

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=bd78687d-2be5-4ad1-9493-2513af223f6d@dupond.be \
    --to=jean-louis@dupond.be \
    --cc=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=hreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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).