From nobody Sun Feb 8 20:12:40 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1689341686; cv=none; d=zohomail.com; s=zohoarc; b=mS8ZWxqbwnYNRvAl1VrlVlj9qCX9cO0Gl+vkW3tZ6z1dJno0rFdv0p+uttHKYxkquhNgJJA2x7HcU5q0KLKzn4HxCuf0+Uj61bEHpGAV/C94U2Qkcj8o1pQDyHKegLN3CnKSSGowKdEvRKez8FhsgvWlqCjnZ9GK0PFbN6q16wg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689341686; 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=xeqxh9hLTbMp6Aq2oW1wIADSSCe/qNOS2A49Osn+zKs=; b=PzWc2PC9EmPrESo11DVte9UkjE17qA7NJdKPY66d4X3jyf9nd1N2ACnZ6Yy+nc2+pgHpFq7LO91CytiK1L25GjA0HHag/zXs2Z1euEf3L/qTXrkNLEPirIjRzupZbGv7K4vGZzTPMNTNTSDO2Xj4hPG3+Oi50mGdMJ1CpSJePMs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1689341686722517.7346827424875; Fri, 14 Jul 2023 06:34:46 -0700 (PDT) Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-85-aG10AQqvO-eJa_2enddL4Q-1; Fri, 14 Jul 2023 09:34:37 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7CB1F3C0FCA9; Fri, 14 Jul 2023 13:33:59 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6A1C2C57963; Fri, 14 Jul 2023 13:33:59 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 14A231946594; Fri, 14 Jul 2023 13:33:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5FDB2194658F for ; Fri, 14 Jul 2023 13:33:57 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 439B910C9D; Fri, 14 Jul 2023 13:33:57 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id C48AA10C95 for ; Fri, 14 Jul 2023 13:33:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689341685; 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=xeqxh9hLTbMp6Aq2oW1wIADSSCe/qNOS2A49Osn+zKs=; b=ZYinwgbeSp6Wu060nSvusQetjw8YcqoUTpZIPyAJI3sMoztEAnQLq9Q9stpyF9coAk2Xgr K5OLIOXvGw8Hmwd//Uq/cAHv6d4Zvc9ZPNFxqiPqeXTKUH8gfHT9z2RRQRqvVnk7KnUvOp aLsah47ltutrrvNDruy34718w7erSI0= X-MC-Unique: aG10AQqvO-eJa_2enddL4Q-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/3] qemu: capabilities: Probe presence of commands from QMP schema instead of 'query-commands' Date: Fri, 14 Jul 2023 15:33:52 +0200 Message-ID: <46ebb08aff810e28964abb9803a2c5bbc4a6da60.1689341565.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1689341687518100001 Content-Type: text/plain; charset="utf-8" Move the probing code to extract the data from the QMP schema rather than invoking 'query-commands'. This patch doesn't yet remove the actual invocation of 'query-commands', just moves the actual probing. Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index c9f4b17208..76f3c78617 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2605,7 +2605,7 @@ virQEMUCapsGetSGXCapabilities(virQEMUCaps *qemuCaps) static int -virQEMUCapsProbeQMPCommands(virQEMUCaps *qemuCaps, +virQEMUCapsProbeQMPCommands(virQEMUCaps *qemuCaps G_GNUC_UNUSED, qemuMonitor *mon) { g_auto(GStrv) commands =3D NULL; @@ -2613,11 +2613,6 @@ virQEMUCapsProbeQMPCommands(virQEMUCaps *qemuCaps, if (qemuMonitorGetCommands(mon, &commands) < 0) return -1; - virQEMUCapsProcessStringFlags(qemuCaps, - G_N_ELEMENTS(virQEMUCapsCommands), - virQEMUCapsCommands, - commands); - return 0; } @@ -5523,7 +5518,6 @@ static int virQEMUCapsProbeQMPSchemaCapabilities(virQEMUCaps *qemuCaps, qemuMonitor *mon) { - struct virQEMUCapsStringFlags *entry; virJSONValue *schemareply; g_autoptr(GHashTable) schema =3D NULL; size_t i; @@ -5536,12 +5530,19 @@ virQEMUCapsProbeQMPSchemaCapabilities(virQEMUCaps *= qemuCaps, schemareply =3D NULL; for (i =3D 0; i < G_N_ELEMENTS(virQEMUCapsQMPSchemaQueries); i++) { - entry =3D virQEMUCapsQMPSchemaQueries + i; + struct virQEMUCapsStringFlags *entry =3D virQEMUCapsQMPSchemaQueri= es + i; if (virQEMUQAPISchemaPathExists(entry->value, schema)) virQEMUCapsSet(qemuCaps, entry->flag); } + for (i =3D 0; i < G_N_ELEMENTS(virQEMUCapsCommands); i++) { + struct virQEMUCapsStringFlags *cmd =3D virQEMUCapsCommands + i; + + if (virQEMUQAPISchemaPathExists(cmd->value, schema)) + virQEMUCapsSet(qemuCaps, cmd->flag); + } + return 0; } --=20 2.41.0