From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55046) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xmj9U-0008Ml-On for qemu-devel@nongnu.org; Fri, 07 Nov 2014 08:00:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xmj9P-0007lQ-Gh for qemu-devel@nongnu.org; Fri, 07 Nov 2014 08:00:32 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50366) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xmj9O-0007lJ-Oe for qemu-devel@nongnu.org; Fri, 07 Nov 2014 08:00:27 -0500 Message-ID: <545CC25E.5090405@redhat.com> Date: Fri, 07 Nov 2014 14:00:14 +0100 From: Eric Blake MIME-Version: 1.0 References: <1414639364-4499-1-git-send-email-famz@redhat.com> <1414639364-4499-3-git-send-email-famz@redhat.com> In-Reply-To: <1414639364-4499-3-git-send-email-famz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="qEkFJaU6jr3lKL5oSUr70JvCdwEeRv9Ib" Subject: Re: [Qemu-devel] [PATCH v6 02/10] qmp: Add block-dirty-bitmap-add and block-dirty-bitmap-remove List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , qemu-devel@nongnu.org Cc: Kevin Wolf , Benoit Canet , John Snow , Markus Armbruster , Max Reitz , Stefan Hajnoczi , Jd , Paolo Bonzini , Luiz Capitulino , Vladimir Sementsov-Ogievskij This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --qEkFJaU6jr3lKL5oSUr70JvCdwEeRv9Ib Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/30/2014 04:22 AM, Fam Zheng wrote: > The new command pair is added to manage user created dirty bitmap. The > dirty bitmap's name is mandatory and must be unique for the same device= , > but different devices can have bitmaps with the same names. >=20 > Signed-off-by: Fam Zheng > --- > blockdev.c | 55 ++++++++++++++++++++++++++++++++++++++++++++= ++++++++ > qapi/block-core.json | 55 ++++++++++++++++++++++++++++++++++++++++++++= ++++++++ > qmp-commands.hx | 49 ++++++++++++++++++++++++++++++++++++++++++++= ++ > 3 files changed, 159 insertions(+) >=20 > + if (has_granularity) { > + if (granularity < 512 || is_power_of_2(granularity)) { > + error_setg(errp, "Granularity must be power of 2 " > + "and greater than 512"); Assuming you fix the logic of the condition, the error message is still wrong (you allow 512, not just greater than 512). > +++ b/qapi/block-core.json > @@ -865,6 +865,61 @@ > '*on-target-error': 'BlockdevOnError' } } > =20 > ## > +# @BlockDirtyBitmap > +# > +# @device: name of device which the bitmap is tracking > +# > +# @name: name of the dirty bitmap > +# > +# Since 2.3 > +## > +{ 'type': 'BlockDirtyBitmap', > + 'data': { 'device': 'str', 'name': 'str' } } > + > +## > +# @BlockDirtyBitmapAdd > +# > +# @device: name of device which the bitmap is tracking > +# > +# @name: name of the dirty bitmap > +# > +# @granularity: #optional the bitmap granularity, default is 64k for > +# block-dirty-bitmap-add Do you still need to call out the command, given that it is the only client of this type? > +# > +# Since 2.3 > +## > +{ 'type': 'BlockDirtyBitmapAdd', > + 'data': { 'device': 'str', 'name': 'str', '*granularity': 'int' } } Is it worth using type inheritance, as in: { 'type': 'BlockDirtyBitmapAdd', 'base': 'BlockDirtyBitmap', 'data': { '*granularity': 'int' } } > + > +## > +# @block-dirty-bitmap-add > +# > +# Create a dirty bitmap with a name on the device > +# > +# Returns: nothing on success > +# If @device is not a valid block device, DeviceNotFound > +# If @name is already taken, GenericError with an explaining = message s/explaining message/explanation/ (or even ditch the error mentions; fewer commands are bothering with it these days) > + > +block-dirty-bitmap-add > +---------------- Pad out the --- to the length of the command name. > + > +Create a dirty bitmap with a name on the device, and start tracking th= e writes. > + > +Arguments: > + > +- "device": device name to create dirty bitmap (json-string) > +- "name": name of the new dirty bitmap (json-string) > +- "granularity": granularity to track writes with. (int) Inconsistent on whether you use trailing '.' > + > +Example: > + > +-> { "execute": "block-dirty-bitmap-add", "arguments": { "device": "dr= ive0", > + "name": "bitmap0" }= } > +<- { "return": {} } > + > +block-dirty-bitmap-remove > +---------------- Pad out the --- --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --qEkFJaU6jr3lKL5oSUr70JvCdwEeRv9Ib Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg iQEcBAEBCAAGBQJUXMJeAAoJEKeha0olJ0NqdlEH/jFv8rWAoMqrA5ZEWoxuvYQm chMlrWTZJqtfCDs+1za3nUAbCRCde0z8lqI6cRaWEMBqccN0TfYvR2CxvBPoXaa/ XKFE2ZP8fWXyiaIM5TNG7JpNn3/XjXY0uLXs9DnjIchp+4VZn6ZjxwA/vhu1voKp cdKHa0yEB0aH5Yu0E4CGgXzNIKz5zeo4IcJuv+Mj3Mf86cjTm1KbU/CdpJLZ6AZk 0Qf41YN7z8ZkG5QwCunDv5vSNmJu7PqgnREcJAIeDbzUrJg18mYxK0oVeLwSh1wE mEKiGPWO3LppjGHbBOFt2IKBzPloBgcqErKGToqecGY4R6SWD07l/Ig5ko9xN50= =4Qsn -----END PGP SIGNATURE----- --qEkFJaU6jr3lKL5oSUr70JvCdwEeRv9Ib--