mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-26 20:03:54 -06:00
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>
This commit is contained in:
parent
006ca09f30
commit
d2f95f4d48
15 changed files with 60 additions and 25 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue