diff mbox

[v2,3/3] docs/qcow2: Limit refcount_order to [0, 6]

Message ID 1409696709-27623-4-git-send-email-mreitz@redhat.com
State New
Headers show

Commit Message

Max Reitz Sept. 2, 2014, 10:25 p.m. UTC
Specify the upper limit of refcount_order to be 6 (that is,
refcount_bits = 64). Any larger value does not make much sense when all
offsets, sizes, cluster counts etc. "only" have a width of 64 bit as
well, and very large values would be very difficult to support.
Therefore, just cap it at the largest reasonable value.

Suggested-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 docs/specs/qcow2.txt | 1 +
 1 file changed, 1 insertion(+)

Comments

Eric Blake Sept. 2, 2014, 10:30 p.m. UTC | #1
On 09/02/2014 04:25 PM, Max Reitz wrote:
> Specify the upper limit of refcount_order to be 6 (that is,
> refcount_bits = 64). Any larger value does not make much sense when all
> offsets, sizes, cluster counts etc. "only" have a width of 64 bit as
> well, and very large values would be very difficult to support.
> Therefore, just cap it at the largest reasonable value.
> 
> Suggested-by: Eric Blake <eblake@redhat.com>
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
>  docs/specs/qcow2.txt | 1 +
>  1 file changed, 1 insertion(+)

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

> 
> diff --git a/docs/specs/qcow2.txt b/docs/specs/qcow2.txt
> index 0a878aa..121dfc8 100644
> --- a/docs/specs/qcow2.txt
> +++ b/docs/specs/qcow2.txt
> @@ -110,6 +110,7 @@ in the description of a field.
>                      in bits: refcount_bits = 1 << refcount_order). For version 2
>                      images, the order is always assumed to be 4
>                      (i.e. refcount_bits = 16).
> +                    This value may not exceed 6 (i.e. refcount_bits = 64).
>  
>          100 - 103:  header_length
>                      Length of the header structure in bytes. For version 2
>
Stefan Hajnoczi Sept. 3, 2014, 1:51 p.m. UTC | #2
On Wed, Sep 03, 2014 at 12:25:09AM +0200, Max Reitz wrote:
> Specify the upper limit of refcount_order to be 6 (that is,
> refcount_bits = 64). Any larger value does not make much sense when all
> offsets, sizes, cluster counts etc. "only" have a width of 64 bit as
> well, and very large values would be very difficult to support.
> Therefore, just cap it at the largest reasonable value.
> 
> Suggested-by: Eric Blake <eblake@redhat.com>
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
>  docs/specs/qcow2.txt | 1 +
>  1 file changed, 1 insertion(+)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
diff mbox

Patch

diff --git a/docs/specs/qcow2.txt b/docs/specs/qcow2.txt
index 0a878aa..121dfc8 100644
--- a/docs/specs/qcow2.txt
+++ b/docs/specs/qcow2.txt
@@ -110,6 +110,7 @@  in the description of a field.
                     in bits: refcount_bits = 1 << refcount_order). For version 2
                     images, the order is always assumed to be 4
                     (i.e. refcount_bits = 16).
+                    This value may not exceed 6 (i.e. refcount_bits = 64).
 
         100 - 103:  header_length
                     Length of the header structure in bytes. For version 2