Modern code uses QMP schema to query for supported event types.

Signed-off-by: Peter Krempa <pkre...@redhat.com>
---
 src/qemu/qemu_monitor.c      | 12 --------
 src/qemu/qemu_monitor.h      |  2 --
 src/qemu/qemu_monitor_json.c | 57 ------------------------------------
 src/qemu/qemu_monitor_json.h |  3 --
 4 files changed, 74 deletions(-)

diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index fede34210d..f337f20140 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -3830,18 +3830,6 @@ qemuMonitorGetCommands(qemuMonitorPtr mon,
 }


-int
-qemuMonitorGetEvents(qemuMonitorPtr mon,
-                     char ***events)
-{
-    VIR_DEBUG("events=%p", events);
-
-    QEMU_CHECK_MONITOR(mon);
-
-    return qemuMonitorJSONGetEvents(mon, events);
-}
-
-
 GHashTable *
 qemuMonitorGetCommandLineOptions(qemuMonitorPtr mon)
 {
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index 9106f966da..310635881d 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -1274,8 +1274,6 @@ qemuMonitorCPUModelInfoCopy(const qemuMonitorCPUModelInfo 
*orig);

 int qemuMonitorGetCommands(qemuMonitorPtr mon,
                            char ***commands);
-int qemuMonitorGetEvents(qemuMonitorPtr mon,
-                         char ***events);
 GHashTable *qemuMonitorGetCommandLineOptions(qemuMonitorPtr mon);

 int qemuMonitorGetKVMState(qemuMonitorPtr mon,
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 0602d8e0dd..f7a84f86e6 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -6274,63 +6274,6 @@ int qemuMonitorJSONGetCommands(qemuMonitorPtr mon,
 }


-int qemuMonitorJSONGetEvents(qemuMonitorPtr mon,
-                             char ***events)
-{
-    int ret = -1;
-    virJSONValuePtr cmd;
-    virJSONValuePtr reply = NULL;
-    virJSONValuePtr data;
-    char **eventlist = NULL;
-    size_t n = 0;
-    size_t i;
-
-    *events = NULL;
-
-    if (!(cmd = qemuMonitorJSONMakeCommand("query-events", NULL)))
-        return -1;
-
-    if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
-        goto cleanup;
-
-    if (qemuMonitorJSONHasError(reply, "CommandNotFound")) {
-        ret = 0;
-        goto cleanup;
-    }
-
-    if (qemuMonitorJSONCheckReply(cmd, reply, VIR_JSON_TYPE_ARRAY) < 0)
-        goto cleanup;
-
-    data = virJSONValueObjectGetArray(reply, "return");
-    n = virJSONValueArraySize(data);
-
-    /* null-terminated list */
-    eventlist = g_new0(char *, n + 1);
-
-    for (i = 0; i < n; i++) {
-        virJSONValuePtr child = virJSONValueArrayGet(data, i);
-        const char *tmp;
-
-        if (!(tmp = virJSONValueObjectGetString(child, "name"))) {
-            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                           _("query-events reply data was missing 'name'"));
-            goto cleanup;
-        }
-
-        eventlist[i] = g_strdup(tmp);
-    }
-
-    ret = n;
-    *events = g_steal_pointer(&eventlist);
-
- cleanup:
-    g_strfreev(eventlist);
-    virJSONValueFree(cmd);
-    virJSONValueFree(reply);
-    return ret;
-}
-
-
 static int
 qemuMonitorJSONGetCommandLineOptionsWorker(size_t pos G_GNUC_UNUSED,
                                            virJSONValuePtr item,
diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h
index 8d4232f67b..9e046df9fe 100644
--- a/src/qemu/qemu_monitor_json.h
+++ b/src/qemu/qemu_monitor_json.h
@@ -420,9 +420,6 @@ int qemuMonitorJSONGetCPUModelComparison(qemuMonitorPtr mon,
 int qemuMonitorJSONGetCommands(qemuMonitorPtr mon,
                                char ***commands)
     ATTRIBUTE_NONNULL(2);
-int qemuMonitorJSONGetEvents(qemuMonitorPtr mon,
-                             char ***events)
-    ATTRIBUTE_NONNULL(2);
 GHashTable *qemuMonitorJSONGetCommandLineOptions(qemuMonitorPtr mon);

 int qemuMonitorJSONGetKVMState(qemuMonitorPtr mon,
-- 
2.30.2

Reply via email to