From nobody Mon Sep 8 17:03:35 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=1756999010; cv=none; d=zohomail.com; s=zohoarc; b=HV+2Zg98r7YREgsnNVkeO3ME9yjF29V73zYsrCbtuT9INcHWMrFg5NUQmhmiVLktPUXxfAn78UJri3Dw27xdMUIVElhk3ORhVJM4wcrR+DPpaP06MmgM3Ra2+OfgOfMX2ay0uaaPXFwnsXE/R016mNO4j05UbyclH/oboXzVwNo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756999010; 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=Ut0yzp4cXeEJUlJUDIDi9IacUgDJUttIcASi8DYIQOU=; b=kEypcgtO+1HOK+dBdCTau6W1ZyS7NfhQ7F86jLEFOuR/9hIumjAvyMPFmdEMW1OevERQ1GlzNkYwmyJVvDxlRSvXDkNwlE+85q5peiPzKod+rnDRx6rX0JO4SBe9dSm8ZLvQZZO18nLDcHAKF5XtRkufY06WW27nrk8JLfsBjoE= 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 1756999010117232.2558232602927; Thu, 4 Sep 2025 08:16:50 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id EBF4A3F360; Thu, 4 Sep 2025 11:16:47 -0400 (EDT) Received: from [172.19.199.3] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 0446B44674; Thu, 4 Sep 2025 10:51:10 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 60ACC443DC; Thu, 4 Sep 2025 10:50:59 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 2DBBE442F6 for ; Thu, 4 Sep 2025 10:47:34 -0400 (EDT) Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-606-9LceNV_cNleS8uV0ER3Gmg-1; Thu, 04 Sep 2025 10:47:32 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id F1793180057A for ; Thu, 4 Sep 2025 14:47:31 +0000 (UTC) Received: from orkuz (unknown [10.43.3.115]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7FDFD1800452 for ; Thu, 4 Sep 2025 14:47:31 +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=1756997253; 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=Ut0yzp4cXeEJUlJUDIDi9IacUgDJUttIcASi8DYIQOU=; b=C0MfYIR0J1lYn7IFImcUxmUeT09Topd0qrOMLdnExwZjg3Mv8JNHMQU1hRHC7vkRVZOUXn dDrqdJ51pTbs4YAFpqNg5/L9HdbDLtPePrOI8WoG4/6Fspigq7RN63AnBcpQysT30zMUeF avXdl/q/63lUkb0tGnPOroGQG4sZhK0= X-MC-Unique: 9LceNV_cNleS8uV0ER3Gmg-1 X-Mimecast-MFC-AGG-ID: 9LceNV_cNleS8uV0ER3Gmg_1756997252 To: devel@lists.libvirt.org Subject: [PATCH 12/14] qemu: Merge qemuMonitorJSONGetCPUDataDisabled in qemuMonitorJSONGetGuestCPU Date: Thu, 4 Sep 2025 16:47:00 +0200 Message-ID: <46b64b669a1bfe4e8f6c72ed803d8a8ca392007e.1756996034.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 2hCd6KMMdEtPp_YhyCR4NuD_BIAgOWOn2-uPmJx5_ok_1756997252 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: C3KLX4DHSHMWGBKFKWFVW6QTNLPTZ5ET X-Message-ID-Hash: C3KLX4DHSHMWGBKFKWFVW6QTNLPTZ5ET 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: 1756999011573116600 Content-Type: text/plain; charset="utf-8" From: Jiri Denemark The qemuMonitorJSONGetCPUDataDisabled 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 | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 06e0f3794e..6b736aefd0 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 -qemuMonitorJSONGetCPUDataDisabled(qemuMonitor *mon, - const char *cpuQOMPath, - qemuMonitorCPUFeatureTranslationCallback= translate, - virCPUData *data) -{ - g_auto(GStrv) props =3D NULL; - - if (qemuMonitorJSONGetStringListProperty(mon, cpuQOMPath, - "unavailable-features", &prop= s) < 0) - return -1; - - if (qemuMonitorJSONCPUDataAddFeatures(data, props, translate) < 0) - return -1; - - return 0; -} - - /** * qemuMonitorJSONGetGuestCPU: * @mon: Pointer to the monitor @@ -6772,6 +6753,7 @@ qemuMonitorJSONGetGuestCPU(qemuMonitor *mon, g_autoptr(virCPUData) cpuEnabled =3D NULL; g_autoptr(virCPUData) cpuDisabled =3D NULL; g_auto(GStrv) propsEnabled =3D NULL; + g_auto(GStrv) propsDisabled =3D NULL; =20 if (!(cpuEnabled =3D virCPUDataNew(arch)) || !(cpuDisabled =3D virCPUDataNew(arch))) @@ -6784,7 +6766,11 @@ qemuMonitorJSONGetGuestCPU(qemuMonitor *mon, if (qemuMonitorJSONCPUDataAddFeatures(cpuEnabled, propsEnabled, transl= ate) < 0) return -1; =20 - if (qemuMonitorJSONGetCPUDataDisabled(mon, cpuQOMPath, translate, cpuD= isabled) < 0) + if (qemuMonitorJSONGetStringListProperty(mon, cpuQOMPath, + "unavailable-features", &prop= sDisabled) < 0) + return -1; + + if (qemuMonitorJSONCPUDataAddFeatures(cpuDisabled, propsDisabled, tran= slate) < 0) return -1; =20 *enabled =3D g_steal_pointer(&cpuEnabled); --=20 2.51.0