diff options
Diffstat (limited to 'include/qapi')
-rw-r--r-- | include/qapi/visitor-impl.h | 2 | ||||
-rw-r--r-- | include/qapi/visitor.h | 13 |
2 files changed, 7 insertions, 8 deletions
diff --git a/include/qapi/visitor-impl.h b/include/qapi/visitor-impl.h index ea252f8e3a..7905a2845e 100644 --- a/include/qapi/visitor-impl.h +++ b/include/qapi/visitor-impl.h @@ -29,7 +29,7 @@ struct Visitor void (*start_list)(Visitor *v, const char *name, Error **errp); /* Must be set */ - GenericList *(*next_list)(Visitor *v, GenericList **list); + GenericList *(*next_list)(Visitor *v, GenericList **list, size_t size); /* Must be set */ void (*end_list)(Visitor *v); diff --git a/include/qapi/visitor.h b/include/qapi/visitor.h index 5e581dcf7e..8a2d5ccacc 100644 --- a/include/qapi/visitor.h +++ b/include/qapi/visitor.h @@ -19,13 +19,12 @@ #include "qapi/error.h" #include <stdlib.h> -typedef struct GenericList -{ - union { - void *value; - uint64_t padding; - }; +/* This struct is layout-compatible with all other *List structs + * created by the qapi generator. It is used as a typical + * singly-linked list. */ +typedef struct GenericList { struct GenericList *next; + char padding[]; } GenericList; void visit_start_struct(Visitor *v, const char *name, void **obj, @@ -36,7 +35,7 @@ void visit_start_implicit_struct(Visitor *v, void **obj, size_t size, void visit_end_implicit_struct(Visitor *v); void visit_start_list(Visitor *v, const char *name, Error **errp); -GenericList *visit_next_list(Visitor *v, GenericList **list); +GenericList *visit_next_list(Visitor *v, GenericList **list, size_t size); void visit_end_list(Visitor *v); /** |