From nobody Sun Feb 8 17:41:25 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1617980645; cv=none; d=zohomail.com; s=zohoarc; b=jWCr6ISAEQndKqW4QB9CnviQdxMB4rkrKIHW3TjBKJBq+SCmAjFz4HYTQUAwaRR4jhuWnXO2MIjcbQNCzTvhF9WnsxnIA2eOKLbRIFQ8RJl9h0NewaEvWeR7b8C96ttWCHpi3X0GRmwy+KFOzi0FcKIV2JkdbDIBy1hSOgHwdL0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617980645; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=WcJreajJxOmi6x6vxYDgCiURZ/QVCVcnw6hUO3QnF5Q=; b=PoC4+SpuBiEwDTglMxb/TR0Q2xm//RWd009HD5dSYSN8YlZvh62ALfrvLUVhIOQa+Urh+DJ1DZ82o+kYyaus6t12+0oYlhrMCl3zOelQdAk6jW6KNZwxtPQI8ZjZiWKB+TQLELEfG8XaX7xYKTy/byBIoRpykU+s8f/ZOg/Flmo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1617980645953303.19399152946085; Fri, 9 Apr 2021 08:04:05 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-269-0hFX5UloPx2vGg3HcI4QcQ-1; Fri, 09 Apr 2021 11:01:51 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 441F6DF8B4; Fri, 9 Apr 2021 15:01:43 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1D0942B9FA; Fri, 9 Apr 2021 15:01:43 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id CED535535B; Fri, 9 Apr 2021 15:01:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 139EwP0i024072 for ; Fri, 9 Apr 2021 10:58:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id A494414106; Fri, 9 Apr 2021 14:58:25 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id 125B660D79 for ; Fri, 9 Apr 2021 14:58:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617980644; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=WcJreajJxOmi6x6vxYDgCiURZ/QVCVcnw6hUO3QnF5Q=; b=Rf7fK+Uf+V7EVMViBpv8Xrg9CuxtJkXOr9jhfqa9JCpapNI/PE0BxGE6Bstr37W5HhVsVc 0v2bC/Muqb3dO4XiHiCuMZJ6jFCij6DKjD14OusfUxOelFOBjIZYLRUa/m5NclP/gzan0r gv07PgOBYiuQ8kSuvyYo1re4Qv22TfM= X-MC-Unique: 0hFX5UloPx2vGg3HcI4QcQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [RFC PATCH 39/43] qemu: monitor: Remove qemuMonitorGetEvents Date: Fri, 9 Apr 2021 16:57:15 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Modern code uses QMP schema to query for supported event types. Signed-off-by: Peter Krempa --- 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=3D%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 qemuMonitorCPUModel= Info *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 =3D -1; - virJSONValuePtr cmd; - virJSONValuePtr reply =3D NULL; - virJSONValuePtr data; - char **eventlist =3D NULL; - size_t n =3D 0; - size_t i; - - *events =3D NULL; - - if (!(cmd =3D qemuMonitorJSONMakeCommand("query-events", NULL))) - return -1; - - if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) - goto cleanup; - - if (qemuMonitorJSONHasError(reply, "CommandNotFound")) { - ret =3D 0; - goto cleanup; - } - - if (qemuMonitorJSONCheckReply(cmd, reply, VIR_JSON_TYPE_ARRAY) < 0) - goto cleanup; - - data =3D virJSONValueObjectGetArray(reply, "return"); - n =3D virJSONValueArraySize(data); - - /* null-terminated list */ - eventlist =3D g_new0(char *, n + 1); - - for (i =3D 0; i < n; i++) { - virJSONValuePtr child =3D virJSONValueArrayGet(data, i); - const char *tmp; - - if (!(tmp =3D virJSONValueObjectGetString(child, "name"))) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("query-events reply data was missing 'name'")= ); - goto cleanup; - } - - eventlist[i] =3D g_strdup(tmp); - } - - ret =3D n; - *events =3D 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, --=20 2.30.2