]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: monitor: Remove qemuMonitorGetEvents
authorPeter Krempa <pkrempa@redhat.com>
Wed, 7 Apr 2021 15:14:22 +0000 (17:14 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 3 May 2021 10:14:44 +0000 (12:14 +0200)
Modern code uses QMP schema to query for supported event types.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
src/qemu/qemu_monitor.c
src/qemu/qemu_monitor.h
src/qemu/qemu_monitor_json.c
src/qemu/qemu_monitor_json.h

index 23161a0088358c67fa4d8aa8246bf1381d84146a..8b8db20a01407bad705237711c0e9c1fa3d593dc 100644 (file)
@@ -3818,18 +3818,6 @@ qemuMonitorGetCommands(qemuMonitor *mon,
 }
 
 
-int
-qemuMonitorGetEvents(qemuMonitor *mon,
-                     char ***events)
-{
-    VIR_DEBUG("events=%p", events);
-
-    QEMU_CHECK_MONITOR(mon);
-
-    return qemuMonitorJSONGetEvents(mon, events);
-}
-
-
 GHashTable *
 qemuMonitorGetCommandLineOptions(qemuMonitor *mon)
 {
index 420a85942a5bfb55f5a45b37a8f08b1cfeb5a36a..f917098324759933ec2e80f2adf8ba4ee9ddbf9f 100644 (file)
@@ -1240,8 +1240,6 @@ qemuMonitorCPUModelInfoCopy(const qemuMonitorCPUModelInfo *orig);
 
 int qemuMonitorGetCommands(qemuMonitor *mon,
                            char ***commands);
-int qemuMonitorGetEvents(qemuMonitor *mon,
-                         char ***events);
 GHashTable *qemuMonitorGetCommandLineOptions(qemuMonitor *mon);
 
 int qemuMonitorGetKVMState(qemuMonitor *mon,
index 8de0e4b638043e66da7ed3177dceab7cb1a21a6c..639e10e4885fd5a84b7c21bed57b8553f3eb674d 100644 (file)
@@ -6242,63 +6242,6 @@ int qemuMonitorJSONGetCommands(qemuMonitor *mon,
 }
 
 
-int qemuMonitorJSONGetEvents(qemuMonitor *mon,
-                             char ***events)
-{
-    int ret = -1;
-    virJSONValue *cmd;
-    virJSONValue *reply = NULL;
-    virJSONValue *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++) {
-        virJSONValue *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,
                                            virJSONValue *item,
index 8d8f2de479f40273e1cc1b7fe0fe8eb6f01b2f89..c6b0d606f6e6f2183455c6054f5447cb61683758 100644 (file)
@@ -416,9 +416,6 @@ int qemuMonitorJSONGetCPUModelComparison(qemuMonitor *mon,
 int qemuMonitorJSONGetCommands(qemuMonitor *mon,
                                char ***commands)
     ATTRIBUTE_NONNULL(2);
-int qemuMonitorJSONGetEvents(qemuMonitor *mon,
-                             char ***events)
-    ATTRIBUTE_NONNULL(2);
 GHashTable *qemuMonitorJSONGetCommandLineOptions(qemuMonitor *mon);
 
 int qemuMonitorJSONGetKVMState(qemuMonitor *mon,