summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2016-01-29 06:48:59 -0700
committerTimothy Pearson <tpearson@raptorengineering.com>2019-11-29 19:32:24 -0600
commitb9ad670b9ec7f4dcce107f4a4a0e7c4875187667 (patch)
tree36a9aa3a249f35c58b8bd55ab5009ee79705f326 /include
parent5c1cd25663cf569886666c48dcc62de7cdee6985 (diff)
downloadhqemu-b9ad670b9ec7f4dcce107f4a4a0e7c4875187667.zip
hqemu-b9ad670b9ec7f4dcce107f4a4a0e7c4875187667.tar.gz
qapi: Drop unused error argument for list and implicit struct
No backend was setting an error when ending the visit of a list or implicit struct, or when moving to the next list node. Make the callers a bit easier to follow by making this a part of the contract, and removing the errp argument - callers can then unconditionally end an object as part of cleanup without having to think about whether a second error is dominated by a first, because there is no second error. A later patch will then tackle the larger task of splitting visit_end_struct(), which can indeed set an error. Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <1454075341-13658-24-git-send-email-eblake@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/qapi/visitor-impl.h9
-rw-r--r--include/qapi/visitor.h8
2 files changed, 11 insertions, 6 deletions
diff --git a/include/qapi/visitor-impl.h b/include/qapi/visitor-impl.h
index 337f999..ea252f8 100644
--- a/include/qapi/visitor-impl.h
+++ b/include/qapi/visitor-impl.h
@@ -24,11 +24,14 @@ struct Visitor
void (*start_implicit_struct)(Visitor *v, void **obj, size_t size,
Error **errp);
- void (*end_implicit_struct)(Visitor *v, Error **errp);
+ /* May be NULL */
+ void (*end_implicit_struct)(Visitor *v);
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);
+ /* Must be set */
+ GenericList *(*next_list)(Visitor *v, GenericList **list);
+ /* Must be set */
+ void (*end_list)(Visitor *v);
void (*type_enum)(Visitor *v, const char *name, int *obj,
const char *const strings[], Error **errp);
diff --git a/include/qapi/visitor.h b/include/qapi/visitor.h
index 997555d..5e581dc 100644
--- a/include/qapi/visitor.h
+++ b/include/qapi/visitor.h
@@ -1,6 +1,7 @@
/*
* Core Definitions for QAPI Visitor Classes
*
+ * Copyright (C) 2012-2016 Red Hat, Inc.
* Copyright IBM, Corp. 2011
*
* Authors:
@@ -32,10 +33,11 @@ void visit_start_struct(Visitor *v, const char *name, void **obj,
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_end_implicit_struct(Visitor *v);
+
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);
+GenericList *visit_next_list(Visitor *v, GenericList **list);
+void visit_end_list(Visitor *v);
/**
* Check if an optional member @name of an object needs visiting.
OpenPOWER on IntegriCloud