qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 03/22] qcow2: Use 64 bits for refcount values


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH v3 03/22] qcow2: Use 64 bits for refcount values
Date: Thu, 27 Nov 2014 13:49:53 +0000
User-agent: Mutt/1.5.23 (2014-03-12)

On Thu, Nov 20, 2014 at 06:06:19PM +0100, Max Reitz wrote:
> Refcounts may have a width of up to 64 bits, so qemu should use the same
> width to represent refcount values internally.
> 
> Since for instance qcow2_get_refcount() signals an error by returning a
> negative value, refcount values are generally signed to be able to
> represent those error values correctly. This limits the maximum refcount
> value supported by qemu to INT64_MAX (= 63 bits), as established in
> "qcow2: Add two new fields to BDRVQcowState".
> 
> This limitation should have no implications in practice for normal valid
> images. If the MSb in a 64 bit refcount value is set, we can safely
> assume the value to be invalid (because reaching such high refcounts is
> impossible due to other limitations of the qcow2 format).
> 
> Signed-off-by: Max Reitz <address@hidden>
> Reviewed-by: Eric Blake <address@hidden>
> ---
>  block/qcow2-cluster.c  |  9 ++++++---
>  block/qcow2-refcount.c | 37 ++++++++++++++++++++-----------------
>  block/qcow2.h          |  7 ++++---
>  3 files changed, 30 insertions(+), 23 deletions(-)

Reviewed-by: Stefan Hajnoczi <address@hidden>

Attachment: pgp07TDJp5C2y.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]