Am 23.09.2025 um 20:09 hat Eric Blake geschrieben:
> On Tue, Sep 23, 2025 at 06:37:35PM +0200, Kevin Wolf wrote:
> > Add a new --limits option to 'qemu-img info' that displays the block
> > limits for the image and all of its children, making the information
> > more accessible for human users than in QMP. This option is not enabled
> > by default because it can be a lot of output that isn't usually relevant
> > if you're not specifically trying to diagnose some I/O problem.
> > 
> > This makes the same information automatically also available in HMP
> > 'info block -v'.
> > 
> > Signed-off-by: Kevin Wolf <kw...@redhat.com>
> > ---
> >  docs/tools/qemu-img.rst |  6 +++++-
> >  include/block/qapi.h    |  2 +-
> >  block/qapi.c            | 34 ++++++++++++++++++++++++++++++++--
> >  qemu-img.c              | 15 ++++++++++++---
> >  qemu-img-cmds.hx        |  4 ++--
> >  5 files changed, 52 insertions(+), 9 deletions(-)
> > 
> 
> > +++ b/qemu-img.c
> 
> > @@ -3119,6 +3123,8 @@ static int img_info(const img_cmd_t *ccmd, int argc, 
> > char **argv)
> >  "     display information about the backing chain for copy-on-write 
> > overlays\n"
> >  "  -U, --force-share\n"
> >  "     open image in shared mode for concurrent access\n"
> > +"  --limits\n"
> > +"     show detected block limits (may depend on options, e.g. cache 
> > mode)\n"
> 
> I'm trying to figure out how the parenthetical helps the --help
> message.  The fact that it is detected limits already implies that
> anything else (like cache mode) that can change what gets detected
> would have an impact.  So I think it would be fine to just use " show
> detected block limits\n".

Yes, other options can influence the limits, too. I just thought that
the most common pitfall for users will be that they actually want to
know the limits for cache=none because that's what their VM uses, but
'qemu-img info' returns them for cache=writeback. So it felt helpful to
add the note. But if you think that we'd better leave it out, I can
remove it.

Actually, this reminds me that I wanted to add a -t <cache_mode> option
to 'qemu-img info', too, so that you can actually get the interesting
information without using --image-opts. That will be something for a
separate patch, though.

Kevin


Reply via email to