From: Hanna Reitz <hreitz@redhat.com>
To: qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, Hanna Reitz <hreitz@redhat.com>,
Kevin Wolf <kwolf@redhat.com>,
Markus Armbruster <armbru@redhat.com>,
Eric Blake <eblake@redhat.com>
Subject: [PATCH 0/4] block/file: Show extent size in qemu-img info
Date: Tue, 3 May 2022 16:55:25 +0200 [thread overview]
Message-ID: <20220503145529.37070-1-hreitz@redhat.com> (raw)
Hi,
This series makes qemu-img info print the extent size of an image file
(if available). To do so, we have to do a couple of things:
1. Add a .bdrv_get_specific_info handler to the file-posix driver
(patch 4)
2. Have bdrv_query_image_info() collect this driver-specific info not
only on the format level, but also on the protocol level (if there is
an unambiguous node) so we actually get the information from the
file-posix node when querying whatever format node is on top
(patch 2)
3. Have bdrv_image_info_dump() print this protocol-level information
(patch 3)
Extent size informations seems unavailable on ext4 at least, so if we
did just this, you would see the following for an image on ext4:
```
$ qemu-img info -f raw test.img
image: test.img
file format: raw
virtual size: 1 MiB (1048576 bytes)
disk size: 4 KiB
Protocol specific information:
```
That last part looks a bit strange -- it's a heading without a section.
So patch 1 makes bdrv_image_info_specific_dump() omit that heading if
there is no information that can be printed.
Hanna Reitz (4):
block: Improve empty format-specific info dump
block: Add protocol-specific image info
block: Print protocol-specific information
block/file: Add file-specific image info
qapi/block-core.json | 32 ++++++++++++++++++++--
include/block/qapi.h | 3 +-
block/file-posix.c | 30 ++++++++++++++++++++
block/qapi.c | 65 +++++++++++++++++++++++++++++++++++++++++---
qemu-io-cmds.c | 4 +--
5 files changed, 124 insertions(+), 10 deletions(-)
--
2.35.1
next reply other threads:[~2022-05-03 21:31 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-03 14:55 Hanna Reitz [this message]
2022-05-03 14:55 ` [PATCH 1/4] block: Improve empty format-specific info dump Hanna Reitz
2022-05-03 18:44 ` Eric Blake
2022-05-04 8:18 ` Kevin Wolf
2022-05-03 14:55 ` [PATCH 2/4] block: Add protocol-specific image info Hanna Reitz
2022-05-03 18:47 ` Eric Blake
2022-05-04 8:36 ` Kevin Wolf
2022-05-04 11:25 ` Hanna Reitz
2022-05-03 14:55 ` [PATCH 3/4] block: Print protocol-specific information Hanna Reitz
2022-05-03 18:48 ` Eric Blake
2022-05-03 14:55 ` [PATCH 4/4] block/file: Add file-specific image info Hanna Reitz
2022-05-03 18:50 ` Eric Blake
2022-05-04 7:10 ` Hanna Reitz
2022-05-04 8:46 ` Kevin Wolf
2022-05-04 11:26 ` Hanna 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=20220503145529.37070-1-hreitz@redhat.com \
--to=hreitz@redhat.com \
--cc=armbru@redhat.com \
--cc=eblake@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).