Re: [Qemu-devel] [PATCH v3 10/18] vmstate: Use new JSON output visitor

2016-05-24 Thread Paolo Bonzini
On 04/05/2016 10:54, Dr. David Alan Gilbert wrote: > And so my argument here is very simple; if we believe we have a corruption > in migration data then we fail migration - I don't try and do anything > clever about trying to bound what's broken. > This isn't about getting formal/tractable argume

Re: [Qemu-devel] [PATCH v3 10/18] vmstate: Use new JSON output visitor

2016-05-04 Thread Markus Armbruster
"Dr. David Alan Gilbert" writes: > * Markus Armbruster (arm...@redhat.com) wrote: >> "Dr. David Alan Gilbert" writes: >> >> > * Markus Armbruster (arm...@redhat.com) wrote: >> >> "Dr. David Alan Gilbert" writes: >> >> >> >> > * Markus Armbruster (arm...@redhat.com) wrote: >> >> >> "Dr. David

Re: [Qemu-devel] [PATCH v3 10/18] vmstate: Use new JSON output visitor

2016-05-04 Thread Eric Blake
On 05/04/2016 08:53 AM, Dr. David Alan Gilbert wrote: >> Here's the example from visitor.h at the end of this series (with a >> small mistake corrected): >> >> Visitor *v; >> Error *err = NULL; >> int value; >> >> v = ...obtain visitor... >> visit_start_struct(v, NULL, NULL, 0,

Re: [Qemu-devel] [PATCH v3 10/18] vmstate: Use new JSON output visitor

2016-05-04 Thread Dr. David Alan Gilbert
* Markus Armbruster (arm...@redhat.com) wrote: > "Dr. David Alan Gilbert" writes: > > > * Markus Armbruster (arm...@redhat.com) wrote: > >> "Dr. David Alan Gilbert" writes: > >> > >> > * Markus Armbruster (arm...@redhat.com) wrote: > >> >> "Dr. David Alan Gilbert" writes: > >> >> > >> >> > *

Re: [Qemu-devel] [PATCH v3 10/18] vmstate: Use new JSON output visitor

2016-05-04 Thread Markus Armbruster
"Dr. David Alan Gilbert" writes: > * Markus Armbruster (arm...@redhat.com) wrote: >> "Dr. David Alan Gilbert" writes: >> >> > * Markus Armbruster (arm...@redhat.com) wrote: >> >> "Dr. David Alan Gilbert" writes: >> >> >> >> > * Markus Armbruster (arm...@redhat.com) wrote: >> >> >> "Dr. David

Re: [Qemu-devel] [PATCH v3 10/18] vmstate: Use new JSON output visitor

2016-05-04 Thread Dr. David Alan Gilbert
* Markus Armbruster (arm...@redhat.com) wrote: > "Dr. David Alan Gilbert" writes: > > > * Markus Armbruster (arm...@redhat.com) wrote: > >> "Dr. David Alan Gilbert" writes: > >> > >> > * Markus Armbruster (arm...@redhat.com) wrote: > >> >> "Dr. David Alan Gilbert" writes: > >> > > >> >> "git-g

Re: [Qemu-devel] [PATCH v3 10/18] vmstate: Use new JSON output visitor

2016-05-04 Thread Markus Armbruster
"Dr. David Alan Gilbert" writes: > * Markus Armbruster (arm...@redhat.com) wrote: >> "Dr. David Alan Gilbert" writes: >> >> > * Markus Armbruster (arm...@redhat.com) wrote: >> >> "Dr. David Alan Gilbert" writes: >> > >> >> "git-grep assert migration" suggests you do kill the source on certain

Re: [Qemu-devel] [PATCH v3 10/18] vmstate: Use new JSON output visitor

2016-05-04 Thread Dr. David Alan Gilbert
* Markus Armbruster (arm...@redhat.com) wrote: > "Dr. David Alan Gilbert" writes: > > > * Markus Armbruster (arm...@redhat.com) wrote: > >> "Dr. David Alan Gilbert" writes: > > > >> "git-grep assert migration" suggests you do kill the source on certain > >> programming errors. > > > > I'm just t

Re: [Qemu-devel] [PATCH v3 10/18] vmstate: Use new JSON output visitor

2016-05-04 Thread Markus Armbruster
"Dr. David Alan Gilbert" writes: > * Markus Armbruster (arm...@redhat.com) wrote: >> "Dr. David Alan Gilbert" writes: > >> "git-grep assert migration" suggests you do kill the source on certain >> programming errors. > > I'm just trying hard to reduce them; I know I'm not there, but I'd rather >

Re: [Qemu-devel] [PATCH v3 10/18] vmstate: Use new JSON output visitor

2016-05-04 Thread Dr. David Alan Gilbert
* Markus Armbruster (arm...@redhat.com) wrote: > "Dr. David Alan Gilbert" writes: > "git-grep assert migration" suggests you do kill the source on certain > programming errors. I'm just trying hard to reduce them; I know I'm not there, but I'd rather we didn't have any - especially on the source

Re: [Qemu-devel] [PATCH v3 10/18] vmstate: Use new JSON output visitor

2016-05-04 Thread Markus Armbruster
"Dr. David Alan Gilbert" writes: > * Markus Armbruster (arm...@redhat.com) wrote: >> "Dr. David Alan Gilbert" writes: >> >> > * Eric Blake (ebl...@redhat.com) wrote: >> > >> >> -static void vmstate_save_old_style(QEMUFile *f, SaveStateEntry *se, >> >> QJSON *vmdesc) >> >> +static void vmstate_

