2011-07-19 23:50:33 +04:00
|
|
|
/*
|
|
|
|
* Input Visitor
|
|
|
|
*
|
|
|
|
* Copyright IBM, Corp. 2011
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Anthony Liguori <aliguori@us.ibm.com>
|
|
|
|
*
|
|
|
|
* This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
|
|
|
|
* See the COPYING.LIB file in the top-level directory.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef QMP_INPUT_VISITOR_H
|
|
|
|
#define QMP_INPUT_VISITOR_H
|
|
|
|
|
2012-12-17 21:19:43 +04:00
|
|
|
#include "qapi/visitor.h"
|
|
|
|
#include "qapi/qmp/qobject.h"
|
2011-07-19 23:50:33 +04:00
|
|
|
|
|
|
|
typedef struct QmpInputVisitor QmpInputVisitor;
|
|
|
|
|
2016-04-29 00:45:13 +03:00
|
|
|
/*
|
|
|
|
* Return a new input visitor that converts QMP to QAPI.
|
|
|
|
*
|
|
|
|
* Set @strict to reject a parse that doesn't consume all keys of a
|
|
|
|
* dictionary; otherwise excess input is ignored.
|
|
|
|
*/
|
qmp-input-visitor: Favor new visit_free() function
Now that we have a polymorphic visit_free(), we no longer need
qmp_input_visitor_cleanup(); which in turn means we no longer
need to return a subtype from qmp_input_visitor_new() nor a
public upcast function.
Generated code changes to qmp-marshal.c look like:
|@@ -52,11 +52,10 @@ void qmp_marshal_add_fd(QDict *args, QOb
| {
| Error *err = NULL;
| AddfdInfo *retval;
|- QmpInputVisitor *qiv = qmp_input_visitor_new(QOBJECT(args), true);
| Visitor *v;
| q_obj_add_fd_arg arg = {0};
|
|- v = qmp_input_get_visitor(qiv);
|+ v = qmp_input_visitor_new(QOBJECT(args), true);
| visit_start_struct(v, NULL, NULL, 0, &err);
| if (err) {
| goto out;
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <1465490926-28625-8-git-send-email-eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2016-06-09 19:48:38 +03:00
|
|
|
Visitor *qmp_input_visitor_new(QObject *obj, bool strict);
|
2011-07-19 23:50:33 +04:00
|
|
|
|
|
|
|
#endif
|