From nobody Mon Sep 8 20:24:50 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=1756998850; cv=none; d=zohomail.com; s=zohoarc; b=MSKCEj6rF66VfDEJ6iGuv2ep2zoYAFf+C4F77HKWLRnqx2GmoSDbFfIQ80klKZikcOtFY417daoICtqpEl6WbzCEWBI/Lef526VmFaVqC1wHJyIGJsjwXJfFS8DilApWmOSHHV0bNCETGQfgwR8zjbtni95vUY+qetyxigiOdU8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756998850; 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=H44g/OLyCMN0+6PqPvxMhk12ImFQDGhZYS/hj1MKSEg=; b=dZU5WRZnrRCk+ubwCU3Zlijr3+kmLrZr07nhHSYADrt7TD1v/GJhol4iPYdCv6ktX+GQqp5aNVrdLOqSjVRLwDJJVlSSxzZ66eq5KTsXOvN9PMOjsFIWpBNkDkYS7Y1gVO+RJBLA+xW95TcI4Xl3a43rA8rxuISLfqPEtJIBQ1s= 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 17569988501871003.3309007744597; Thu, 4 Sep 2025 08:14:10 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 5DED544400; Thu, 4 Sep 2025 11:14:08 -0400 (EDT) Received: from [172.19.199.3] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 2486A44615; Thu, 4 Sep 2025 10:49:21 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id AA2E4443BB; Thu, 4 Sep 2025 10:48:56 -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 48983443BB for ; Thu, 4 Sep 2025 10:47:30 -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-307-GgUkq3nKPmikFGYwNLJPhQ-1; Thu, 04 Sep 2025 10:47:28 -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 5CDAB1955F0D for ; Thu, 4 Sep 2025 14:47:27 +0000 (UTC) Received: from orkuz (unknown [10.43.3.115]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id DF75D3002D29 for ; Thu, 4 Sep 2025 14:47:26 +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=-3.1 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, 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=1756997249; 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=H44g/OLyCMN0+6PqPvxMhk12ImFQDGhZYS/hj1MKSEg=; b=aXKsS+ffG6xUVqWsTJYMgyw+Yi9OY2PMlHm1NX/qKVIYuAj9NQkK/HXvmCA7hI34b2x3iV KebpjtiOv+iTe7l9TDUFVAF2FrBEWNNkyWOUJxilgK8lVEUmbGVtLQkxpj5h9GyStg1ihm n45TYZxSJ8lUJyyf+Q1SwUGIYGR+p0M= X-MC-Unique: GgUkq3nKPmikFGYwNLJPhQ-1 X-Mimecast-MFC-AGG-ID: GgUkq3nKPmikFGYwNLJPhQ_1756997247 To: devel@lists.libvirt.org Subject: [PATCH 10/14] qemu: Merge qemuMonitorJSONGetCPUData in qemuMonitorJSONGetGuestCPU Date: Thu, 4 Sep 2025 16:46:58 +0200 Message-ID: <20645a61f923297335f563f42d260cff3ea629cc.1756996034.git.jdenemar@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: KDP89VUyr4FMhl-vInupw0IjH7jW4OPFXDbHAVDc_mo_1756997247 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: GIRDVKQSW52JUNJYN77R3NFV2CABIDQJ X-Message-ID-Hash: GIRDVKQSW52JUNJYN77R3NFV2CABIDQJ X-MailFrom: jdenemar@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: Jiri Denemark via Devel Reply-To: Jiri Denemark X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1756998852009124100 Content-Type: text/plain; charset="utf-8" From: Jiri Denemark The qemuMonitorJSONGetCPUData function is just a wrapper around two function calls and it is only used by qemuMonitorJSONGetGuestCPU. Signed-off-by: Jiri Denemark Reviewed-by: Peter Krempa --- src/qemu/qemu_monitor_json.c | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index a831e9e26c..6fa2f447db 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -6724,25 +6724,6 @@ qemuMonitorJSONCPUDataAddFeatures(virCPUData *data, } =20 =20 -static int -qemuMonitorJSONGetCPUData(qemuMonitor *mon, - bool qomListGet, - const char *cpuQOMPath, - qemuMonitorCPUFeatureTranslationCallback transla= te, - virCPUData *data) -{ - g_auto(GStrv) props =3D NULL; - - if (qemuMonitorJSONGetCPUProperties(mon, qomListGet, cpuQOMPath, &prop= s) < 0) - return -1; - - if (qemuMonitorJSONCPUDataAddFeatures(data, props, translate) < 0) - return -1; - - return 0; -} - - static int qemuMonitorJSONGetCPUDataDisabled(qemuMonitor *mon, const char *cpuQOMPath, @@ -6790,13 +6771,17 @@ qemuMonitorJSONGetGuestCPU(qemuMonitor *mon, { g_autoptr(virCPUData) cpuEnabled =3D NULL; g_autoptr(virCPUData) cpuDisabled =3D NULL; + g_auto(GStrv) propsEnabled =3D NULL; =20 if (!(cpuEnabled =3D virCPUDataNew(arch)) || !(cpuDisabled =3D virCPUDataNew(arch))) return -1; =20 - if (qemuMonitorJSONGetCPUData(mon, qomListGet, cpuQOMPath, - translate, cpuEnabled) < 0) + if (qemuMonitorJSONGetCPUProperties(mon, qomListGet, cpuQOMPath, + &propsEnabled) < 0) + return -1; + + if (qemuMonitorJSONCPUDataAddFeatures(cpuEnabled, propsEnabled, transl= ate) < 0) return -1; =20 if (disabled && --=20 2.51.0