aboutsummaryrefslogtreecommitdiff
path: root/qapi/string-input-visitor.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2017-06-26 18:22:59 +0200
committerMarkus Armbruster <armbru@redhat.com>2017-07-24 13:35:11 +0200
commitd2f95f4d482374485234790a6fc3cca29ebb7355 (patch)
tree4c95230bc64d9a294c9bc6de6696e887576a235a /qapi/string-input-visitor.c
parent006ca09f3027d86346fce707e9295975c6558f42 (diff)
qapi: Use QNull for a more regular visit_type_null()
Make visit_type_null() take an @obj argument like its buddies. This helps keep the next commit simple. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'qapi/string-input-visitor.c')
-rw-r--r--qapi/string-input-visitor.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/qapi/string-input-visitor.c b/qapi/string-input-visitor.c
index 63ae115b2a..67a0a4a58b 100644
--- a/qapi/string-input-visitor.c
+++ b/qapi/string-input-visitor.c
@@ -326,14 +326,20 @@ static void parse_type_number(Visitor *v, const char *name, double *obj,
*obj = val;
}
-static void parse_type_null(Visitor *v, const char *name, Error **errp)
+static void parse_type_null(Visitor *v, const char *name, QNull **obj,
+ Error **errp)
{
StringInputVisitor *siv = to_siv(v);
+ *obj = NULL;
+
if (!siv->string || siv->string[0]) {
error_setg(errp, QERR_INVALID_PARAMETER_TYPE, name ? name : "null",
"null");
+ return;
}
+
+ *obj = qnull();
}
static void string_input_free(Visitor *v)