Re: [Qemu-devel] [PATCH 3/6] rename blockdev-group-snapshot-sync

2012-03-01 Thread Paolo Bonzini
Il 01/03/2012 14:30, Luiz Capitulino ha scritto: >> > My understanding was that in this case I can trust the value to be >> > all-zeros (zero, false, 0.0, NULL), at least in the context of QAPI. >> > The QmpInputVisitor uses g_malloc0. > Yes, as a side effect :) I mean, I don't think the reason for

Re: [Qemu-devel] [PATCH 3/6] rename blockdev-group-snapshot-sync

2012-03-01 Thread Luiz Capitulino
On Wed, 29 Feb 2012 16:23:20 +0100 Paolo Bonzini wrote: > Il 29/02/2012 16:08, Luiz Capitulino ha scritto: > >> > > >> > but it can just be omitted, I wasn't sure of how QAPI handled optionals. > > Do you now? > > Perhaps not. :) > > > All optionals will be accompanied of a 'bool has_OPTIONAL_

Re: [Qemu-devel] [PATCH 3/6] rename blockdev-group-snapshot-sync

2012-03-01 Thread Paolo Bonzini
Il 29/02/2012 19:41, Eric Blake ha scritto: > Drop the "op":"snapshot". It's a leftover from before your conversion > to a union type. > > Question - when reading/writing these examples, are 'type' and "type" > interchangeable (like in XML)? IIRC, in JSON only "type" is allowed, but QEMU allows

Re: [Qemu-devel] [PATCH 3/6] rename blockdev-group-snapshot-sync

2012-02-29 Thread Eric Blake
On 02/29/2012 06:37 AM, Paolo Bonzini wrote: > We will add other kinds of operation. Prepare for this by adjusting > the schema and renaming some types/variables. > > Signed-off-by: Paolo Bonzini > --- > blockdev.c | 73 + > qapi-schem

Re: [Qemu-devel] [PATCH 3/6] rename blockdev-group-snapshot-sync

2012-02-29 Thread Paolo Bonzini
Il 29/02/2012 16:08, Luiz Capitulino ha scritto: >> > >> > but it can just be omitted, I wasn't sure of how QAPI handled optionals. > Do you now? Perhaps not. :) > All optionals will be accompanied of a 'bool has_OPTIONAL_NAME', this bool > will be true if the optional has been passed by the cal

Re: [Qemu-devel] [PATCH 3/6] rename blockdev-group-snapshot-sync

2012-02-29 Thread Luiz Capitulino
On Wed, 29 Feb 2012 15:25:29 +0100 Paolo Bonzini wrote: > Il 29/02/2012 14:37, Paolo Bonzini ha scritto: > > +assert(!(dev_info->snapshot->has_format && format)); > > Oops, this wanted to be > > assert(dev_info->snapshot->has_format == (format != NULL)); > > but it can just be omit

Re: [Qemu-devel] [PATCH 3/6] rename blockdev-group-snapshot-sync

2012-02-29 Thread Paolo Bonzini
Il 29/02/2012 14:37, Paolo Bonzini ha scritto: > +assert(!(dev_info->snapshot->has_format && format)); Oops, this wanted to be assert(dev_info->snapshot->has_format == (format != NULL)); but it can just be omitted, I wasn't sure of how QAPI handled optionals. Paolo

[Qemu-devel] [PATCH 3/6] rename blockdev-group-snapshot-sync

2012-02-29 Thread Paolo Bonzini
We will add other kinds of operation. Prepare for this by adjusting the schema and renaming some types/variables. Signed-off-by: Paolo Bonzini --- blockdev.c | 73 + qapi-schema.json | 33 qmp-commands.hx |