Patchwork qapi: add qmp-marshal.c and qmp.h

login
register
mail settings
Submitter Anthony Liguori
Date March 7, 2011, 1:28 a.m.
Message ID <1299461323-16404-1-git-send-email-aliguori@us.ibm.com>
Download mbox | patch
Permalink /patch/85639/
State New
Headers show

Comments

Anthony Liguori - March 7, 2011, 1:28 a.m.
Not for committing.

Patch

diff --git a/qmp-marshal.c b/qmp-marshal.c
new file mode 100644
index 0000000..0cb643a
--- /dev/null
+++ b/qmp-marshal.c
@@ -0,0 +1,102 @@ 
+/* THIS FILE IS AUTOMATICALLY GENERATED, DO NOT EDIT */
+
+#include "qmp.h"
+#include "qmp-core.h"
+
+
+static void qmp_marshal_query_version(const QDict *qdict, QObject **ret_data, Error **err)
+{
+    Error *qmp__err = NULL;
+    struct VersionInfo * qmp_retval = 0;
+
+    (void)qmp__err;
+    qmp_retval = qmp_query_version(err);
+
+    if (error_is_set(err)) {
+        goto qmp__out;
+    }
+    *ret_data = qmp_marshal_type_VersionInfo(qmp_retval);
+
+qmp__out:
+
+    qmp_free_version_info(qmp_retval);
+    return;
+}
+
+static void qmp_marshal_quit(const QDict *qdict, QObject **ret_data, Error **err)
+{
+    Error *qmp__err = NULL;
+
+    (void)qmp__err;
+    qmp_quit(err);
+
+    if (error_is_set(err)) {
+        goto qmp__out;
+    }
+
+qmp__out:
+
+    return;
+}
+
+static void qmp_marshal_qmp_capabilities(QmpState *qmp__sess, const QDict *qdict, QObject **ret_data, Error **err)
+{
+    Error *qmp__err = NULL;
+
+    (void)qmp__err;
+    qmp_qmp_capabilities(qmp__sess, err);
+
+    if (error_is_set(err)) {
+        goto qmp__out;
+    }
+
+qmp__out:
+
+    return;
+}
+
+static void qmp_marshal_put_event(QmpState *qmp__sess, const QDict *qdict, QObject **ret_data, Error **err)
+{
+    Error *qmp__err = NULL;
+    int64_t tag = 0;
+
+    (void)qmp__err;
+
+    if (!qdict_haskey(qdict, "tag")) {
+        error_set(err, QERR_MISSING_PARAMETER, "tag");
+        goto qmp__out;
+    }
+
+    tag = qmp_unmarshal_type_int(qdict_get(qdict, "tag"), &qmp__err);
+    if (qmp__err) {
+        if (error_is_type(qmp__err, QERR_INVALID_PARAMETER_TYPE)) {
+            error_set(err, QERR_INVALID_PARAMETER_TYPE, "tag",
+                      error_get_field(qmp__err, "expected"));
+            error_free(qmp__err);
+            qmp__err = NULL;
+        } else {
+            error_propagate(err, qmp__err);
+        }
+        goto qmp__out;
+    }
+
+    qmp_state_del_connection(qmp__sess, tag, err);
+
+    if (error_is_set(err)) {
+        goto qmp__out;
+    }
+
+qmp__out:
+
+    return;
+}
+
+static void qmp_init_marshal(void)
+{
+    qmp_register_command("query-version", &qmp_marshal_query_version);
+    qmp_register_command("quit", &qmp_marshal_quit);
+    qmp_register_stateful_command("qmp_capabilities", &qmp_marshal_qmp_capabilities);
+    qmp_register_stateful_command("put-event", &qmp_marshal_put_event);
+};
+
+qapi_init(qmp_init_marshal);
diff --git a/qmp.h b/qmp.h
new file mode 100644
index 0000000..edada79
--- /dev/null
+++ b/qmp.h
@@ -0,0 +1,12 @@ 
+/* THIS FILE IS AUTOMATICALLY GENERATED, DO NOT EDIT */
+#ifndef QMP_MARSHAL_H
+#define QMP_MARSHAL_H
+
+#include "qemu-common.h"
+#include "qemu-objects.h"
+#include "qmp-types.h"
+#include "error.h"
+
+struct VersionInfo * qmp_query_version(Error **err);
+void qmp_quit(Error **err);
+#endif