Re: [Qemu-devel] [PATCH v3 10/18] vmstate: Use new JSON output visitor

2016-05-04 Thread Dr. David Alan Gilbert
* Markus Armbruster (arm...@redhat.com) wrote: > "Dr. David Alan Gilbert" writes: > > > * Eric Blake (ebl...@redhat.com) wrote: > >> On 05/03/2016 06:26 AM, Markus Armbruster wrote: > >> > >> >>> +visit_type_int(vmdesc, "size", &size, &error_abort); > >> >>> +visit_start_list(vmd

Re: [Qemu-devel] [PATCH v3 10/18] vmstate: Use new JSON output visitor

2016-05-04 Thread Markus Armbruster
"Dr. David Alan Gilbert" writes: > * Eric Blake (ebl...@redhat.com) wrote: >> On 05/03/2016 06:26 AM, Markus Armbruster wrote: >> >> >>> +visit_type_int(vmdesc, "size", &size, &error_abort); >> >>> +visit_start_list(vmdesc, "fields", NULL, 0, &error_abort); >> >>> +visit_

Re: [Qemu-devel] [PATCH v3 10/18] vmstate: Use new JSON output visitor

2016-05-03 Thread Dr. David Alan Gilbert
* Eric Blake (ebl...@redhat.com) wrote: > On 05/03/2016 06:26 AM, Markus Armbruster wrote: > > >>> +visit_type_int(vmdesc, "size", &size, &error_abort); > >>> +visit_start_list(vmdesc, "fields", NULL, 0, &error_abort); > >>> +visit_start_struct(vmdesc, NULL, NULL, 0, &error

Re: [Qemu-devel] [PATCH v3 10/18] vmstate: Use new JSON output visitor

2016-05-03 Thread Dr. David Alan Gilbert
* Markus Armbruster (arm...@redhat.com) wrote: > "Dr. David Alan Gilbert" writes: > > > * Eric Blake (ebl...@redhat.com) wrote: > > > >> -static void vmstate_save_old_style(QEMUFile *f, SaveStateEntry *se, QJSON > >> *vmdesc) > >> +static void vmstate_save_old_style(QEMUFile *f, SaveStateEntry *

Re: [Qemu-devel] [PATCH v3 10/18] vmstate: Use new JSON output visitor

2016-05-03 Thread Eric Blake
On 05/03/2016 06:26 AM, Markus Armbruster wrote: >>> +visit_type_int(vmdesc, "size", &size, &error_abort); >>> +visit_start_list(vmdesc, "fields", NULL, 0, &error_abort); >>> +visit_start_struct(vmdesc, NULL, NULL, 0, &error_abort); >> >> Please avoid error_abort in migrati

Re: [Qemu-devel] [PATCH v3 10/18] vmstate: Use new JSON output visitor

2016-05-03 Thread Markus Armbruster
"Dr. David Alan Gilbert" writes: > * Eric Blake (ebl...@redhat.com) wrote: > >> -static void vmstate_save_old_style(QEMUFile *f, SaveStateEntry *se, QJSON >> *vmdesc) >> +static void vmstate_save_old_style(QEMUFile *f, SaveStateEntry *se, >> + Visitor *vmdesc) >

Re: [Qemu-devel] [PATCH v3 10/18] vmstate: Use new JSON output visitor

2016-05-03 Thread Dr. David Alan Gilbert
* Eric Blake (ebl...@redhat.com) wrote: > -static void vmstate_save_old_style(QEMUFile *f, SaveStateEntry *se, QJSON > *vmdesc) > +static void vmstate_save_old_style(QEMUFile *f, SaveStateEntry *se, > + Visitor *vmdesc) > { > int64_t old_offset, size; > +

Re: [Qemu-devel] [PATCH v3 10/18] vmstate: Use new JSON output visitor

2016-05-03 Thread Markus Armbruster
Eric Blake writes: > On 05/02/2016 07:26 AM, Markus Armbruster wrote: >> Eric Blake writes: >> >>> Rather than using a QJSON object and converting the QString result >>> to a char *, we can use the new JSON output visitor and get directly >>> to a char *. >>> >>> The conversions are a bit trick

Re: [Qemu-devel] [PATCH v3 10/18] vmstate: Use new JSON output visitor

2016-05-02 Thread Eric Blake
On 05/02/2016 07:26 AM, Markus Armbruster wrote: > Eric Blake writes: > >> Rather than using a QJSON object and converting the QString result >> to a char *, we can use the new JSON output visitor and get directly >> to a char *. >> >> The conversions are a bit tricky in place (in places, we have

Re: [Qemu-devel] [PATCH v3 10/18] vmstate: Use new JSON output visitor

2016-05-02 Thread Markus Armbruster
Eric Blake writes: > Rather than using a QJSON object and converting the QString result > to a char *, we can use the new JSON output visitor and get directly > to a char *. > > The conversions are a bit tricky in place (in places, we have to > copy an integer to an int64_t temporary to get the r

[Qemu-devel] [PATCH v3 10/18] vmstate: Use new JSON output visitor

2016-04-28 Thread Eric Blake
Rather than using a QJSON object and converting the QString result to a char *, we can use the new JSON output visitor and get directly to a char *. The conversions are a bit tricky in place (in places, we have to copy an integer to an int64_t temporary to get the right pointer for visit_type_int(