qapi: Replace start_optional()/end_optional() by optional()
commite2cd0f4fb42b1fae65ad22e8efde9804446e6254
authorMarkus Armbruster <armbru@redhat.com>
Wed, 7 May 2014 07:53:46 +0000 (7 09:53 +0200)
committerLuiz Capitulino <lcapitulino@redhat.com>
Thu, 15 May 2014 18:00:45 +0000 (15 14:00 -0400)
treef8ea58b96ee1114f9dd0c45d67d567faec516df3
parentcbc95538eda98929d2c5c8ff0d9db9043fcf1ae6
qapi: Replace start_optional()/end_optional() by optional()

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 <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
include/qapi/visitor-impl.h
include/qapi/visitor.h
qapi/opts-visitor.c
qapi/qapi-visit-core.c
qapi/qmp-input-visitor.c
qapi/string-input-visitor.c
scripts/qapi-commands.py
scripts/qapi-visit.py