qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 10/12] Dump: add qmp command "query-dump"


From: Peter Xu
Subject: Re: [Qemu-devel] [PATCH v3 10/12] Dump: add qmp command "query-dump"
Date: Tue, 1 Dec 2015 12:40:39 +0800
User-agent: Mutt/1.5.23 (2014-03-12)

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
> 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]