From: Eric Blake <eblake@redhat.com>
To: qemu-devel@nongnu.org
Cc: mgreger@cinci.rr.com, qemu-block@nongnu.org
Subject: [Qemu-devel] [PATCH] qcow2: Clarify that compressed cluster offset requires shift
Date: Mon, 29 Feb 2016 08:11:54 -0700 [thread overview]
Message-ID: <1456758714-12609-1-git-send-email-eblake@redhat.com> (raw)
The specs for the host cluster offset of a compressed cluster
were not clear that the offset is in terms of sectors, and requires
a shift by 9 to be a byte offset. Add some more text to make the
interpretation obvious.
CC: mgreger@cinci.rr.com
Signed-off-by: Eric Blake <eblake@redhat.com>
---
docs/specs/qcow2.txt | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/docs/specs/qcow2.txt b/docs/specs/qcow2.txt
index 80cdfd0..7049415 100644
--- a/docs/specs/qcow2.txt
+++ b/docs/specs/qcow2.txt
@@ -323,11 +323,16 @@ Standard Cluster Descriptor:
Compressed Clusters Descriptor (x = 62 - (cluster_bits - 8)):
- Bit 0 - x: Host cluster offset. This is usually _not_ aligned to a
- cluster boundary!
+ Bit 0 - x: Bits 9-(x+9) of host cluster offset. This is
+ usually _not_ aligned to a cluster boundary!
x+1 - 61: Compressed size of the images in sectors of 512 bytes
+The bits of the host cluster offset not specified in the cluster descriptor
+are 0 (bits 0-8 are obvious because a 512-byte sector is the smallest
+addressable unit, while bits 56-63 implies that a qcow2 file cannot exceed
+2^56 bytes in size).
+
If a cluster is unallocated, read requests shall read the data from the backing
file (except if bit 0 in the Standard Cluster Descriptor is set). If there is
no backing file or the backing file is smaller than the image, they shall read
--
2.5.0
next reply other threads:[~2016-02-29 15:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-29 15:11 Eric Blake [this message]
2016-02-29 15:42 ` [Qemu-devel] [Qemu-block] [PATCH] qcow2: Clarify that compressed cluster offset requires shift Max Reitz
2016-02-29 15:46 ` Max Reitz
2016-02-29 16:06 ` Eric Blake
2016-02-29 16:07 ` Max 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=1456758714-12609-1-git-send-email-eblake@redhat.com \
--to=eblake@redhat.com \
--cc=mgreger@cinci.rr.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).