[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] docs: clarify that qcow2 file size is not alway
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH] docs: clarify that qcow2 file size is not always a cluster multiple |
Date: |
Thu, 22 May 2014 10:52:10 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 |
On 05/22/2014 03:42 AM, Stefan Hajnoczi wrote:
> Normally one would expect that qcow2 image file lengths are multiples of
> the cluster size. This is not true in all cases and the spec should
> document this so implementers remember to accept such files.
>
> $ qemu-img create -f qcow2 foo.qcow2 2G
> Formatting 'foo.qcow2', fmt=qcow2 size=2147483648 encryption=off
> cluster_size=65536 lazy_refcounts=off
> $ ls -l foo.qcow2
> -rw-r--r-- 1 stefanha stefanha 197120 May 22 11:40 foo.qcow2
> $ bc -q
> 3 * (64 * 1024) + 512
> 197120
>
> The extra sector are the 4 L1 table entries that a 2 GB disk with 64 KB
> cluster size needs. The rest of the L1 table is omitted from the file
> but allocation will continue at the next cluster boundary.
>
> Reported-by: Maria Kustova <address@hidden>
> Signed-off-by: Stefan Hajnoczi <address@hidden>
> ---
> docs/specs/qcow2.txt | 4 ++++
> 1 file changed, 4 insertions(+)
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature