From nobody Mon Feb 9 09:22:24 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1618835997; cv=none; d=zohomail.com; s=zohoarc; b=NqSctwm6Qq0x4XAyU/2IrYnSq+QPBVq0HquM7+07toDXL20pYf5vzBEtPtBPd/NcgxanlhjATTFM3i6oFGVgULg4Ws3c2OfdcwoEe8Cxhvd7/HxpaZZB01nuS3VnbMeaMPE8ZU8fqnlYwsKxoRwuQXOZnhGvJa+w/pyPIvhtnw8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618835997; 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=Zpd6EiG52KkBlkqRClTLZGM/r1tjUjPGStgF4cSJtD0=; b=egNFBnTV7QnbuGRQVKIHyV8Be23WScMyFpakI6dbWnMqldIAvSXFo5ADpLYJPBbhwyUZRBMfHFK5RaEWfmo/AIaZv2fWCVm+Hy2Ngm4SVzR5O0rOHu7T3i+8cTfp6ZTOjFBdsEQaIGSTfjw3aO8x5zrkb2xNmOQsMpBdQJO2c0E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1618835997270384.51112824602205; Mon, 19 Apr 2021 05:39:57 -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-401-UYzT8NT_ODWkDjrTEuHwjA-1; Mon, 19 Apr 2021 08:39:54 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4B37E87DAF8; Mon, 19 Apr 2021 12:39:47 +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 223D810023AE; Mon, 19 Apr 2021 12:39:47 +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 D8F3D55359; Mon, 19 Apr 2021 12:39:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 13JCaVvl019331 for ; Mon, 19 Apr 2021 08:36:31 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7F1EE19C79; Mon, 19 Apr 2021 12:36:31 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id C23E319C66 for ; Mon, 19 Apr 2021 12:36:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618835996; 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=Zpd6EiG52KkBlkqRClTLZGM/r1tjUjPGStgF4cSJtD0=; b=OMRpEuzQqa7vYbpsZ3AFGnF1wGMXx7lxtiZ+va8ylfQRhzB6kcOmxacf+jA0iDjRAz94jz tx7ph2k8xRwxGXp9j+nx/aJT7Vv6uyox+CDA6aMOcGkmiGUAVRnz64YPl52Z0jOcr/iIzJ PdAKaxp+VJxQ9OUFoNEuzAM2RFjwapc= X-MC-Unique: UYzT8NT_ODWkDjrTEuHwjA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 28/38] qemu: monitor: Remove qemuMonitorGetEvents Date: Mon, 19 Apr 2021 14:35:32 +0200 Message-Id: <43551497c582787d6cb5f3edd91f75304a9589c5.1618834490.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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.84 on 10.5.11.22 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 Reviewed-by: Pavel Hrdina Reviewed-by: Neal Gompa --- 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 f3f14c46b6..f28023e957 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3830,18 +3830,6 @@ qemuMonitorGetCommands(qemuMonitor *mon, } -int -qemuMonitorGetEvents(qemuMonitor *mon, - char ***events) -{ - VIR_DEBUG("events=3D%p", events); - - QEMU_CHECK_MONITOR(mon); - - return qemuMonitorJSONGetEvents(mon, events); -} - - GHashTable * qemuMonitorGetCommandLineOptions(qemuMonitor *mon) { diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 230d00a894..a39e8e6e82 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1244,8 +1244,6 @@ qemuMonitorCPUModelInfoCopy(const qemuMonitorCPUModel= Info *orig); int qemuMonitorGetCommands(qemuMonitor *mon, char ***commands); -int qemuMonitorGetEvents(qemuMonitor *mon, - char ***events); GHashTable *qemuMonitorGetCommandLineOptions(qemuMonitor *mon); int qemuMonitorGetKVMState(qemuMonitor *mon, diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 652034472a..534ab75c2c 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -6274,63 +6274,6 @@ int qemuMonitorJSONGetCommands(qemuMonitor *mon, } -int qemuMonitorJSONGetEvents(qemuMonitor *mon, - char ***events) -{ - int ret =3D -1; - virJSONValue *cmd; - virJSONValue *reply =3D NULL; - virJSONValue *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++) { - virJSONValue *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, virJSONValue *item, diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index 0846325a81..97b8d2a991 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -420,9 +420,6 @@ int qemuMonitorJSONGetCPUModelComparison(qemuMonitor *m= on, 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, --=20 2.30.2