From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51714) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3TAv-0007Mt-QG for qemu-devel@nongnu.org; Mon, 30 Nov 2015 13:27:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3TAs-0007wA-Ih for qemu-devel@nongnu.org; Mon, 30 Nov 2015 13:27:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52047) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3TAs-0007w6-BU for qemu-devel@nongnu.org; Mon, 30 Nov 2015 13:27:42 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id EF0F0C0D223B for ; Mon, 30 Nov 2015 18:27:41 +0000 (UTC) References: <1448592497-2462-1-git-send-email-peterx@redhat.com> <1448592497-2462-6-git-send-email-peterx@redhat.com> From: Eric Blake Message-ID: <565C9517.5070700@redhat.com> Date: Mon, 30 Nov 2015 11:27:35 -0700 MIME-Version: 1.0 In-Reply-To: <1448592497-2462-6-git-send-email-peterx@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ncs8vG8FWLKxdQalv0dwJ8VpCmpL8xoWp" Subject: Re: [Qemu-devel] [PATCH v2 5/8] dump-query: add "dump-query" command to query dump status List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Xu , qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ncs8vG8FWLKxdQalv0dwJ8VpCmpL8xoWp Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/26/2015 07:48 PM, Peter Xu wrote: > This patch is only adding the QMP/HMP interface for "dump-query" > command, but not implementing them. This command could be used to > query background dump status. Please refer to the next patch to see > how dump status are defined. >=20 > Currently, only fake results are returned. Feels a bit awkward to return fake results; maybe you should squash some patches together or fail with an error instead of returning fake results.= >=20 > Signed-off-by: Peter Xu > --- > dump.c | 9 +++++++++ > hmp-commands.hx | 15 +++++++++++++++ > hmp.c | 6 ++++++ > hmp.h | 1 + > qapi-schema.json | 21 +++++++++++++++++++++ > qmp-commands.hx | 29 ++++++++++++++++++++++++++++- > 6 files changed, 80 insertions(+), 1 deletion(-) >=20 > +++ b/qapi-schema.json > @@ -2139,6 +2139,27 @@ > '*format': 'DumpGuestMemoryFormat'} } > =20 > ## > +# @DumpStatus > +# > +# Status for the last guest memory dump. > +# Missing documentation for 'status' and 'percentage' fields. > +# Since: 2.6 > +## > +{ 'struct': 'DumpStatus', > + 'data': { 'status': 'str', 'percentage': 'str' } } What values will 'status' contain? If it is a finite set of status strings, then it should be an enum type. 'percentage' should NOT be a string. It should probably be numeric; 'number' if you intend to return a floating point value between 0 and 1. Or, like other interfaces, you should probably return two numbers (current and total, both 'int'), and let the caller compute percentage themselves. > + > +## > +# @dump-query Most query commands are named 'query-FOO', not 'FOO-query'. Unless you have a compelling reason otherwise, this should be 'query-dump'. > +# > +# Query latest dump status. > +# > +# Returns: A @DumpStatus object showing the dump status. > +# > +# Since: 2.6 > +## > +{ 'command': 'dump-query', 'returns': 'DumpStatus' } > + > +SQMP > +dump-query > +---------- > + > +Query background dump status. > + > +Arguments: None. > + > +Example: > + > +-> { "execute": "dump-query" } > +<- { "return": {"status": "IN_PROGRESS", "percentage": "85%" } } ALL_CAPS status is annoying to read; if you add an enum type, it should be 'lower-case' values. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --ncs8vG8FWLKxdQalv0dwJ8VpCmpL8xoWp 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/ iQEcBAEBCAAGBQJWXJUXAAoJEKeha0olJ0Nq7JsIAJxZ+mCtcGI/C34zrOFbS1k6 atF6eRj3hqUofe3w9VKuU9qTXIvyBpgCL2LZ/KNOkP1LTbctcUJi1r6dGoVEHTZb A3vTdMNT1ZcO1bGm5Q3mg0W3Bo3giwu5qc7AO+RYkT1sNZ31CKsFtIvk09NKPgfu PfL6PZvfpBMw5TPQORc0VtKyzMbKSLp1D4tuIy7gPoHqRkjmuZp72p9KJ85Ju683 eYavTlLGUgodcLMOiV7wniPv6m1tDbL4jZrrKAyaDb7/FeBVKbNYYnheWNgWr8rV HpuwECCrGhNfHL/s638kVqMfgsKuHivduAp2TdZYhtipwySrHICi2Bed8CDT1AQ= =B44p -----END PGP SIGNATURE----- --ncs8vG8FWLKxdQalv0dwJ8VpCmpL8xoWp--