From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56504) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3Wkt-0001R1-Sv for qemu-devel@nongnu.org; Mon, 30 Nov 2015 17:17:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3Wkp-0006a2-Rr for qemu-devel@nongnu.org; Mon, 30 Nov 2015 17:17:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52193) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3Wkp-0006Yy-Jq for qemu-devel@nongnu.org; Mon, 30 Nov 2015 17:17:03 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 08DCEC06C9C9 for ; Mon, 30 Nov 2015 22:17:02 +0000 (UTC) References: <1448883140-20249-1-git-send-email-peterx@redhat.com> <1448883140-20249-11-git-send-email-peterx@redhat.com> From: Eric Blake Message-ID: <565CCADD.1050904@redhat.com> Date: Mon, 30 Nov 2015 15:17:01 -0700 MIME-Version: 1.0 In-Reply-To: <1448883140-20249-11-git-send-email-peterx@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Wnbutno6V8mD27Pq57qoQcMdWGFEWsedc" Subject: Re: [Qemu-devel] [PATCH v3 10/12] Dump: add qmp command "query-dump" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Xu , qemu-devel@nongnu.org Cc: drjones@redhat.com, famz@redhat.com, armbru@redhat.com, pbonzini@redhat.com, lcapitulino@redhat.com, lersek@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Wnbutno6V8mD27Pq57qoQcMdWGFEWsedc Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/30/2015 04:32 AM, Peter Xu wrote: > When dump-guest-memory is requested with detach flag, after its > return, user could query its status using "query-dump" command (with > no argument). The result for now contains: >=20 > - status: current dump status > - written_bytes: bytes written in latest dump > - total_bytes: bytes to write in latest dump >=20 >>>From written_bytes and total_bytes, we could see how much work > finished by calculating: >=20 > 100.0 * written_bytes / total_bytes (%) >=20 > Signed-off-by: Peter Xu > --- > dump.c | 10 ++++++++++ > qapi-schema.json | 29 +++++++++++++++++++++++++++++ > qmp-commands.hx | 26 +++++++++++++++++++++++++- > 3 files changed, 64 insertions(+), 1 deletion(-) >=20 > diff --git a/dump.c b/dump.c > index 56a2d7e..6596bc8 100644 > --- a/dump.c > +++ b/dump.c > @@ -1675,6 +1675,16 @@ static void *dump_thread(void *data) > return NULL; > } > =20 > +DumpQueryResult *qmp_query_dump(Error **errp) > +{ > + DumpQueryResult *result =3D g_malloc0(sizeof(*result)); Might be nicer as g_new0(DumpQueryResult, 1). Markus has been switching to g_new0 where a type name was already mentioned, although here you used *result rather than a typename. > +++ b/qapi-schema.json > @@ -2157,6 +2157,35 @@ > 'data': [ 'none', 'active', 'completed', 'failed' ] } > =20 > ## > +# @DumpQueryResult > +# > +# The result format for 'query-dump'. > +# > +# @status: enum of @DumpStatus, which shows current dump status > +# > +# @written_bytes: bytes written in latest dump (uncompressed) > +# > +# @total_bytes: total bytes to be write in latest dump (uncompressed) s/be write/written/ > +# > +# Since 2.6 > +## > +{ 'struct': 'DumpQueryResult', > + 'data': { 'status': 'DumpStatus', > + 'written_bytes': 'int', > + 'total_bytes': 'int' } } Prefer '-' over '_' in new QMP (as in 'total-bytes' rather than 'total_bytes'). Furthermore, QMP already defaults to bytes, so it would be sufficient to name these merely 'written'/'total' or even 'complete'/'total'. > +++ b/qmp-commands.hx > @@ -881,7 +881,7 @@ EQMP > { > .name =3D "query-dump-guest-memory-capability", > .args_type =3D "", > - .mhandler.cmd_new =3D qmp_marshal_query_dump_guest_memory_capabili= ty, > + .mhandler.cmd_new =3D qmp_marshal_query_dump_guest_memory_capa= bility, > }, Unrelated hunk. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --Wnbutno6V8mD27Pq57qoQcMdWGFEWsedc 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/ iQEcBAEBCAAGBQJWXMrdAAoJEKeha0olJ0NqdacH/1n+sULh6SISdkiQDZdiHmL8 mtOZg34gl/SyySqXC4sLmVfyWBwLzDsZPuyCdt4rbquhtMkSwSncv4ULoxLjBPpg H7K0vB4c6MM+M9bea4ssBXoCTkH/dtAg6rZETmCZU07hCFj6YgW1Cdz11jebnmqK 5IJkj1xcoskmWdHyBlpxH9pgitlFQ5kn7HITUfty5usPHCmrfERdYUw7z3BFSip6 yjjQyRHcfrFrJ7OUgKK2aGyfMy92qQ+zql0FY2FuPz7et+UyX1btDU1/EpEgCXIi N28h0Kohu6CLNlqMXN9XtchmzHzHOELUUoC+0ssLZ4s4dwi9LbbkSE4CZguQC5o= =H20J -----END PGP SIGNATURE----- --Wnbutno6V8mD27Pq57qoQcMdWGFEWsedc--