diff options
author | Markus Armbruster <armbru@redhat.com> | 2014-05-07 09:53:46 +0200 |
---|---|---|
committer | Luiz Capitulino <lcapitulino@redhat.com> | 2014-05-15 14:00:45 -0400 |
commit | e2cd0f4fb42b1fae65ad22e8efde9804446e6254 (patch) | |
tree | f8ea58b96ee1114f9dd0c45d67d567faec516df3 /include/qapi/visitor-impl.h | |
parent | cbc95538eda98929d2c5c8ff0d9db9043fcf1ae6 (diff) | |
download | hqemu-e2cd0f4fb42b1fae65ad22e8efde9804446e6254.zip hqemu-e2cd0f4fb42b1fae65ad22e8efde9804446e6254.tar.gz |
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>
Diffstat (limited to 'include/qapi/visitor-impl.h')
-rw-r--r-- | include/qapi/visitor-impl.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/include/qapi/visitor-impl.h b/include/qapi/visitor-impl.h index 166aadd..ecc0183 100644 --- a/include/qapi/visitor-impl.h +++ b/include/qapi/visitor-impl.h @@ -42,9 +42,8 @@ struct Visitor Error **errp); /* May be NULL */ - void (*start_optional)(Visitor *v, bool *present, const char *name, - Error **errp); - void (*end_optional)(Visitor *v, Error **errp); + void (*optional)(Visitor *v, bool *present, const char *name, + Error **errp); void (*type_uint8)(Visitor *v, uint8_t *obj, const char *name, Error **errp); void (*type_uint16)(Visitor *v, uint16_t *obj, const char *name, Error **errp); |