From nobody Tue Sep 9 13:53:14 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1756307311; cv=none; d=zohomail.com; s=zohoarc; b=VFTEr0PiyOV0fKua1U67MFAp68Vdf8BcesxSrbwu3ROx2cKR/56DPGOfcG1yC0tiYkGRSQV5aQyHivQElcFT7Apa9LNK2trDcN5otfrKXgka4BTu2XL960FmO+CxZ+C3YNhIwBz6p+VfKuy2sFzdh5hZFmN4/bfImQXTZrt/Oks= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756307311; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=bcgbs18lNFHy4E91YYvY/qjJS0vwLSgznS9mjkbgZfs=; b=Z/TemByMfScIXea0cjq3/0n0+TxS36Ku1a9CNXWrW0A5985vs1ywAf7TjqPw1EVNsJkg/ih2786XXyeAGJxLiKRMlpeyuj99oKIMnRz38nqJ/CaPN3fKHvF7BcHTrUBnNbIITTCE7bVOP6RM1Rs2Y2iQj+Ae8/QYCX9KVskly9w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1756307311019354.9200386206186; Wed, 27 Aug 2025 08:08:31 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 0B11D4401B; Wed, 27 Aug 2025 11:08:18 -0400 (EDT) Received: from [172.19.199.3] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id CE6E9442AB; Wed, 27 Aug 2025 10:48:49 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 728634402E; Wed, 27 Aug 2025 10:47:30 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id B42EC44013 for ; Wed, 27 Aug 2025 10:47:12 -0400 (EDT) Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-199-mCBK0BdzOcqXgHR4AJvlMA-1; Wed, 27 Aug 2025 10:47:06 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 23D2F195609F for ; Wed, 27 Aug 2025 14:47:04 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.44.22.3]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5D48030001A5 for ; Wed, 27 Aug 2025 14:47:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1756306032; h=from:from: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; bh=bcgbs18lNFHy4E91YYvY/qjJS0vwLSgznS9mjkbgZfs=; b=P/o26BjMqrd6ofa3l2Bmekn80lWmDj4l8tjR8GgtAtaEaQiLys6S+crmm4km1czN6Dmpaz lH7S+g31yHJikxqtLPtpqridPUCeoRSEEiD5LUc6+Jkt7Ttv3r2Z35zx1G1nLF65eR71jJ 9Gef6bhOvAOwou1EYejBw5mZX/jUZ54= X-MC-Unique: mCBK0BdzOcqXgHR4AJvlMA-1 X-Mimecast-MFC-AGG-ID: mCBK0BdzOcqXgHR4AJvlMA_1756306025 To: devel@lists.libvirt.org Subject: [PATCH 06/10] qemu: monitor: Remove query-tpm-modes/query-tpm-types infrastructure Date: Wed, 27 Aug 2025 16:46:49 +0200 Message-ID: <46aa8e5037c7605eeec31ca0fe0e052a43eda9b3.1756305881.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: v_biCV81nG6CbNDTRraJBY4UbFAqWqStHn4iCcsKbkE_1756306025 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: RV7ANPWMBA2IMSH5GR4LYMQQK3QWEENC X-Message-ID-Hash: RV7ANPWMBA2IMSH5GR4LYMQQK3QWEENC X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1756307313997124100 Content-Type: text/plain; charset="utf-8" From: Peter Krempa The query commands are not used since we can probe the supported types and models via qom types. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor.c | 24 ------------------ src/qemu/qemu_monitor.h | 6 ----- src/qemu/qemu_monitor_json.c | 43 --------------------------------- src/qemu/qemu_monitor_json.h | 10 -------- tests/qemumonitorjsontest.c | 47 ------------------------------------ 5 files changed, 130 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index c1fef8d5de..3adce735e1 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3585,30 +3585,6 @@ qemuMonitorBlockExportAdd(qemuMonitor *mon, } -int -qemuMonitorGetTPMModels(qemuMonitor *mon, - char ***tpmmodels) -{ - VIR_DEBUG("tpmmodels=3D%p", tpmmodels); - - QEMU_CHECK_MONITOR(mon); - - return qemuMonitorJSONGetTPMModels(mon, tpmmodels); -} - - -int -qemuMonitorGetTPMTypes(qemuMonitor *mon, - char ***tpmtypes) -{ - VIR_DEBUG("tpmtypes=3D%p", tpmtypes); - - QEMU_CHECK_MONITOR(mon); - - return qemuMonitorJSONGetTPMTypes(mon, tpmtypes); -} - - int qemuMonitorAttachCharDev(qemuMonitor *mon, virJSONValue **props, diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 755f347e17..8061b95bf2 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1242,12 +1242,6 @@ int qemuMonitorNBDServerStop(qemuMonitor *mon); int qemuMonitorBlockExportAdd(qemuMonitor *mon, virJSONValue **props); -int qemuMonitorGetTPMModels(qemuMonitor *mon, - char ***tpmmodels); - -int qemuMonitorGetTPMTypes(qemuMonitor *mon, - char ***tpmtypes); - int qemuMonitorAttachCharDev(qemuMonitor *mon, virJSONValue **props, char **ptypath); diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 9f51421478..54c4e80578 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -6496,49 +6496,6 @@ qemuMonitorJSONBlockExportAdd(qemuMonitor *mon, } -static int -qemuMonitorJSONGetStringArray(qemuMonitor *mon, - const char *qmpCmd, - char ***array) -{ - g_autoptr(virJSONValue) cmd =3D NULL; - g_autoptr(virJSONValue) reply =3D NULL; - virJSONValue *data; - - *array =3D NULL; - - if (!(cmd =3D qemuMonitorJSONMakeCommand(qmpCmd, NULL))) - return -1; - - if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) - return -1; - - if (qemuMonitorJSONHasError(reply, "CommandNotFound")) - return 0; - - if (!(data =3D qemuMonitorJSONGetReply(cmd, reply, VIR_JSON_TYPE_ARRAY= ))) - return -1; - - if (!(*array =3D virJSONValueArrayToStringList(data))) - return -1; - - return 0; -} - -int qemuMonitorJSONGetTPMModels(qemuMonitor *mon, - char ***tpmmodels) -{ - return qemuMonitorJSONGetStringArray(mon, "query-tpm-models", tpmmodel= s); -} - - -int qemuMonitorJSONGetTPMTypes(qemuMonitor *mon, - char ***tpmtypes) -{ - return qemuMonitorJSONGetStringArray(mon, "query-tpm-types", tpmtypes); -} - - int qemuMonitorJSONAttachCharDev(qemuMonitor *mon, virJSONValue **props, diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index bd437f7938..f076e637ba 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -546,16 +546,6 @@ int qemuMonitorJSONBlockExportAdd(qemuMonitor *mon, virJSONValue **props); -int -qemuMonitorJSONGetTPMModels(qemuMonitor *mon, - char ***tpmmodels) - ATTRIBUTE_NONNULL(2); - -int -qemuMonitorJSONGetTPMTypes(qemuMonitor *mon, - char ***tpmtypes) - ATTRIBUTE_NONNULL(2); - int qemuMonitorJSONAttachCharDev(qemuMonitor *mon, virJSONValue **props, diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index a18872db60..df64b1f115 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -492,52 +492,6 @@ testQemuMonitorJSONGetCPUDefinitions(const void *opaqu= e) } -static int -testQemuMonitorJSONGetTPMModels(const void *opaque) -{ - const testGenericData *data =3D opaque; - virDomainXMLOption *xmlopt =3D data->xmlopt; - g_auto(GStrv) tpmmodels =3D NULL; - g_autoptr(qemuMonitorTest) test =3D NULL; - - if (!(test =3D qemuMonitorTestNewSchema(xmlopt, data->schema))) - return -1; - - if (qemuMonitorTestAddItem(test, "query-tpm-models", - "{ " - " \"return\": [ " - " \"passthrough\"" - " ]" - "}") < 0) - return -1; - - if (qemuMonitorGetTPMModels(qemuMonitorTestGetMonitor(test), &tpmmodel= s) < 0) - return -1; - - if (g_strv_length(tpmmodels) !=3D 1) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - "expected 1 tpm model"); - return -1; - } - -#define CHECK(i, wantname) \ - do { \ - if (STRNEQ(tpmmodels[i], (wantname))) { \ - virReportError(VIR_ERR_INTERNAL_ERROR, \ - "name %s is not %s", \ - tpmmodels[i], (wantname)); \ - return -1; \ - } \ - } while (0) - - CHECK(0, "passthrough"); - -#undef CHECK - - return 0; -} - - struct qemuMonitorJSONTestAttachChardevData { virDomainChrSourceDef *chr; const char *expectPty; @@ -2998,7 +2952,6 @@ mymain(void) DO_TEST(GetVersion); DO_TEST(GetMachines); DO_TEST(GetCPUDefinitions); - DO_TEST(GetTPMModels); if (qemuMonitorJSONTestAttachChardev(driver.xmlopt, qapiData.schema) <= 0) ret =3D -1; DO_TEST(DetachChardev); --=20 2.51.0