Patchwork qapi: add libqmp.c and libqmp.h

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

Comments

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

Patch

diff --git a/libqmp.c b/libqmp.c
new file mode 100644
index 0000000..9d90f01
--- /dev/null
+++ b/libqmp.c
@@ -0,0 +1,69 @@ 
+/* THIS FILE IS AUTOMATICALLY GENERATED, DO NOT EDIT */
+
+#include "libqmp.h"
+#include "libqmp-internal.h"
+
+
+struct VersionInfo * libqmp_query_version(QmpSession *qmp__session, Error **qmp__err)
+{
+    QDict *qmp__args = qdict_new();
+    Error *qmp__local_err = NULL;
+    QObject *qmp__retval = NULL;
+    struct VersionInfo * qmp__native_retval = 0;
+
+    qmp__retval = qmp__session->dispatch(qmp__session, "query-version", qmp__args, &qmp__local_err);
+
+    QDECREF(qmp__args);
+
+    if (!qmp__local_err) {
+        qmp__native_retval = qmp_unmarshal_type_VersionInfo(qmp__retval, &qmp__local_err);
+        qobject_decref(qmp__retval);
+    }
+    error_propagate(qmp__err, qmp__local_err);
+    return qmp__native_retval;
+}
+
+void libqmp_quit(QmpSession *qmp__session, Error **qmp__err)
+{
+    QDict *qmp__args = qdict_new();
+    Error *qmp__local_err = NULL;
+    QObject *qmp__retval = NULL;
+
+    qmp__retval = qmp__session->dispatch(qmp__session, "quit", qmp__args, &qmp__local_err);
+
+    QDECREF(qmp__args);
+    qobject_decref(qmp__retval);
+    error_propagate(qmp__err, qmp__local_err);
+}
+
+void libqmp_qmp_capabilities(QmpSession *qmp__session, Error **qmp__err)
+{
+    QDict *qmp__args = qdict_new();
+    Error *qmp__local_err = NULL;
+    QObject *qmp__retval = NULL;
+
+    qmp__retval = qmp__session->dispatch(qmp__session, "qmp_capabilities", qmp__args, &qmp__local_err);
+
+    QDECREF(qmp__args);
+    qobject_decref(qmp__retval);
+    error_propagate(qmp__err, qmp__local_err);
+}
+
+void libqmp_put_event(QmpSession *qmp__session, int64_t tag, Error **qmp__err)
+{
+    QDict *qmp__args = qdict_new();
+    Error *qmp__local_err = NULL;
+    QObject *qmp__retval = NULL;
+
+    qdict_put_obj(qmp__args, "tag", qmp_marshal_type_int(tag));
+
+    qmp__retval = qmp__session->dispatch(qmp__session, "put-event", qmp__args, &qmp__local_err);
+
+    QDECREF(qmp__args);
+    qobject_decref(qmp__retval);
+    error_propagate(qmp__err, qmp__local_err);
+}
+
+void libqmp_init_events(QmpSession *sess)
+{
+}
diff --git a/libqmp.h b/libqmp.h
new file mode 100644
index 0000000..da6c5e1
--- /dev/null
+++ b/libqmp.h
@@ -0,0 +1,11 @@ 
+/* THIS FILE IS AUTOMATICALLY GENERATED, DO NOT EDIT */
+#ifndef LIBQMP_H
+#define LIBQMP_H
+
+#include "libqmp-core.h"
+
+struct VersionInfo * libqmp_query_version(QmpSession *qmp__session, Error **qmp__err);
+void libqmp_quit(QmpSession *qmp__session, Error **qmp__err);
+void libqmp_qmp_capabilities(QmpSession *qmp__session, Error **qmp__err);
+void libqmp_put_event(QmpSession *qmp__session, int64_t tag, Error **qmp__err);
+#endif