From d2f95f4d482374485234790a6fc3cca29ebb7355 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Mon, 26 Jun 2017 18:22:59 +0200 Subject: 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 Reviewed-by: Eric Blake Reviewed-by: Daniel P. Berrange --- qapi/qobject-input-visitor.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'qapi/qobject-input-visitor.c') diff --git a/qapi/qobject-input-visitor.c b/qapi/qobject-input-visitor.c index 35aff78f2b..ee9e47d911 100644 --- a/qapi/qobject-input-visitor.c +++ b/qapi/qobject-input-visitor.c @@ -587,11 +587,13 @@ static void qobject_input_type_any(Visitor *v, const char *name, QObject **obj, *obj = qobj; } -static void qobject_input_type_null(Visitor *v, const char *name, Error **errp) +static void qobject_input_type_null(Visitor *v, const char *name, + QNull **obj, Error **errp) { QObjectInputVisitor *qiv = to_qiv(v); QObject *qobj = qobject_input_get_object(qiv, name, true, errp); + *obj = NULL; if (!qobj) { return; } @@ -599,7 +601,9 @@ static void qobject_input_type_null(Visitor *v, const char *name, Error **errp) if (qobject_type(qobj) != QTYPE_QNULL) { error_setg(errp, QERR_INVALID_PARAMETER_TYPE, full_name(qiv, name), "null"); + return; } + *obj = qnull(); } static void qobject_input_type_size_keyval(Visitor *v, const char *name, -- cgit v1.2.3-55-g7522