From nobody Tue Oct 28 17:51:30 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=1759757728; cv=none; d=zohomail.com; s=zohoarc; b=ZX/nP2lWlM5uiSyheuPXxOOSM2RfJr+ADz6HV69R6eAM7TwvbSZy3THuHefShiBWWU239DjTXsDsvF7LMIZgx/0vgnhnUNMdK92XNU2brAMx4kbbx48PANnAEvmZzHbViWNUbsvi7lIVg4SDqnTfuni0IQTSndEpGshqb70igmA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1759757728; 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=OuqKvjlqhImPwF9ob8UMocJljRlo1tq8HwtOZb1tVDk=; b=lBRyLWJJoBZ8geOtpIONuoUyaK/m8RKQfa3v+ivTWZdpSj5fLjC3D3/ktIl5aO24OPZ/0c6Tzl/2FK6j/6bMUheaHLmMiq2RaNcFHBc/2mge3GhpOKVwJBMt7USarrkb6NXMiojxvSl3WUnemfd3NYhu8K7GXXMm0e4l326JU58= 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 1759757728645607.5863039045099; Mon, 6 Oct 2025 06:35:28 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 065FD441BA; Mon, 6 Oct 2025 09:35:23 -0400 (EDT) Received: from [172.19.199.17] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id B57CC445BC; Mon, 6 Oct 2025 09:20:37 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 2FC3B41C7E; Mon, 6 Oct 2025 09:15:15 -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 2B38F41C82 for ; Mon, 6 Oct 2025 09:15:14 -0400 (EDT) Received: from mx-prod-mc-03.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-164-PwaZWBHKP92WapnbKl2FbA-1; Mon, 06 Oct 2025 09:15:12 -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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CDB0019560AA for ; Mon, 6 Oct 2025 13:15:11 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.3.236]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 221F13001FCA for ; Mon, 6 Oct 2025 13:15:10 +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=1759756513; 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=OuqKvjlqhImPwF9ob8UMocJljRlo1tq8HwtOZb1tVDk=; b=YwXeA978yDoqPBdMgH3QVFTLlqjDqvYXyz3QFKzNYsGCCSI4v7ewJICXQf9tKecLnjSsJL /hYiaaqgJhaII35tcdryb62PnpkWEZJS1mtufNBvNGnv1H9NI/djFwC80XdMq4eqMBhMTt J/xYwnMHZR4rywHI4Boz+rlIVg2Qmow= X-MC-Unique: PwaZWBHKP92WapnbKl2FbA-1 X-Mimecast-MFC-AGG-ID: PwaZWBHKP92WapnbKl2FbA_1759756511 To: devel@lists.libvirt.org Subject: [PATCH 13/20] qemu_capabilities: Format and parse new hyperv domcaps members Date: Mon, 6 Oct 2025 15:14:44 +0200 Message-ID: <0f170a827129dfe2bb5aee03b22da713fdaca686.1759756003.git.mprivozn@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: m4upGNW8jNOZuWY2GQXyhG8Cn2_1FNiJGJC9r5Mpt0s_1759756511 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: EZBKD7CJ6WORULKAFJO7JJ67WPKKRVE5 X-Message-ID-Hash: EZBKD7CJ6WORULKAFJO7JJ67WPKKRVE5 X-MailFrom: mprivozn@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: Michal Privoznik via Devel Reply-To: Michal Privoznik X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1759757729423116600 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik After previous commit the virDomainCapsFeatureHyperv struct gained new members. Since virQEMUCaps struct holds a pointer to such struct we must format and parse it to/from capabilities XML. Signed-off-by: Michal Privoznik --- src/qemu/qemu_capabilities.c | 42 ++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 2ccddbfcaa..f571596b30 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -4496,6 +4496,7 @@ virQEMUCapsParseHypervCapabilities(virQEMUCaps *qemuC= aps, g_autoptr(virDomainCapsFeatureHyperv) hvcaps =3D NULL; xmlNodePtr n =3D NULL; g_autofree xmlNodePtr *capNodes =3D NULL; + int rc; int ncapNodes; size_t i; =20 @@ -4531,6 +4532,28 @@ virQEMUCapsParseHypervCapabilities(virQEMUCaps *qemu= Caps, VIR_DOMAIN_CAPS_ENUM_SET(hvcaps->features, val); } =20 + rc =3D virXPathUInt("string(./hypervCapabilities/spinlocks)", + ctxt, &hvcaps->spinlocks); + if (rc =3D=3D -2) + return -1; + + rc =3D virXPathTristateSwitch("string(./hypervCapabilities/stimer_dire= ct)", + ctxt, &hvcaps->stimer_direct); + if (rc =3D=3D -2) + return -1; + + rc =3D virXPathTristateSwitch("string(./hypervCapabilities/tlbflush_di= rect)", + ctxt, &hvcaps->tlbflush_direct); + if (rc =3D=3D -2) + return -1; + + rc =3D virXPathTristateSwitch("string(./hypervCapabilities/tlbflush_ex= tended)", + ctxt, &hvcaps->tlbflush_extended); + if (rc =3D=3D -2) + return -1; + + hvcaps->vendor_id =3D virXPathString("string(./hypervCapabilities/vend= or_id)", ctxt); + qemuCaps->hypervCapabilities =3D g_steal_pointer(&hvcaps); return 0; } @@ -5070,6 +5093,25 @@ virQEMUCapsFormatHypervCapabilities(virQEMUCaps *qem= uCaps, virBufferAsprintf(&childBuf, "\n", virDomainHypervTypeToString(i)); } + + if (hvcaps->spinlocks !=3D 0) { + virBufferAsprintf(&childBuf, "%u\n", + hvcaps->spinlocks); + } + if (hvcaps->stimer_direct !=3D VIR_TRISTATE_SWITCH_ABSENT) { + virBufferAsprintf(&childBuf, "%s\n", + virTristateSwitchTypeToString(hvcaps->stimer= _direct)); + } + if (hvcaps->tlbflush_direct !=3D VIR_TRISTATE_SWITCH_ABSENT) { + virBufferAsprintf(&childBuf, "%s\n", + virTristateSwitchTypeToString(hvcaps->tlbflu= sh_direct)); + } + if (hvcaps->tlbflush_extended !=3D VIR_TRISTATE_SWITCH_ABSENT) { + virBufferAsprintf(&childBuf, "%s\n", + virTristateSwitchTypeToString(hvcaps->tlbflu= sh_extended)); + } + virBufferEscapeString(&childBuf, "%s\n", + hvcaps->vendor_id); } =20 return virXMLFormatElement(buf, "hypervCapabilities", &attrBuf, &child= Buf); --=20 2.49.1