Re: [Qemu-devel] [RFC PATCH] qapi: split visit_end_struct() into pieces

2015-10-07 Thread Markus Armbruster
Eric Blake writes: > On 10/07/2015 06:00 AM, Markus Armbruster wrote: > Looks like we're getting drawn into visitor contract territory again. > >>> +++ b/hmp.c >>> @@ -1658,8 +1658,9 @@ void hmp_object_add(Monitor *mon, const QDict *qdict) >>> >>> object_add(type, id, pdict, opts_g

Re: [Qemu-devel] [RFC PATCH] qapi: split visit_end_struct() into pieces

2015-10-07 Thread Eric Blake
On 10/07/2015 06:00 AM, Markus Armbruster wrote: >>> Looks like we're getting drawn into visitor contract territory again. >>> >> +++ b/hmp.c >> @@ -1658,8 +1658,9 @@ void hmp_object_add(Monitor *mon, const QDict *qdict) >> >> object_add(type, id, pdict, opts_get_visitor(ov), &err); >> >> +

Re: [Qemu-devel] [RFC PATCH] qapi: split visit_end_struct() into pieces

2015-10-07 Thread Markus Armbruster
Markus Armbruster writes: > Eric Blake writes: [...] >> diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c >> index c419b17..48867c4 100644 >> --- a/hw/virtio/virtio-balloon.c >> +++ b/hw/virtio/virtio-balloon.c >> @@ -132,14 +132,16 @@ static void balloon_stats_get_all(Object

Re: [Qemu-devel] [RFC PATCH] qapi: split visit_end_struct() into pieces

2015-10-07 Thread Markus Armbruster
Eric Blake writes: > We want to call the various visit_end_*() functions unconditionally, > so that visitors can release resources tied up since the matching > visit_start_*(). But we also have a requirement for detecting when > an input visitor did not consume everything, so the code allowed >

[Qemu-devel] [RFC PATCH] qapi: split visit_end_struct() into pieces

2015-10-06 Thread Eric Blake
We want to call the various visit_end_*() functions unconditionally, so that visitors can release resources tied up since the matching visit_start_*(). But we also have a requirement for detecting when an input visitor did not consume everything, so the code allowed visit_end_*() to set an error.