From nobody Mon Sep 8 17:08:18 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=1756999102; cv=none; d=zohomail.com; s=zohoarc; b=SaklmfpdJIEycjpBD/AHttlCaghm4+oK7PhD+G2lvCuuEVMiUwuch8vpwNlqcBi20jV+n80GIMv/QI/7EnTWDv7oH2PyOcs6UGqXSKjMlxxeDbcGF5802/uIkmFoE1IQmH44JJaCdw6RUrFBzw8bnyVP1h9iQWTwlX2+JUqgVn4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756999102; 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=jMFOzfh57/aa+nKBeULzXsHBwAuKL0DOFNqpfPsVB48=; b=g2EOs5Fe3oTBuIPR8XpwHj0BjyQKVQx1+SI7I0dQHTgZxilaafgGHZZu5z/tV06IO+e03zbqBPoPeo8uH3R3u3+OHKWlHK4IKxB2XAK44Wy/qF7MIkLKR/k0nFAPdVv0W2OLl9gMe98VR8nZFO4les+1a+rCgB8mGDt7+VEc9ts= 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 17569991027771006.8197726187991; Thu, 4 Sep 2025 08:18:22 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id B28BD44315; Thu, 4 Sep 2025 11:18:21 -0400 (EDT) Received: from [172.19.199.3] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 28319446AF; Thu, 4 Sep 2025 10:51:38 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 3478344364; Thu, 4 Sep 2025 10:51:26 -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 7B127443CA for ; Thu, 4 Sep 2025 10:47:36 -0400 (EDT) Received: from mx-prod-mc-02.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-39-pX7jfQwnMBqcR0K-Q5yeYA-1; Thu, 04 Sep 2025 10:47:34 -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-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DD75919560AB for ; Thu, 4 Sep 2025 14:47:33 +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 6B2813002D29 for ; Thu, 4 Sep 2025 14:47:33 +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=1756997256; 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=jMFOzfh57/aa+nKBeULzXsHBwAuKL0DOFNqpfPsVB48=; b=eTg6nF0+BRLtQlQvUKWeqzJe/Pua6MzViYt87hMPMZBOkCNXKJokSnNZPwes4BGpvqPt4b eA+L/5N4DmvmRo7SDA9gNKgpe5buoYZyBPFDJnGl6x1EYwqYUSwkFllcFf1mb1ccPcrvMl psZZarLLwb4qQ+QgW/rg9sBva01ZM0w= X-MC-Unique: pX7jfQwnMBqcR0K-Q5yeYA-1 X-Mimecast-MFC-AGG-ID: pX7jfQwnMBqcR0K-Q5yeYA_1756997254 To: devel@lists.libvirt.org Subject: [PATCH 13/14] qemu: Let qemuMonitorJSONGetCPUProperties also return disabled features Date: Thu, 4 Sep 2025 16:47:01 +0200 Message-ID: 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: jb_0iBQktVKkkGj9uai8ppb182EN_bc_4tj7J4ptvJ0_1756997254 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: HPJORMWC4AVKSBLVQDK3X627N7SJNOEC X-Message-ID-Hash: HPJORMWC4AVKSBLVQDK3X627N7SJNOEC 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: 1756999104463116600 Content-Type: text/plain; charset="utf-8" From: Jiri Denemark Signed-off-by: Jiri Denemark Reviewed-by: Peter Krempa --- src/qemu/qemu_monitor_json.c | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 6b736aefd0..f8be1a79b1 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -6641,7 +6641,8 @@ static int qemuMonitorJSONGetCPUProperties(qemuMonitor *mon, bool qomListGet, const char *cpuQOMPath, - char ***props) + char ***propsEnabled, + char ***propsDisabled) { g_autoptr(virJSONValue) cmd =3D NULL; g_autoptr(virJSONValue) reply =3D NULL; @@ -6652,7 +6653,8 @@ qemuMonitorJSONGetCPUProperties(qemuMonitor *mon, .cpuQOMPath =3D cpuQOMPath, }; =20 - *props =3D NULL; + *propsEnabled =3D NULL; + *propsDisabled =3D NULL; =20 if (qomListGet) { g_autoptr(virJSONValue) paths =3D virJSONValueNewArray(); @@ -6698,8 +6700,16 @@ qemuMonitorJSONGetCPUProperties(qemuMonitor *mon, } } =20 - return qemuMonitorJSONParsePropsList(array, qemuMonitorJSONCPUPropsFil= ter, - &filterData, props); + if (qemuMonitorJSONParsePropsList(array, qemuMonitorJSONCPUPropsFilter, + &filterData, propsEnabled) < 0) + return -1; + + if (qemuMonitorJSONGetStringListProperty(mon, cpuQOMPath, + "unavailable-features", + propsDisabled) < 0) + return -1; + + return 0; } =20 =20 @@ -6760,17 +6770,11 @@ qemuMonitorJSONGetGuestCPU(qemuMonitor *mon, return -1; =20 if (qemuMonitorJSONGetCPUProperties(mon, qomListGet, cpuQOMPath, - &propsEnabled) < 0) + &propsEnabled, &propsDisabled) < 0) return -1; =20 - if (qemuMonitorJSONCPUDataAddFeatures(cpuEnabled, propsEnabled, transl= ate) < 0) - return -1; - - if (qemuMonitorJSONGetStringListProperty(mon, cpuQOMPath, - "unavailable-features", &prop= sDisabled) < 0) - return -1; - - if (qemuMonitorJSONCPUDataAddFeatures(cpuDisabled, propsDisabled, tran= slate) < 0) + if (qemuMonitorJSONCPUDataAddFeatures(cpuEnabled, propsEnabled, transl= ate) < 0 || + qemuMonitorJSONCPUDataAddFeatures(cpuDisabled, propsDisabled, tran= slate) < 0) return -1; =20 *enabled =3D g_steal_pointer(&cpuEnabled); --=20 2.51.0