All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Max Reitz <mreitz@redhat.com>, qemu-devel@nongnu.org
Cc: "Kevin Wolf" <kwolf@redhat.com>,
	"Benoît Canet" <benoit.canet@nodalink.com>,
	"Stefan Hajnoczi" <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 2/3] docs/qcow2: Correct refcount_block_entries
Date: Tue, 02 Sep 2014 16:28:53 -0600	[thread overview]
Message-ID: <540644A5.8010100@redhat.com> (raw)
In-Reply-To: <1409696709-27623-3-git-send-email-mreitz@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1138 bytes --]

On 09/02/2014 04:25 PM, Max Reitz wrote:
> A refblock entry may have a different size than 16 bits, it may even be
> smaller than a byte. Correct the refcount_block_entries calculation
> accordingly.
> 
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
>  docs/specs/qcow2.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

> 
> diff --git a/docs/specs/qcow2.txt b/docs/specs/qcow2.txt
> index cfbc8b0..0a878aa 100644
> --- a/docs/specs/qcow2.txt
> +++ b/docs/specs/qcow2.txt
> @@ -183,7 +183,7 @@ blocks and are exactly one cluster in size.
>  Given a offset into the image file, the refcount of its cluster can be obtained
>  as follows:
>  
> -    refcount_block_entries = (cluster_size / sizeof(uint16_t))
> +    refcount_block_entries = (cluster_size * 8 / refcount_bits)
>  
>      refcount_block_index = (offset / cluster_size) % refcount_block_entries
>      refcount_table_index = (offset / cluster_size) / refcount_block_entries
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 539 bytes --]

  reply	other threads:[~2014-09-02 22:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-02 22:25 [Qemu-devel] [PATCH v2 0/3] qcow2: Drop REFCOUNT_SHIFT Max Reitz
2014-09-02 22:25 ` [Qemu-devel] [PATCH v2 1/3] " Max Reitz
2014-09-02 22:25 ` [Qemu-devel] [PATCH v2 2/3] docs/qcow2: Correct refcount_block_entries Max Reitz
2014-09-02 22:28   ` Eric Blake [this message]
2014-09-03 13:51   ` Stefan Hajnoczi
2014-09-02 22:25 ` [Qemu-devel] [PATCH v2 3/3] docs/qcow2: Limit refcount_order to [0, 6] Max Reitz
2014-09-02 22:30   ` Eric Blake
2014-09-03 13:51   ` Stefan Hajnoczi
2014-10-22 12:14 ` [Qemu-devel] [PATCH v2 0/3] qcow2: Drop REFCOUNT_SHIFT Kevin Wolf
2014-10-22 13:18 ` 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=540644A5.8010100@redhat.com \
    --to=eblake@redhat.com \
    --cc=benoit.canet@nodalink.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.