From: <wang.guang55@zte.com.cn>
To: kwolf@redhat.com, mreitz@redhat.com
Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org, wang.yong155@zte.com.cn
Subject: [Qemu-devel] about qemu-img info on block dev
Date: Tue, 7 Nov 2017 15:18:03 +0800 (CST) [thread overview]
Message-ID: <201711071518033155528@zte.com.cn> (raw)
hello
if we create a qcow2 file on a block dev.
we can,t get the right disk size by qemu-img info。
[root@host-120-79 qemu]# ./qemu-img create -f qcow2 /dev/zs/lvol0 1G
Formatting '/dev/zs/lvol0', fmt=qcow2 size=1073741824 cluster_size=65536 lazy_refcounts=off refcount_bits=16
[root@host-120-79 qemu]# ./qemu-img info /dev/zs/lvol0
image: /dev/zs/lvol0
file format: qcow2
virtual size: 1.0G (1073741824 bytes)
disk size: 0
cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: false
refcount bits: 16
corrupt: false
Then we get disk size from L1 table and L2 table in qcow2_get_allocated_file_size.
May be we can submit the patch to qemu master??
next reply other threads:[~2017-11-07 7:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-07 7:18 wang.guang55 [this message]
2017-11-07 9:15 ` [Qemu-devel] about qemu-img info on block dev Kevin Wolf
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=201711071518033155528@zte.com.cn \
--to=wang.guang55@zte.com.cn \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=wang.yong155@zte.com.cn \
/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).