From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32868) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3ckO-0003qY-0S for qemu-devel@nongnu.org; Mon, 30 Nov 2015 23:41:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3ckJ-0003KP-Rf for qemu-devel@nongnu.org; Mon, 30 Nov 2015 23:40:59 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49500) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3ckJ-0003K6-M5 for qemu-devel@nongnu.org; Mon, 30 Nov 2015 23:40:55 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 204A514CAB0 for ; Tue, 1 Dec 2015 04:40:55 +0000 (UTC) Date: Tue, 1 Dec 2015 12:40:39 +0800 From: Peter Xu Message-ID: <20151201044037.GK21032@pxdev.xzpeter.org> References: <1448883140-20249-1-git-send-email-peterx@redhat.com> <1448883140-20249-11-git-send-email-peterx@redhat.com> <565CCADD.1050904@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <565CCADD.1050904@redhat.com> 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: Eric Blake Cc: drjones@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org, famz@redhat.com, pbonzini@redhat.com, lcapitulino@redhat.com, lersek@redhat.com On Mon, Nov 30, 2015 at 03:17:01PM -0700, Eric Blake wrote: > On 11/30/2015 04:32 AM, Peter Xu wrote: > > +DumpQueryResult *qmp_query_dump(Error **errp) > > +{ > > + DumpQueryResult *result = 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. Sure. Thanks. > > > > +++ b/qapi-schema.json > > @@ -2157,6 +2157,35 @@ > > 'data': [ 'none', 'active', 'completed', 'failed' ] } > > > > ## > > +# @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'. I will directly take "completed" and "total" then. > > > +++ b/qmp-commands.hx > > @@ -881,7 +881,7 @@ EQMP > > { > > .name = "query-dump-guest-memory-capability", > > .args_type = "", > > - .mhandler.cmd_new = qmp_marshal_query_dump_guest_memory_capability, > > + .mhandler.cmd_new = qmp_marshal_query_dump_guest_memory_capability, > > }, > > Unrelated hunk. Is it ok to have this line here? I just saw it and fixed it. Please let me know if I should move it out of this patch. Thanks. Peter > > -- > Eric Blake eblake redhat com +1-919-301-3266 > Libvirt virtualization library http://libvirt.org >