summaryrefslogtreecommitdiff
path: root/include/qapi
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2013-07-03 15:52:42 +0200
committerKevin Wolf <kwolf@redhat.com>2013-07-26 20:17:15 +0200
commit761d524dbcc5bb41213dd0f238f43c273bc2b077 (patch)
treee96fec00aacf28df3328fd8dc96b014b85bcba89 /include/qapi
parent51631493e4876081ae27078b50bd95bd4418bf37 (diff)
downloadqemu-761d524dbcc5bb41213dd0f238f43c273bc2b077.tar.gz
qemu-761d524dbcc5bb41213dd0f238f43c273bc2b077.tar.bz2
qemu-761d524dbcc5bb41213dd0f238f43c273bc2b077.zip
qapi: Add visitor for implicit structs
These can be used when an embedded struct is parsed and members not belonging to the struct may be present in the input (e.g. parsing a flat namespace QMP union, where fields from both the base and one of the alternative types are mixed in the JSON object) Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'include/qapi')
-rw-r--r--include/qapi/visitor-impl.h4
-rw-r--r--include/qapi/visitor.h3
2 files changed, 7 insertions, 0 deletions
diff --git a/include/qapi/visitor-impl.h b/include/qapi/visitor-impl.h
index 5159964863..5c1297f430 100644
--- a/include/qapi/visitor-impl.h
+++ b/include/qapi/visitor-impl.h
@@ -22,6 +22,10 @@ struct Visitor
const char *name, size_t size, Error **errp);
void (*end_struct)(Visitor *v, Error **errp);
+ void (*start_implicit_struct)(Visitor *v, void **obj, size_t size,
+ Error **errp);
+ void (*end_implicit_struct)(Visitor *v, Error **errp);
+
void (*start_list)(Visitor *v, const char *name, Error **errp);
GenericList *(*next_list)(Visitor *v, GenericList **list, Error **errp);
void (*end_list)(Visitor *v, Error **errp);
diff --git a/include/qapi/visitor.h b/include/qapi/visitor.h
index 28c21d8338..bd24f85e97 100644
--- a/include/qapi/visitor.h
+++ b/include/qapi/visitor.h
@@ -33,6 +33,9 @@ void visit_end_handle(Visitor *v, Error **errp);
void visit_start_struct(Visitor *v, void **obj, const char *kind,
const char *name, size_t size, Error **errp);
void visit_end_struct(Visitor *v, Error **errp);
+void visit_start_implicit_struct(Visitor *v, void **obj, size_t size,
+ Error **errp);
+void visit_end_implicit_struct(Visitor *v, Error **errp);
void visit_start_list(Visitor *v, const char *name, Error **errp);
GenericList *visit_next_list(Visitor *v, GenericList **list, Error **errp);
void visit_end_list(Visitor *v, Error **errp);