On 05/02/2014 06:44 AM, Markus Armbruster wrote: > Semantics of end_optional() differ subtly from the other end_FOO() > callbacks: when start_FOO() succeeds, the matching end_FOO() gets > called regardless of what happens in between. end_optional() gets > called only when everything in between succeeds as well. Entirely > undocumented, like all of the visitor API. > > The only user of Visitor Callback end_optional() never did anything, > and was removed in commit 9f9ab46. > > I'm about to clean up error handling in the generated visitor code, > and end_optional() is in my way. No users mean no test cases, and > making non-trivial cleanup transformations without test cases doesn't > strike me as a good idea. > > Drop end_optional(), and rename start_optional() to optional(). We > can always go back to a pair of callbacks when we have an actual need. > > Signed-off-by: Markus Armbruster <arm...@redhat.com> > --- > include/qapi/visitor-impl.h | 5 ++--- > include/qapi/visitor.h | 5 ++--- > qapi/opts-visitor.c | 5 ++--- > qapi/qapi-visit-core.c | 15 ++++----------- > qapi/qmp-input-visitor.c | 6 +++--- > qapi/string-input-visitor.c | 6 +++--- > scripts/qapi-commands.py | 5 ++--- > scripts/qapi-visit.py | 3 +-- > 8 files changed, 19 insertions(+), 31 deletions(-)
Reviewed-by: Eric Blake <ebl...@redhat.com> > +++ b/qapi/opts-visitor.c > @@ -483,8 +483,7 @@ opts_type_size(Visitor *v, uint64_t *obj, const char > *name, Error **errp) > > > static void > -opts_start_optional(Visitor *v, bool *present, const char *name, > - Error **errp) > +opts_optional(Visitor *v, bool *present, const char *name, Error **errp) Managed to fix an indentation problem while at it :) -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature