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 <mre...@redhat.com> > Reviewed-by: Eric Blake <ebl...@redhat.com> > --- > 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 <stefa...@redhat.com>
pgp_tLPuAvETW.pgp
Description: PGP signature