[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] qapi: add qmp-marshal.c and qmp.h
From: |
Anthony Liguori |
Subject: |
[Qemu-devel] [PATCH] qapi: add qmp-marshal.c and qmp.h |
Date: |
Sun, 6 Mar 2011 19:28:43 -0600 |
Not for committing.
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
--
1.7.0.4
- Re: [Qemu-devel] [PATCH 01/22] Add hard build dependency on glib, (continued)
- [Qemu-devel] [PATCH 20/22] qapi: add code generator for libqmp, Anthony Liguori, 2011/03/06
- [Qemu-devel] [PATCH 04/22] qerror: split out the reporting bits of QError, Anthony Liguori, 2011/03/06
- [Qemu-devel] [PATCH 08/22] qapi: add code generator for qmp-types, Anthony Liguori, 2011/03/06
- [Qemu-devel] [PATCH 09/22] qapi: add code generator for type marshallers, Anthony Liguori, 2011/03/06
- [Qemu-devel] [PATCH 05/22] qerror: add new error message for invalid enum values, Anthony Liguori, 2011/03/06
- [Qemu-devel] [PATCH] qapi: qmp-types.c and qmp-types.h, Anthony Liguori, 2011/03/06
- [Qemu-devel] [PATCH] qapi: qmp-marshal-types.c and qmp-marshal-types.h, Anthony Liguori, 2011/03/06
- [Qemu-devel] [PATCH] qapi: add qmp-marshal.c and qmp.h,
Anthony Liguori <=
- [Qemu-devel] [PATCH] qapi: add libqmp.c and libqmp.h, Anthony Liguori, 2011/03/06
- Re: [Qemu-devel] [PATCH 00/22] QAPI Round 1, Stefan Hajnoczi, 2011/03/07
- Re: [Qemu-devel] [PATCH 00/22] QAPI Round 1, Anthony Liguori, 2011/03/07
- Re: [Qemu-devel] [PATCH 00/22] QAPI Round 1, Avi Kivity, 2011/03/08
- Re: [Qemu-devel] [PATCH 00/22] QAPI Round 1, Anthony Liguori, 2011/03/08
- Re: [Qemu-devel] [PATCH 00/22] QAPI Round 1, Avi Kivity, 2011/03/08
- Re: [Qemu-devel] [PATCH 00/22] QAPI Round 1, Anthony Liguori, 2011/03/08
- Re: [Qemu-devel] [PATCH 00/22] QAPI Round 1, Avi Kivity, 2011/03/08
- Re: [Qemu-devel] [PATCH 00/22] QAPI Round 1, Anthony Liguori, 2011/03/08
- Re: [Qemu-devel] [PATCH 00/22] QAPI Round 1, Avi Kivity, 2011/03/08