From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58372) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YpMCr-0003nP-Qw for qemu-devel@nongnu.org; Mon, 04 May 2015 15:39:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YpMCo-0002TQ-G0 for qemu-devel@nongnu.org; Mon, 04 May 2015 15:39:09 -0400 Message-ID: <5547CAD7.6070408@redhat.com> Date: Mon, 04 May 2015 13:39:03 -0600 From: Eric Blake MIME-Version: 1.0 References: <1430766953-6913-1-git-send-email-mreitz@redhat.com> <1430766953-6913-17-git-send-email-mreitz@redhat.com> In-Reply-To: <1430766953-6913-17-git-send-email-mreitz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6Lx1AsICMNAJPFrVKjbkQ8V6xV21BpVbJ" Subject: Re: [Qemu-devel] [PATCH v4 16/17] qapi: Expose new qcow2 overlap check options List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-block@nongnu.org Cc: Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --6Lx1AsICMNAJPFrVKjbkQ8V6xV21BpVbJ Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/04/2015 01:15 PM, Max Reitz wrote: > Expose the two new options for controlling the memory usage of the > overlap check implementation via QAPI. >=20 > Signed-off-by: Max Reitz > --- > qapi/block-core.json | 37 +++++++++++++++++++++++++++++++++++++ > 1 file changed, 37 insertions(+) >=20 > diff --git a/qapi/block-core.json b/qapi/block-core.json > index 1c17224..99456e6 100644 > --- a/qapi/block-core.json > +++ b/qapi/block-core.json > @@ -1509,6 +1509,39 @@ > 'mode': 'Qcow2OverlapCheckMode' } } > =20 > ## > +# @Qcow2OverlapStructures > +# > +# Contains options for controlling the behavior of the metadata overla= p > +# prevention structures. > +# > +# The primary structure used for overlap check and prevention is a bit= map > +# (actually a bytemap) which has one entry per cluster designating the= type(s) > +# of metadata it contains. In order to save memory, there is an RLE-li= ke > +# representation of this bitmap, too. > +# > +# The whole array of clusters is chunked. The RLE representation of on= e chunk > +# is converted to the equivalent bitmap whenever a cluster in the chun= k is > +# accessed. The bitmaps are kept for a limited number of chunks (as a = cache). On > +# cache eviction, the bitmap is converted back to RLE again. Feels a bit verbose at describing the internal representation, especially if we change the internals at some point in the future. I'm more interested that there are two limits at play, and that tuning them larger may consume more memory but offer better protection on large image= s. > +# > +# @bitmap-size: #optional size (in bytes) of the bitmap cache, de= faults to > +# 64 kB > +# Any requirement on it being a power of 2, or even a recommendation on how large or small to make it in relation to an image size? > +# @total-size-limit: #optional maximum total size (in bytes) of all th= e metadata What happens if bitmap-size is larger than total-size-limit? > +# overlap prevention data structures combined; if t= his limit > +# is exceeded, a QCOW2_OVERLAP_CHECK_MEMORY_LIMIT_R= EACHED > +# event will be emitted and some parts of the image= may no > +# longer be protected against erroneous overwriting= of > +# metadata by (meta)data of a different kind. Defau= lts to > +# SIZE_MAX. > +# > +# Since: 2.4 > +## > +{ 'type': 'Qcow2OverlapStructures', Rebase conflict with my series that does s/type/struct/ > + 'data': { '*bitmap-size': 'int', > + '*total-size-limit': 'int' } } > + > +## > # @BlockdevOptionsQcow2 > # > # Driver specific block device options for qcow2. > @@ -1530,6 +1563,9 @@ > # @overlap-check: #optional which overlap checks to perform fo= r writes > # to the image, defaults to 'cached' (since 2.= 2) > # > +# @overlap-structures: #optional options for controlling the behavi= or of the > +# metadata overlap prevention structures (sinc= e 2.4) > +# > # @cache-size: #optional the maximum total size of the L2 t= able and > # refcount block caches in bytes (since 2.2) > # > @@ -1548,6 +1584,7 @@ > '*pass-discard-snapshot': 'bool', > '*pass-discard-other': 'bool', > '*overlap-check': 'Qcow2OverlapChecks', > + '*overlap-structures': 'Qcow2OverlapStructures', > '*cache-size': 'int', > '*l2-cache-size': 'int', > '*refcount-cache-size': 'int' } } >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --6Lx1AsICMNAJPFrVKjbkQ8V6xV21BpVbJ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVR8rXAAoJEKeha0olJ0NqJeMH/j+j1msnME1cg2iusIOmbxBQ ha3fxEybNlEe1ihvxGRsGppcfcdUDTPOmc9Es5SraQbeRW8dNFuAvLtcCzixvp/y 55o8IMRbx2NycIFgwIIh7imqD3Sx8WsfGVeAs+xkhh6czQuLabzpSW/H7LBH+m+d qG5//7npC0Ij3Aln+JjBmYRbXU7Jf5I2plVeK0OP6KrIYPKQwn8JSapmsL01DjlE smb/H1hy4edHPMhqo6Wec+L/9dUppcgnd/lkIqw0xWVAyH7FNujqmuCDftE+lJKp VsHmMEkzZTzpkU9eIkDSbpD8CKm+pJPlBCdT9xWlwzkrtgoLOjuD5PCLVDXt+oY= =Tu1u -----END PGP SIGNATURE----- --6Lx1AsICMNAJPFrVKjbkQ8V6xV21BpVbJ--