From nobody Tue Oct 28 08:17:43 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=1759757021; cv=none; d=zohomail.com; s=zohoarc; b=nfI3KW/hK/vX1ULGn7H0g1QiHq3kCJ9rPZHgMa+M8SStXnLvJvRO/9NHcKD0GQRSfpo3HRjpHHi1xwlaiVDYvECceERdn1fVaZ1N0l2TOvkhb2wAcSdonwRYszGpNqgs2rE/vFCHZkLOF4/Z8oX3ewGhU1EndL6IcD3jRC/WQF0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1759757021; 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=xKG9cWlH7Wqa1NVWNcQQKAWfvGflz7138CGGPtZZjCc=; b=JSbKzua8WiH1Z4/XTfp/Lt4uKXr2qsjZ1kGofcYAe3OY3+o942t5kwquE3sHvEDyRzc3QPaJImcusJ+7mOw8HfhrupaZbn+Mgd7HHHFYsOY1oc2JL8VfG3N5i4J5k0mgI3Hp41n6xoaUxDlSHEdqKqWfJyqolECVvPvewGOlbTM= 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 175975702198048.202366503502844; Mon, 6 Oct 2025 06:23:41 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id ECC3C44648; Mon, 6 Oct 2025 09:21:36 -0400 (EDT) Received: from [172.19.199.17] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 64B2843E53; Mon, 6 Oct 2025 09:17:48 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 4B2E341C81; Mon, 6 Oct 2025 09:15:06 -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 DBBFA41C7E for ; Mon, 6 Oct 2025 09:15:04 -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-224-LjXGIy2aPN6o5r-CxfCHUg-1; Mon, 06 Oct 2025 09:14:58 -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 D707619560A1 for ; Mon, 6 Oct 2025 13:14:57 +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 2D5CD30002CC for ; Mon, 6 Oct 2025 13:14:56 +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=1759756504; 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=xKG9cWlH7Wqa1NVWNcQQKAWfvGflz7138CGGPtZZjCc=; b=aKbUJRUqmczjJfzaxNbd3CLL6uUfI30PJgO6E2yu7MYPAqbWjdNEpnWP1gX12fVI9Wfb6l IFKfNSmeyoN1zV5Hfo23+Z5ojwZmWvFpbZMZsXS+RgqPd5xnTFCqlW6t+B7JB1nipN5lV6 2Gx4rH1iEm0qyWlfAaBVXq/ahewXRHk= X-MC-Unique: LjXGIy2aPN6o5r-CxfCHUg-1 X-Mimecast-MFC-AGG-ID: LjXGIy2aPN6o5r-CxfCHUg_1759756498 To: devel@lists.libvirt.org Subject: [PATCH 01/20] virxml: Introduce virXPathTristateSwitch() Date: Mon, 6 Oct 2025 15:14:32 +0200 Message-ID: <6192daec8908a603d2ac9823e942b8f11a1b23c2.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: f_eQ9dBp1B5Z_uQfcr8FR3sZHGaTqkbDF4_nrrWy7Fk_1759756498 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: G7TTMFCMGVEBOJLYGE2XVYOBIPL2IVDH X-Message-ID-Hash: G7TTMFCMGVEBOJLYGE2XVYOBIPL2IVDH 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: 1759757024856116600 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik Similarly to other virXPath* functions, let's have a helper that evaluates an XPath and stores the value into virTristateSwitch. Signed-off-by: Michal Privoznik --- src/libvirt_private.syms | 1 + src/util/virxml.c | 34 ++++++++++++++++++++++++++++++++++ src/util/virxml.h | 5 +++++ 3 files changed, 40 insertions(+) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index fe72402527..db909e4b28 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -3826,6 +3826,7 @@ virXPathLongLong; virXPathNode; virXPathNodeSet; virXPathString; +virXPathTristateSwitch; virXPathUInt; virXPathUIntBase; virXPathULongLong; diff --git a/src/util/virxml.c b/src/util/virxml.c index bb80bb7444..60485c10fa 100644 --- a/src/util/virxml.c +++ b/src/util/virxml.c @@ -284,6 +284,40 @@ virXPathLongLong(const char *xpath, } =20 =20 +/** + * virXPathTristateSwitch: + * @xpath: the XPath string to evaluate + * @ctxt: an XPath context + * @value: the returned virTristateSwitch value + * + * Convenience function to evaluate an XPath tristate value. The @xpath + * expression must ensure that the evaluated value is returned as a + * string (use the 'string()' conversion in the expression). + * + * Returns 0 in case of success in which case @value is set, + * or -1 if the XPath evaluation failed or -2 if the + * value isn't of a virTristateSwitch value. + */ +int +virXPathTristateSwitch(const char *xpath, + xmlXPathContextPtr ctxt, + virTristateSwitch *value) +{ + g_autoptr(xmlXPathObject) obj =3D NULL; + int rc; + + if (!(obj =3D virXPathEvalString(xpath, ctxt))) + return -1; + + rc =3D virTristateSwitchTypeFromString((char *)obj->stringval); + if (rc < 0) + return -2; + + *value =3D rc; + return 0; +} + + /** * virXMLCheckIllegalChars: * @nodeName: Name of checked node diff --git a/src/util/virxml.h b/src/util/virxml.h index 7cc3f47913..dfec386494 100644 --- a/src/util/virxml.h +++ b/src/util/virxml.h @@ -73,6 +73,11 @@ virXPathLongLong(const char *xpath, xmlXPathContextPtr ctxt, long long *value); =20 +int +virXPathTristateSwitch(const char *xpath, + xmlXPathContextPtr ctxt, + virTristateSwitch *value); + xmlNodePtr virXMLNodeGetSubelement(xmlNodePtr node, const char *name); --=20 2.49.1 From nobody Tue Oct 28 08:17:43 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=1759756820; cv=none; d=zohomail.com; s=zohoarc; b=eNxbSQCl7HViODX7ZiHnSL0eeADyS40uzZ7vOP3/0xUg4OelKhVto81/AYoIl0MnhOjzpLOXQwriea9lOjcXEe5ZGj9iCOToWcWoWJr3qFRBt6xwkP8xpzh8dwO+9TSx7FsgAv9iqLFTcFzQYvmUIL6xZt1QLwcV7TdfitpTGdI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1759756820; 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=3FGZm3NRPHBfcNn2mKN8htYAXBJ3bKRMl0jReoUu4gk=; b=OwaoPLbjtJDHI7Pr8xYjdLxoOPTIX5zLscO5oqdP9YrY3KB2bAVNyQYIJeSoPC1AlUlBxNxAwwEiv46QxS9Y9bGgrpBjhNm8eLdZvXo1V5GJATaGMExJ2/BwqaXlruvSK2rBakPG/mA/n6Z5a4/g8Mrlqj9HgOKj6B6Z4LFxJWc= 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 1759756820874835.534225764594; Mon, 6 Oct 2025 06:20:20 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id B8789443ED; Mon, 6 Oct 2025 09:18:16 -0400 (EDT) Received: from [172.19.199.17] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 07BB84412B; Mon, 6 Oct 2025 09:16:41 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 9A13241C7E; Mon, 6 Oct 2025 09:15:04 -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 51E4941C7F for ; Mon, 6 Oct 2025 09:15:02 -0400 (EDT) Received: from mx-prod-mc-08.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-488-sALM9Nl8MyCEgyxw07xZYg-1; Mon, 06 Oct 2025 09:15:00 -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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 08B731800343 for ; Mon, 6 Oct 2025 13:14:59 +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 532D830002CC for ; Mon, 6 Oct 2025 13:14:58 +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=1759756502; 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=3FGZm3NRPHBfcNn2mKN8htYAXBJ3bKRMl0jReoUu4gk=; b=IPa/xAxCm/51nHeDVyFTFVT8GNOxjWJAKY5z95JM5Anm9QIjJM7jrMGW8XlNq/O8HJG9wT FTSS6HFhgFDmY8brgdj5Nw9W7S9DN/0PLNZFHrdTMZJB/qFodDKH3Bz+oJamsdxUxooaR6 +NKYgrINyDLC6CEwBJLtf1PGujmduTI= X-MC-Unique: sALM9Nl8MyCEgyxw07xZYg-1 X-Mimecast-MFC-AGG-ID: sALM9Nl8MyCEgyxw07xZYg_1759756499 To: devel@lists.libvirt.org Subject: [PATCH 02/20] virxml: Introduce virXPathTristateBool() Date: Mon, 6 Oct 2025 15:14:33 +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: Cdi8wfCHRX9VS_rKAg9hDZjjZuNeILS3iU3Sb321yCM_1759756499 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: LEU5VRM5C5R2SRNBAQRU2O6MRTOR3RK7 X-Message-ID-Hash: LEU5VRM5C5R2SRNBAQRU2O6MRTOR3RK7 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: 1759756823887116600 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik Similarly to other virXPath* functions, let's have a helper that evaluates an XPath and stores the value into virTristateBool. Signed-off-by: Michal Privoznik --- src/libvirt_private.syms | 1 + src/util/virxml.c | 34 ++++++++++++++++++++++++++++++++++ src/util/virxml.h | 5 +++++ 3 files changed, 40 insertions(+) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index db909e4b28..e2457a1569 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -3826,6 +3826,7 @@ virXPathLongLong; virXPathNode; virXPathNodeSet; virXPathString; +virXPathTristateBool; virXPathTristateSwitch; virXPathUInt; virXPathUIntBase; diff --git a/src/util/virxml.c b/src/util/virxml.c index 60485c10fa..44f11accf3 100644 --- a/src/util/virxml.c +++ b/src/util/virxml.c @@ -318,6 +318,40 @@ virXPathTristateSwitch(const char *xpath, } =20 =20 +/** + * virXPathTristateBool: + * @xpath: the XPath string to evaluate + * @ctxt: an XPath context + * @value: the returned virTristateBool value + * + * Convenience function to evaluate an XPath tristate value. The @xpath + * expression must ensure that the evaluated value is returned as a + * string (use the 'string()' conversion in the expression). + * + * Returns 0 in case of success in which case @value is set, + * or -1 if the XPath evaluation failed or -2 if the + * value isn't of a virTristateBool value. + */ +int +virXPathTristateBool(const char *xpath, + xmlXPathContextPtr ctxt, + virTristateBool *value) +{ + g_autoptr(xmlXPathObject) obj =3D NULL; + int rc; + + if (!(obj =3D virXPathEvalString(xpath, ctxt))) + return -1; + + rc =3D virTristateBoolTypeFromString((char *)obj->stringval); + if (rc < 0) + return -2; + + *value =3D rc; + return 0; +} + + /** * virXMLCheckIllegalChars: * @nodeName: Name of checked node diff --git a/src/util/virxml.h b/src/util/virxml.h index dfec386494..82218c0539 100644 --- a/src/util/virxml.h +++ b/src/util/virxml.h @@ -78,6 +78,11 @@ virXPathTristateSwitch(const char *xpath, xmlXPathContextPtr ctxt, virTristateSwitch *value); =20 +int +virXPathTristateBool(const char *xpath, + xmlXPathContextPtr ctxt, + virTristateBool *value); + xmlNodePtr virXMLNodeGetSubelement(xmlNodePtr node, const char *name); --=20 2.49.1 From nobody Tue Oct 28 08:17:43 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=1759756827; cv=none; d=zohomail.com; s=zohoarc; b=IhFeRX4SsVdtAw2nbF2nT74S/Ohpk+3xH43Li0Wg7UWgmEoGZVWoj6LL+qovkt4jkyJ2wd5y+wAZeqXH4TP04FQkbyWVP9lmU2K+1pSQDVvdRjQKvyXicV+HCpeh/EHDtiJkyd5jUxNR8aM9kroNdgDw98o/4/FZMcC0/SlFSLg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1759756827; 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=/2/gQAYm9p4nfblTFlP3auNgWeyt3PKpYiIvErs1cxc=; b=HHn4l9qQiRHD3iek74Qxfnt3P9ENZKSfHTDMq9/5PyWDAM5ao4HMt/BT/fOJvJptjfb3ljZCQRyUH9wWXrmV7kfJGdeJQqMv/ICsIyC6cBKimJGZ/lZID4+dCiZ4VDbCD8dYAGXn69P/L7ItMtWvlstvMmvGk8i9Yhc8HN0mrPg= 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 1759756827267357.1417826135687; Mon, 6 Oct 2025 06:20:27 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 3D16144056; Mon, 6 Oct 2025 09:19:13 -0400 (EDT) Received: from [172.19.199.17] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 55C7A442FA; Mon, 6 Oct 2025 09:17:17 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id A85E441C8E; Mon, 6 Oct 2025 09:15:05 -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 748F641C81 for ; Mon, 6 Oct 2025 09:15:02 -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-101-s_qHzpt2P42u8CYPAMxL9Q-1; Mon, 06 Oct 2025 09:15:00 -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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2E7D4180057E for ; Mon, 6 Oct 2025 13:15:00 +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 78DBC30002CC for ; Mon, 6 Oct 2025 13:14:59 +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=1759756502; 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=/2/gQAYm9p4nfblTFlP3auNgWeyt3PKpYiIvErs1cxc=; b=Ty53MPY9EBDqr57SuFHJ1TaMeLMn2fd/Uu84KEHGFHHfRWc/QjcX7NREdZHfv0bZ5QhTzC Dk/OJAgkp9cl6HE86rff75omLE/pw5JyZhnaMcgsVaeSFPqjED1QzgEySwUe3fS1Dx9FNh JnNLLNeh6gXac0nDbM7qBswaXpE3/Rw= X-MC-Unique: s_qHzpt2P42u8CYPAMxL9Q-1 X-Mimecast-MFC-AGG-ID: s_qHzpt2P42u8CYPAMxL9Q_1759756500 To: devel@lists.libvirt.org Subject: [PATCH 03/20] qemu: Use virXPathTristateBool() Date: Mon, 6 Oct 2025 15:14:34 +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: vtiI8YM_2UKKRK3hQgLgZktM3Q8A69pxsR-lgOlcBIU_1759756500 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: M3CE3VVX3WKCMVNTMDI7M6F5TZKDC6VS X-Message-ID-Hash: M3CE3VVX3WKCMVNTMDI7M6F5TZKDC6VS 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: 1759756828016116600 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik There are two places in our code base which can use freshly introduced virXPathTristateBool(): qemuStorageSourcePrivateDataParse() and qemuDomainObjPrivateXMLParseBlockjobs(). Signed-off-by: Michal Privoznik --- src/qemu/qemu_domain.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index b39fabfbb4..d675a5d7ee 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -2073,7 +2073,7 @@ qemuStorageSourcePrivateDataParse(xmlXPathContextPtr = ctxt, g_autofree char *authalias =3D NULL; g_autofree char *httpcookiealias =3D NULL; g_autofree char *tlskeyalias =3D NULL; - g_autofree char *thresholdEventWithIndex =3D NULL; + virTristateBool thresholdEventWithIndex; bool fdsetPresent =3D false; unsigned int fdSetID; int enccount; @@ -2139,9 +2139,10 @@ qemuStorageSourcePrivateDataParse(xmlXPathContextPtr= ctxt, if (virStorageSourcePrivateDataParseRelPath(ctxt, src) < 0) return -1; =20 - if ((thresholdEventWithIndex =3D virXPathString("string(./thresholdEve= nt/@indexUsed)", ctxt)) && - virTristateBoolTypeFromString(thresholdEventWithIndex) =3D=3D VIR_= TRISTATE_BOOL_YES) - src->thresholdEventWithIndex =3D true; + if (virXPathTristateBool("string(./thresholdEvent/@indexUsed)", + ctxt, &thresholdEventWithIndex) >=3D 0) { + virTristateBoolToBool(thresholdEventWithIndex, &src->thresholdEven= tWithIndex); + } =20 if ((nbdkitnode =3D virXPathNode("nbdkit", ctxt))) { if (qemuStorageSourcePrivateDataParseNbdkit(nbdkitnode, ctxt, src)= < 0) @@ -3210,13 +3211,10 @@ qemuDomainObjPrivateXMLParseBlockjobs(virDomainObj = *vm, { g_autofree xmlNodePtr *nodes =3D NULL; ssize_t nnodes =3D 0; - g_autofree char *active =3D NULL; - int tmp; size_t i; =20 - if ((active =3D virXPathString("string(./blockjobs/@active)", ctxt)) && - (tmp =3D virTristateBoolTypeFromString(active)) > 0) - priv->reconnectBlockjobs =3D tmp; + virXPathTristateBool("string(./blockjobs/@active)", + ctxt, &priv->reconnectBlockjobs); =20 if ((nnodes =3D virXPathNodeSet("./blockjobs/blockjob", ctxt, &nodes))= < 0) return -1; --=20 2.49.1 From nobody Tue Oct 28 08:17:43 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=1759756932; cv=none; d=zohomail.com; s=zohoarc; b=kJiVb5gI5YbBKbnLsa/Q40nMDpXs2Ceut+qH0qT6gHtTJ834GgAylN7VWHhvm/d4senCbb4xn+hey/BVNy3qEl/gF6+1nA5UNzVLoJeUrwuy+3afIrcsPJ9/1wiXJ1rkxIX36e0SckjgtThXgvO4wEJ7q/Zi2ImKJkDkZTeALu0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1759756932; 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=KeOxKtqOnBzMobY7biNi05Wwa/1ZLDlBa1aPvppMhLg=; b=h8omxyueBy5bSWNCpoAG1Hj4ZUOfJCvZ4SwrzW1+HbuCp6BjVEeaM6E1/5Brwd9j9cyDb8lb3LL+3TM+CvplynN46JU9rJUikM6h7EooxGiDUWbaZaAgqsB5mpPim25MQfe+/iB1RzCaLnRUNnQE8ACdOsq6FLlFe+andilMFek= 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 1759756932705851.4117879587739; Mon, 6 Oct 2025 06:22:12 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id BA70B44810; Mon, 6 Oct 2025 09:20:20 -0400 (EDT) Received: from [172.19.199.17] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 2739543E4E; Mon, 6 Oct 2025 09:17:32 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 583B541C80; Mon, 6 Oct 2025 09:15:06 -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 6348D41C80 for ; Mon, 6 Oct 2025 09:15:04 -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-283-dyVhwjZEPaCYa-58w1mWyA-1; Mon, 06 Oct 2025 09:15:02 -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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6B95F180057B for ; Mon, 6 Oct 2025 13:15:01 +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 9841A3001FF0 for ; Mon, 6 Oct 2025 13:15:00 +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=1759756504; 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=KeOxKtqOnBzMobY7biNi05Wwa/1ZLDlBa1aPvppMhLg=; b=KTYWqvzb0hcly3u92cIBTtMmwtYDh2A5BJRMmAu3QVrkgnUn6aYPabCN6RgnDfNAsasx5F xQ9wXb9XQrAP0yuZfhVd+UTxdoeAeG1s2tSgxYTk6FkokcJtVyik1sbaYAnJ1Qfi7BPBVy +wcmWXH6OqsRsPlQg9ubfRtOpdM/OyI= X-MC-Unique: dyVhwjZEPaCYa-58w1mWyA-1 X-Mimecast-MFC-AGG-ID: dyVhwjZEPaCYa-58w1mWyA_1759756501 To: devel@lists.libvirt.org Subject: [PATCH 04/20] domain_conf: Move format of hyperv features into a function Date: Mon, 6 Oct 2025 15:14:35 +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: YBYrzocN_H1INNUQRl_MOxZl__TDp5Z7skwAL6xnjaI_1759756501 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 2Q3VKU6R6SEJGZK273SYSC7L2FWBJLRS X-Message-ID-Hash: 2Q3VKU6R6SEJGZK273SYSC7L2FWBJLRS 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: 1759756933751116600 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c | 158 ++++++++++++++++++++++------------------- 1 file changed, 84 insertions(+), 74 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 281846dfbe..6fa07267c0 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -28581,6 +28581,89 @@ virDomainFeatureTCGFormat(virBuffer *buf, } =20 =20 +static void +virDomainFeaturesHyperVDefFormat(virBuffer *buf, + const virDomainDef *def) +{ + virBuffer tmpChildBuf =3D VIR_BUFFER_INIT_CHILD(buf); + size_t j; + + if (def->features[VIR_DOMAIN_FEATURE_HYPERV] =3D=3D VIR_DOMAIN_HYPERV_= MODE_NONE) + return; + + virBufferAsprintf(buf, "\n", + virDomainHyperVModeTypeToString(def->features[VIR_DO= MAIN_FEATURE_HYPERV])); + + for (j =3D 0; j < VIR_DOMAIN_HYPERV_LAST; j++) { + g_auto(virBuffer) hypervAttrBuf =3D VIR_BUFFER_INITIALIZER; + g_auto(virBuffer) hypervChildBuf =3D VIR_BUFFER_INIT_CHILD(&tmpChi= ldBuf); + + if (def->hyperv_features[j] =3D=3D VIR_TRISTATE_SWITCH_ABSENT) + continue; + + virBufferAsprintf(&hypervAttrBuf, " state=3D'%s'", + virTristateSwitchTypeToString(def->hyperv_featur= es[j])); + + switch ((virDomainHyperv) j) { + case VIR_DOMAIN_HYPERV_RELAXED: + case VIR_DOMAIN_HYPERV_VAPIC: + case VIR_DOMAIN_HYPERV_VPINDEX: + case VIR_DOMAIN_HYPERV_RUNTIME: + case VIR_DOMAIN_HYPERV_SYNIC: + case VIR_DOMAIN_HYPERV_RESET: + case VIR_DOMAIN_HYPERV_FREQUENCIES: + case VIR_DOMAIN_HYPERV_REENLIGHTENMENT: + case VIR_DOMAIN_HYPERV_IPI: + case VIR_DOMAIN_HYPERV_EVMCS: + case VIR_DOMAIN_HYPERV_AVIC: + case VIR_DOMAIN_HYPERV_EMSR_BITMAP: + case VIR_DOMAIN_HYPERV_XMM_INPUT: + break; + + case VIR_DOMAIN_HYPERV_SPINLOCKS: + if (def->hyperv_features[j] =3D=3D VIR_TRISTATE_SWITCH_ON) { + virBufferAsprintf(&hypervAttrBuf, + " retries=3D'%d'", def->hyperv_spinlocks= ); + } + break; + + case VIR_DOMAIN_HYPERV_STIMER: + if (def->hyperv_features[j] =3D=3D VIR_TRISTATE_SWITCH_ON && + def->hyperv_stimer_direct =3D=3D VIR_TRISTATE_SWITCH_ON) { + virBufferAddLit(&hypervChildBuf, "\n= "); + } + + break; + + case VIR_DOMAIN_HYPERV_VENDOR_ID: + if (def->hyperv_features[j] =3D=3D VIR_TRISTATE_SWITCH_ON) { + virBufferEscapeString(&hypervAttrBuf, " value=3D'%s'", + def->hyperv_vendor_id); + } + break; + + case VIR_DOMAIN_HYPERV_TLBFLUSH: + if (def->hyperv_features[j] !=3D VIR_TRISTATE_SWITCH_ON) + break; + + if (def->hyperv_tlbflush_direct =3D=3D VIR_TRISTATE_SWITCH_ON) + virBufferAddLit(&hypervChildBuf, "\n= "); + if (def->hyperv_tlbflush_extended =3D=3D VIR_TRISTATE_SWITCH_O= N) + virBufferAddLit(&hypervChildBuf, "= \n"); + break; + + case VIR_DOMAIN_HYPERV_LAST: + break; + } + + virXMLFormatElement(&tmpChildBuf, virDomainHypervTypeToString(j), + &hypervAttrBuf, &hypervChildBuf); + } + + virBufferAddBuffer(buf, &tmpChildBuf); + virBufferAddLit(buf, "\n"); +} + static int virDomainDefFormatFeatures(virBuffer *buf, virDomainDef *def) @@ -28678,80 +28761,7 @@ virDomainDefFormatFeatures(virBuffer *buf, break; =20 case VIR_DOMAIN_FEATURE_HYPERV: - if (def->features[i] =3D=3D VIR_DOMAIN_HYPERV_MODE_NONE) - break; - - virBufferAsprintf(&childBuf, "\n", - virDomainHyperVModeTypeToString(def->feature= s[i])); - - for (j =3D 0; j < VIR_DOMAIN_HYPERV_LAST; j++) { - g_auto(virBuffer) hypervAttrBuf =3D VIR_BUFFER_INITIALIZER; - g_auto(virBuffer) hypervChildBuf =3D VIR_BUFFER_INIT_CHILD= (&tmpChildBuf); - - if (def->hyperv_features[j] =3D=3D VIR_TRISTATE_SWITCH_ABS= ENT) - continue; - - virBufferAsprintf(&hypervAttrBuf, " state=3D'%s'", - virTristateSwitchTypeToString(def->hyper= v_features[j])); - - switch ((virDomainHyperv) j) { - case VIR_DOMAIN_HYPERV_RELAXED: - case VIR_DOMAIN_HYPERV_VAPIC: - case VIR_DOMAIN_HYPERV_VPINDEX: - case VIR_DOMAIN_HYPERV_RUNTIME: - case VIR_DOMAIN_HYPERV_SYNIC: - case VIR_DOMAIN_HYPERV_RESET: - case VIR_DOMAIN_HYPERV_FREQUENCIES: - case VIR_DOMAIN_HYPERV_REENLIGHTENMENT: - case VIR_DOMAIN_HYPERV_IPI: - case VIR_DOMAIN_HYPERV_EVMCS: - case VIR_DOMAIN_HYPERV_AVIC: - case VIR_DOMAIN_HYPERV_EMSR_BITMAP: - case VIR_DOMAIN_HYPERV_XMM_INPUT: - break; - - case VIR_DOMAIN_HYPERV_SPINLOCKS: - if (def->hyperv_features[j] =3D=3D VIR_TRISTATE_SWITCH= _ON) { - virBufferAsprintf(&hypervAttrBuf, - " retries=3D'%d'", def->hyperv_s= pinlocks); - } - break; - - case VIR_DOMAIN_HYPERV_STIMER: - if (def->hyperv_features[j] =3D=3D VIR_TRISTATE_SWITCH= _ON && - def->hyperv_stimer_direct =3D=3D VIR_TRISTATE_SWIT= CH_ON) { - virBufferAddLit(&hypervChildBuf, "\n"); - } - - break; - - case VIR_DOMAIN_HYPERV_VENDOR_ID: - if (def->hyperv_features[j] =3D=3D VIR_TRISTATE_SWITCH= _ON) { - virBufferEscapeString(&hypervAttrBuf, " value=3D'%= s'", - def->hyperv_vendor_id); - } - break; - - case VIR_DOMAIN_HYPERV_TLBFLUSH: - if (def->hyperv_features[j] !=3D VIR_TRISTATE_SWITCH_O= N) - break; - - if (def->hyperv_tlbflush_direct =3D=3D VIR_TRISTATE_SW= ITCH_ON) - virBufferAddLit(&hypervChildBuf, "\n"); - if (def->hyperv_tlbflush_extended =3D=3D VIR_TRISTATE_= SWITCH_ON) - virBufferAddLit(&hypervChildBuf, "\n"); - break; - - case VIR_DOMAIN_HYPERV_LAST: - break; - } - - virXMLFormatElement(&tmpChildBuf, virDomainHypervTypeToStr= ing(j), - &hypervAttrBuf, &hypervChildBuf); - } - - virBufferAddBuffer(&childBuf, &tmpChildBuf); - virBufferAddLit(&childBuf, "\n"); + virDomainFeaturesHyperVDefFormat(&childBuf, def); break; =20 case VIR_DOMAIN_FEATURE_KVM: --=20 2.49.1 From nobody Tue Oct 28 08:17:43 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=1759757107; cv=none; d=zohomail.com; s=zohoarc; b=DHH/RTmbL7cS5Z8AEEnwdhDllDT1+ZaNrwgyilDpm302T6WKlppL4SlgEmogn9jkjHbNrsh4gz20AhRodT+04Ok2dE+fRiTPEevL2BJhToewA4ILHieKD71VVisb6wyLRmXeNR2Mqo5sXB6HeQb1AMiz0KFYaOC65/Zmp67QB5Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1759757107; 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=1qJpoobXjt1g/0UdEUavrAvOFXwXIsMcnqJt+TYRke4=; b=MtIKNVQBkAnWd7mAhFx9cjksI7CCUUhEeddWA/piPf0p3nLJPpU7u4t4JvyTo1mGV041r97fGA3lsXnMKEhe5uILPvwGAv8R+B2QAVe/LNjmnOvXvLpsN61O0k95zKIe1WYpQQ/nwLK3nXsTVm4sTQs35ZyPDzqg1moorfhsyzk= 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 1759757107276678.0125502082633; Mon, 6 Oct 2025 06:25:07 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 4CAB84182E; Mon, 6 Oct 2025 09:23:17 -0400 (EDT) Received: from [172.19.199.17] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 5BE7D442FC; Mon, 6 Oct 2025 09:18:07 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id A362441C83; Mon, 6 Oct 2025 09:15:07 -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 04B0841C8A for ; Mon, 6 Oct 2025 09:15:04 -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-339-aiTmlSgZNk6shCdkNkX6fw-1; Mon, 06 Oct 2025 09:15:03 -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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6C3A11800289 for ; Mon, 6 Oct 2025 13:15:02 +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 B64E430002CC for ; Mon, 6 Oct 2025 13:15:01 +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=1759756504; 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=1qJpoobXjt1g/0UdEUavrAvOFXwXIsMcnqJt+TYRke4=; b=ayFCwkTk4Bwz+KYij+Njubi6BPwhhz8Ff3z3Zo1ZL+4V7bPsHECbUuvFI3XGMJUDBxh8J4 uRvw8lhqqHZXc44H3WoTsGaxtrY73YP31pa9xvoS7RHVRCTgZQctb0Z4BP6Aimg52Mi8LR KkNte5D6dHHWLqUtIFnFozg6R7pPsQ4= X-MC-Unique: aiTmlSgZNk6shCdkNkX6fw-1 X-Mimecast-MFC-AGG-ID: aiTmlSgZNk6shCdkNkX6fw_1759756502 To: devel@lists.libvirt.org Subject: [PATCH 05/20] domain_conf: Use virXMLFormatElement() to format hyperv features Date: Mon, 6 Oct 2025 15:14:36 +0200 Message-ID: <69a0391d266bfb8123c2ab15f07463d4f6a35761.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: Dr-TkYYU1f_isjJpRv-nKWuFgGTKPp2ApbbQkAOkWBM_1759756502 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 5B6YPCOIZRF7RXQDDDUHWAX4SXE2OGYW X-Message-ID-Hash: 5B6YPCOIZRF7RXQDDDUHWAX4SXE2OGYW 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: 1759757108377116600 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik Not only is it more modern that old virBufferAsprintf() of opening and closing tag, it's also aware of child elements buffer and thus formats a singleton properly. Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c | 13 +++++++------ .../hyperv-passthrough.x86_64-latest.xml | 3 +-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 6fa07267c0..55b1a1a691 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -28585,18 +28585,19 @@ static void virDomainFeaturesHyperVDefFormat(virBuffer *buf, const virDomainDef *def) { - virBuffer tmpChildBuf =3D VIR_BUFFER_INIT_CHILD(buf); + virBuffer childBuf =3D VIR_BUFFER_INIT_CHILD(buf); + virBuffer attrBuf =3D VIR_BUFFER_INITIALIZER; size_t j; =20 if (def->features[VIR_DOMAIN_FEATURE_HYPERV] =3D=3D VIR_DOMAIN_HYPERV_= MODE_NONE) return; =20 - virBufferAsprintf(buf, "\n", + virBufferAsprintf(&attrBuf, " mode=3D'%s'", virDomainHyperVModeTypeToString(def->features[VIR_DO= MAIN_FEATURE_HYPERV])); =20 for (j =3D 0; j < VIR_DOMAIN_HYPERV_LAST; j++) { g_auto(virBuffer) hypervAttrBuf =3D VIR_BUFFER_INITIALIZER; - g_auto(virBuffer) hypervChildBuf =3D VIR_BUFFER_INIT_CHILD(&tmpChi= ldBuf); + g_auto(virBuffer) hypervChildBuf =3D VIR_BUFFER_INIT_CHILD(&childB= uf); =20 if (def->hyperv_features[j] =3D=3D VIR_TRISTATE_SWITCH_ABSENT) continue; @@ -28656,14 +28657,14 @@ virDomainFeaturesHyperVDefFormat(virBuffer *buf, break; } =20 - virXMLFormatElement(&tmpChildBuf, virDomainHypervTypeToString(j), + virXMLFormatElement(&childBuf, virDomainHypervTypeToString(j), &hypervAttrBuf, &hypervChildBuf); } =20 - virBufferAddBuffer(buf, &tmpChildBuf); - virBufferAddLit(buf, "\n"); + virXMLFormatElement(buf, "hyperv", &attrBuf, &childBuf); } =20 + static int virDomainDefFormatFeatures(virBuffer *buf, virDomainDef *def) diff --git a/tests/qemuxmlconfdata/hyperv-passthrough.x86_64-latest.xml b/t= ests/qemuxmlconfdata/hyperv-passthrough.x86_64-latest.xml index 2cfae8fa4c..0ce5bab605 100644 --- a/tests/qemuxmlconfdata/hyperv-passthrough.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/hyperv-passthrough.x86_64-latest.xml @@ -10,8 +10,7 @@ - - + qemu64 --=20 2.49.1 From nobody Tue Oct 28 08:17:43 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=1759757183; cv=none; d=zohomail.com; s=zohoarc; b=nX0dmTLR1BdImUaiH5jdfHCrZ2MGSgszQ9SoW86pqrOOepIxsbChWaNQ+gi6PB8lfoHkHNEmDDJPFGdQRBBf6qbitlX5pjJRq063oh5n+xuxzbVRll7MT0Lou+/4260/8xtGkV3I0uFgrjAvOttNdfW6M5Q2GoffvtrtM7IZ+YQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1759757183; 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=f1t+tynwKljtAylLeXLTvfWKJ7NcSVF+lcYWOT2TTGo=; b=BIFMrwh1j1Xx9tYLany6nwZOP5yMcROJpj8hmrnOC2mK2rWBK7ueNLp2n+0YLNUbmt8yAVvim49yjLlVFdoFsKQYsI5EhEa2OprZLR5Ii3tajsU7Eoh3nmO+ZgWPA1QiihnCJzDEq4u+sD40KMDjSgwYD+b/gIKTkK5MHvA/LzM= 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 1759757183379476.5555511234618; Mon, 6 Oct 2025 06:26:23 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id E84E444358; Mon, 6 Oct 2025 09:24:23 -0400 (EDT) Received: from [172.19.199.17] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 8146944268; Mon, 6 Oct 2025 09:18:23 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 93C6841C8A; Mon, 6 Oct 2025 09:15:08 -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 E1A0141C82 for ; Mon, 6 Oct 2025 09:15:05 -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-638-k1HFkT39OaWdbxWZcVnyLA-1; Mon, 06 Oct 2025 09:15:04 -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 94C381956089 for ; Mon, 6 Oct 2025 13:15:03 +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 D4D8830002CC for ; Mon, 6 Oct 2025 13:15:02 +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=1759756505; 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=f1t+tynwKljtAylLeXLTvfWKJ7NcSVF+lcYWOT2TTGo=; b=VpVq9zYb8rao1ptZCJt8rGYSHSCZmFY8tKUMstKENkH5SrsM6ra9O2bGrJjM/30E5L/hw9 03nAdMdvvSAiqifGQFDiPodRhc3AS01l8qVVxP+WWO1FiCiJpR9EeUEVDVKIWfz853p0cB 0o3r74heY6/adJR48SCIOjcvkB5EkUM= X-MC-Unique: k1HFkT39OaWdbxWZcVnyLA-1 X-Mimecast-MFC-AGG-ID: k1HFkT39OaWdbxWZcVnyLA_1759756503 To: devel@lists.libvirt.org Subject: [PATCH 06/20] qemu_caps: Prefer VIR_DOMAIN_CAPS_ENUM_IS_SET() Date: Mon, 6 Oct 2025 15:14:37 +0200 Message-ID: <5a56d124d556f299fcc0669a11096e467e8c86b4.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: C82CSbsbpL1un26vFG26Ob2TOfsD54XGBqehbUCWoqY_1759756503 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 7EEUBVH7UGVJMUPQN6Q6NTRFQ4ANDJIM X-Message-ID-Hash: 7EEUBVH7UGVJMUPQN6Q6NTRFQ4ANDJIM 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: 1759757186523116600 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik While virDomainCapsEnum is in fact a bitmap, we also have a macro to manipulate/query individual bits. Prefer it to make the code more readable. Signed-off-by: Michal Privoznik --- src/qemu/qemu_capabilities.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 618291e5b6..5b485d7bfb 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -5065,7 +5065,7 @@ virQEMUCapsFormatHypervCapabilities(virQEMUCaps *qemu= Caps, size_t i; =20 for (i =3D 0; i < sizeof(hvcaps->features.values) * CHAR_BIT; i++)= { - if (!(hvcaps->features.values & (1U << i))) + if (!VIR_DOMAIN_CAPS_ENUM_IS_SET(hvcaps->features, i)) continue; =20 virBufferAsprintf(&childBuf, "\n", --=20 2.49.1 From nobody Tue Oct 28 08:17:43 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=1759757273; cv=none; d=zohomail.com; s=zohoarc; b=D4nMSGYV11OnIZ9lEwFBlUwve9bx5+uEzmSNWeDkOYcJ9RpzLW+eGipR6ynSVUAFtnQGstzsFKQNmWStHHqa5PRM13S7OmOuh6KIqUDuJUOejRzEbdI+I6EBOMXYEg4A4djtRuyRFe9hpH4Q1JG9O3L2SKcD5jOV/UIwOu04Jwo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1759757273; 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=GmfdGaLOfKYf9FG1QcXRhSqn4WMuzSGpegfkn2K+QkE=; b=gUag4jalqxMS4Chb1JJDAMi7b0S3UTGdCWzBYAPzjWDe6Kq7IIW91JZrgiouewCuaFrLqqkQTpOxfjgCAaz7VSUbmQi9dxFk/uRKvYgQfDhSoSXOB8q6WwNktYGQ06vqW5krAROgGIuWgpkDpe1SKZpuAxd0ev39wTe6qSyuWEA= 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 175975727355378.21855832473034; Mon, 6 Oct 2025 06:27:53 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id B5C4841E5C; Mon, 6 Oct 2025 09:25:51 -0400 (EDT) Received: from [172.19.199.17] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 664F6443A5; Mon, 6 Oct 2025 09:18:37 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 2DAA041C7E; Mon, 6 Oct 2025 09:15:09 -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 1C89841C80 for ; Mon, 6 Oct 2025 09:15:07 -0400 (EDT) Received: from mx-prod-mc-04.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-528-lKG0iHezNSiWyPESYU61Zg-1; Mon, 06 Oct 2025 09:15:05 -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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B30F619560B5 for ; Mon, 6 Oct 2025 13:15:04 +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 08B6F30002CE for ; Mon, 6 Oct 2025 13:15: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=-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=1759756506; 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=GmfdGaLOfKYf9FG1QcXRhSqn4WMuzSGpegfkn2K+QkE=; b=faXpgXTh8Xz8cW79O4LGn2hUAY4+Y7HPoHt9dYcS/EM97kERpuR7PiLQjA5pRRtO2p7gA9 GBCn0yPJ9QrRqUtGFitoa1Djx4ermlWpICHBJPm0SMbyQQoFOPwc3RwuUx1lTY9yh0BHSO SNKO09JuOtLcvuDALLhAzT+Byr5ibJk= X-MC-Unique: lKG0iHezNSiWyPESYU61Zg-1 X-Mimecast-MFC-AGG-ID: lKG0iHezNSiWyPESYU61Zg_1759756504 To: devel@lists.libvirt.org Subject: [PATCH 07/20] qemu_command: Move hyperv cmd line generation into a function Date: Mon, 6 Oct 2025 15:14:38 +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: wsNtU0DrJAclzwJdgssaNU23OKcIWxKvizJCdgnEjFg_1759756504 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: ZU6W7WMZDIF3BSYCZABZL22FTOA7MYAR X-Message-ID-Hash: ZU6W7WMZDIF3BSYCZABZL22FTOA7MYAR 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: 1759757275741116600 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik Signed-off-by: Michal Privoznik --- src/qemu/qemu_command.c | 155 ++++++++++++++++++++++------------------ 1 file changed, 85 insertions(+), 70 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 08e2a5147d..b235b505a8 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -6449,6 +6449,89 @@ qemuBuildCpuModelArgStr(virQEMUDriver *driver, return 0; } =20 + +static int +qemuBuildCpuHypervCommandLine(virBuffer *buf, + const virDomainDef *def) +{ + size_t i; + + if (def->features[VIR_DOMAIN_FEATURE_HYPERV] =3D=3D VIR_DOMAIN_HYPERV_= MODE_NONE) + return 0; + + switch ((virDomainHyperVMode) def->features[VIR_DOMAIN_FEATURE_HYPERV]= ) { + case VIR_DOMAIN_HYPERV_MODE_CUSTOM: + break; + + case VIR_DOMAIN_HYPERV_MODE_PASSTHROUGH: + virBufferAsprintf(buf, ",hv-%s=3Don", "passthrough"); + break; + + case VIR_DOMAIN_HYPERV_MODE_NONE: + case VIR_DOMAIN_HYPERV_MODE_LAST: + default: + virReportEnumRangeError(virDomainHyperVMode, + def->features[VIR_DOMAIN_FEATURE_HYPERV]); + return -1; + } + + for (i =3D 0; i < VIR_DOMAIN_HYPERV_LAST; i++) { + switch ((virDomainHyperv) i) { + case VIR_DOMAIN_HYPERV_RELAXED: + case VIR_DOMAIN_HYPERV_VAPIC: + case VIR_DOMAIN_HYPERV_VPINDEX: + case VIR_DOMAIN_HYPERV_RUNTIME: + case VIR_DOMAIN_HYPERV_SYNIC: + case VIR_DOMAIN_HYPERV_STIMER: + case VIR_DOMAIN_HYPERV_RESET: + case VIR_DOMAIN_HYPERV_FREQUENCIES: + case VIR_DOMAIN_HYPERV_REENLIGHTENMENT: + case VIR_DOMAIN_HYPERV_TLBFLUSH: + case VIR_DOMAIN_HYPERV_IPI: + case VIR_DOMAIN_HYPERV_EVMCS: + case VIR_DOMAIN_HYPERV_AVIC: + case VIR_DOMAIN_HYPERV_EMSR_BITMAP: + case VIR_DOMAIN_HYPERV_XMM_INPUT: + if (def->hyperv_features[i] =3D=3D VIR_TRISTATE_SWITCH_ON) { + const char *name =3D virDomainHypervTypeToString(i); + g_autofree char *full_name =3D g_strdup_printf("hv-%s", na= me); + const char *qemu_name =3D virQEMUCapsCPUFeatureToQEMU(def-= >os.arch, + full_n= ame); + virBufferAsprintf(buf, ",%s=3Don", qemu_name); + } + if ((i =3D=3D VIR_DOMAIN_HYPERV_STIMER) && + (def->hyperv_stimer_direct =3D=3D VIR_TRISTATE_SWITCH_ON)) + virBufferAsprintf(buf, ",%s=3Don", VIR_CPU_x86_HV_STIMER_D= IRECT); + if (i =3D=3D VIR_DOMAIN_HYPERV_TLBFLUSH) { + if (def->hyperv_tlbflush_direct =3D=3D VIR_TRISTATE_SWITCH= _ON) + virBufferAsprintf(buf, ",%s=3Don", VIR_CPU_x86_HV_TLBF= LUSH_DIRECT); + if (def->hyperv_tlbflush_extended =3D=3D VIR_TRISTATE_SWIT= CH_ON) + virBufferAsprintf(buf, ",%s=3Don", VIR_CPU_x86_HV_TLBF= LUSH_EXT); + } + break; + + case VIR_DOMAIN_HYPERV_SPINLOCKS: + if (def->hyperv_features[i] =3D=3D VIR_TRISTATE_SWITCH_ON) + virBufferAsprintf(buf, ",%s=3D0x%x", + VIR_CPU_x86_HV_SPINLOCKS, + def->hyperv_spinlocks); + break; + + case VIR_DOMAIN_HYPERV_VENDOR_ID: + if (def->hyperv_features[i] =3D=3D VIR_TRISTATE_SWITCH_ON) + virBufferAsprintf(buf, ",hv-vendor-id=3D%s", + def->hyperv_vendor_id); + break; + + case VIR_DOMAIN_HYPERV_LAST: + break; + } + } + + return 0; +} + + static int qemuBuildCpuCommandLine(virCommand *cmd, virQEMUDriver *driver, @@ -6545,76 +6628,8 @@ qemuBuildCpuCommandLine(virCommand *cmd, VIR_TRISTATE_SWITCH_ON ? "on" : "off"); } =20 - if (def->features[VIR_DOMAIN_FEATURE_HYPERV] !=3D VIR_DOMAIN_HYPERV_MO= DE_NONE) { - switch ((virDomainHyperVMode) def->features[VIR_DOMAIN_FEATURE_HYP= ERV]) { - case VIR_DOMAIN_HYPERV_MODE_CUSTOM: - break; - - case VIR_DOMAIN_HYPERV_MODE_PASSTHROUGH: - virBufferAsprintf(&buf, ",hv-%s=3Don", "passthrough"); - break; - - case VIR_DOMAIN_HYPERV_MODE_NONE: - case VIR_DOMAIN_HYPERV_MODE_LAST: - default: - virReportEnumRangeError(virDomainHyperVMode, - def->features[VIR_DOMAIN_FEATURE_HYPER= V]); - return -1; - } - - for (i =3D 0; i < VIR_DOMAIN_HYPERV_LAST; i++) { - switch ((virDomainHyperv) i) { - case VIR_DOMAIN_HYPERV_RELAXED: - case VIR_DOMAIN_HYPERV_VAPIC: - case VIR_DOMAIN_HYPERV_VPINDEX: - case VIR_DOMAIN_HYPERV_RUNTIME: - case VIR_DOMAIN_HYPERV_SYNIC: - case VIR_DOMAIN_HYPERV_STIMER: - case VIR_DOMAIN_HYPERV_RESET: - case VIR_DOMAIN_HYPERV_FREQUENCIES: - case VIR_DOMAIN_HYPERV_REENLIGHTENMENT: - case VIR_DOMAIN_HYPERV_TLBFLUSH: - case VIR_DOMAIN_HYPERV_IPI: - case VIR_DOMAIN_HYPERV_EVMCS: - case VIR_DOMAIN_HYPERV_AVIC: - case VIR_DOMAIN_HYPERV_EMSR_BITMAP: - case VIR_DOMAIN_HYPERV_XMM_INPUT: - if (def->hyperv_features[i] =3D=3D VIR_TRISTATE_SWITCH_ON)= { - const char *name =3D virDomainHypervTypeToString(i); - g_autofree char *full_name =3D g_strdup_printf("hv-%s"= , name); - const char *qemu_name =3D virQEMUCapsCPUFeatureToQEMU(= def->os.arch, - fu= ll_name); - virBufferAsprintf(&buf, ",%s=3Don", qemu_name); - } - if ((i =3D=3D VIR_DOMAIN_HYPERV_STIMER) && - (def->hyperv_stimer_direct =3D=3D VIR_TRISTATE_SWITCH_= ON)) - virBufferAsprintf(&buf, ",%s=3Don", VIR_CPU_x86_HV_STI= MER_DIRECT); - if (i =3D=3D VIR_DOMAIN_HYPERV_TLBFLUSH) { - if (def->hyperv_tlbflush_direct =3D=3D VIR_TRISTATE_SW= ITCH_ON) - virBufferAsprintf(&buf, ",%s=3Don", VIR_CPU_x86_HV= _TLBFLUSH_DIRECT); - if (def->hyperv_tlbflush_extended =3D=3D VIR_TRISTATE_= SWITCH_ON) - virBufferAsprintf(&buf, ",%s=3Don", VIR_CPU_x86_HV= _TLBFLUSH_EXT); - } - break; - - case VIR_DOMAIN_HYPERV_SPINLOCKS: - if (def->hyperv_features[i] =3D=3D VIR_TRISTATE_SWITCH_ON) - virBufferAsprintf(&buf, ",%s=3D0x%x", - VIR_CPU_x86_HV_SPINLOCKS, - def->hyperv_spinlocks); - break; - - case VIR_DOMAIN_HYPERV_VENDOR_ID: - if (def->hyperv_features[i] =3D=3D VIR_TRISTATE_SWITCH_ON) - virBufferAsprintf(&buf, ",hv-vendor-id=3D%s", - def->hyperv_vendor_id); - break; - - case VIR_DOMAIN_HYPERV_LAST: - break; - } - } - } + if (qemuBuildCpuHypervCommandLine(&buf, def) < 0) + return -1; =20 for (i =3D 0; i < def->npanics; i++) { if (def->panics[i]->model =3D=3D VIR_DOMAIN_PANIC_MODEL_HYPERV) { --=20 2.49.1 From nobody Tue Oct 28 08:17:43 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=1759757276; cv=none; d=zohomail.com; s=zohoarc; b=NVF3BO4rss2wcX8KZAWWnTn81L/VFLswP+lHW5JFNt7GNkZbyWUTGMOz83aMttE+9+2kWQ4XlO9dLpgo7+cz6Mf1Y0M9rQYevGBZcLn8nyCGbuu1HTaptFTN11/fYQj/j4HNWPNSjDXpqS1TU9IKcUDnV1cbOsbGmBwO773hAzI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1759757276; 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=MYJEVJwtmAsv3MPhtSY9e2LQJE1izLTj1RARUrszRDc=; b=m8I2n6efFbDyHvXaMZagr2m0BwEEv10VmTIKYPKT85QZefxS3gBFW4VFir/BB30JQuRGceREs3DuLLlB4M6hnarJqyvKlM5p5rwXM6W3i6T7Mwht/0ir9rhnivojvZwF9qKo58Un347iS9lRdyLBMN8NH2UdX6T3/kvBZgtm3Bs= 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 1759757276097237.44441200141046; Mon, 6 Oct 2025 06:27:56 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id A8195442FC; Mon, 6 Oct 2025 09:26:57 -0400 (EDT) Received: from [172.19.199.17] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 4AA91442DD; Mon, 6 Oct 2025 09:18:52 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id EE90B41C82; Mon, 6 Oct 2025 09:15:09 -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 3B58D41C81 for ; Mon, 6 Oct 2025 09:15:08 -0400 (EDT) Received: from mx-prod-mc-08.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-551-V25y-1pNOmO1cInYO-3w5g-1; Mon, 06 Oct 2025 09:15: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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D9D7118002C5 for ; Mon, 6 Oct 2025 13:15:05 +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 26DE93002D11 for ; Mon, 6 Oct 2025 13:15:04 +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=1759756507; 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=MYJEVJwtmAsv3MPhtSY9e2LQJE1izLTj1RARUrszRDc=; b=FHWo/C82eFXzFUnnrLxykIu5c/BXO9sMTV7YkXqorZ5j6ldLLxJsvC/txJwfBrxVMR4zyc gvyW+d2zoT77N4T4vMwwLXY9S9AgztbsubifboD23SbUOUEJtC41JlBFC02mPgGpiIZk4Q 6oL+I2mzIKiLqprEe3NZLzDLgNmdDDs= X-MC-Unique: V25y-1pNOmO1cInYO-3w5g-1 X-Mimecast-MFC-AGG-ID: V25y-1pNOmO1cInYO-3w5g_1759756506 To: devel@lists.libvirt.org Subject: [PATCH 08/20] qemu_command: Prefer virBufferAddLit() in qemuBuildCpuHypervCommandLine() Date: Mon, 6 Oct 2025 15:14:39 +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: zuL4DGDcL_g-kwcQuMjOpMQs7xmgs6sl2oBWkgLHn84_1759756506 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 3PCZGHEZLI2P3JOZVPQ7DJ5CPACNA4VQ X-Message-ID-Hash: 3PCZGHEZLI2P3JOZVPQ7DJ5CPACNA4VQ 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: 1759757283415116600 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik Using virBufferAsprintf() just to concatenate two literal strings is excessive. Use virBufferAddLit(). Signed-off-by: Michal Privoznik --- src/qemu/qemu_command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index b235b505a8..9276d2d5d2 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -6464,7 +6464,7 @@ qemuBuildCpuHypervCommandLine(virBuffer *buf, break; =20 case VIR_DOMAIN_HYPERV_MODE_PASSTHROUGH: - virBufferAsprintf(buf, ",hv-%s=3Don", "passthrough"); + virBufferAddLit(buf, ",hv-passthrough=3Don"); break; =20 case VIR_DOMAIN_HYPERV_MODE_NONE: --=20 2.49.1 From nobody Tue Oct 28 08:17:43 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=1759757330; cv=none; d=zohomail.com; s=zohoarc; b=D4URXffyxptjjWOy1ncSeWTVWGMfHaJLk1d7yt4SXdW3TVHjXWgRQ0Vue6oHKzJ+gzGA8utu0dg0HroFJRd+/mJ2Amp/KH9nIXfZAXNpZBM97eM8wd7MTe+mMKQwdLEpUKHDYvoRbHx0zwOGvSNE1MS17QXNJNAWAXwaNQ6v0fw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1759757330; 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=uStVmKL3c86LHGf13Ev+eKTl7aQU2JgxbHesYBCLGfc=; b=FJi6+kMtXwpdiwFIRMxpuI7uPgw/Ecgu81TkSvOJ2u6pMUR7ULKBWO21NvpTnGqcMpRcf/PsJNmeEdsuhScq7hmrBOykPQtEQZ7ONTsEoSNp8NVlz1cnmSsOgGxhUNQdwB3GQ2Pz/gjapSk7Ky79xYs6eb6VpURoVejubc0d0lE= 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 1759757330370613.6708912084832; Mon, 6 Oct 2025 06:28:50 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 6C8023F340; Mon, 6 Oct 2025 09:28:26 -0400 (EDT) Received: from [172.19.199.17] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 8051E44845; Mon, 6 Oct 2025 09:19:08 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 84E9341C81; Mon, 6 Oct 2025 09:15:10 -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 6AEAC41C7F for ; Mon, 6 Oct 2025 09:15:09 -0400 (EDT) Received: from mx-prod-mc-08.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-572-3xlQ5_fTNCu4i2Ze6sU9eA-1; Mon, 06 Oct 2025 09:15:07 -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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 03894180034D for ; Mon, 6 Oct 2025 13:15:07 +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 4E5CC30002CC for ; Mon, 6 Oct 2025 13:15:06 +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=1759756509; 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=uStVmKL3c86LHGf13Ev+eKTl7aQU2JgxbHesYBCLGfc=; b=WrNzgYRe9dkTajDXvKRcyjaUp4XJqdoP0CkD7gJrKwofSJlQ6lADYCxeWeLzsD7ZQF0RaS vuPBeXucW/H0h40LMtXOOAmHAF3jU1dWgO8PcEj70nY2ekGIKT0863Iy/+hNdo7xuzNBp9 CEEPNhQQyvZRAEIanX7lXVZWxZaNcl4= X-MC-Unique: 3xlQ5_fTNCu4i2Ze6sU9eA-1 X-Mimecast-MFC-AGG-ID: 3xlQ5_fTNCu4i2Ze6sU9eA_1759756507 To: devel@lists.libvirt.org Subject: [PATCH 09/20] libxl: Simplify setting HyperV features Date: Mon, 6 Oct 2025 15:14:40 +0200 Message-ID: <1862ddb9447e384431d6274611ce9b79777a4ab1.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: hfTfCVwnWLAhJFyEG-BCuDlslcGeBjugeqKmnAcdbFs_1759756507 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: JUUZ76AVQD5ZCCG5RZ7WSRATVMHT7FOS X-Message-ID-Hash: JUUZ76AVQD5ZCCG5RZ7WSRATVMHT7FOS 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: 1759757332259116600 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik Inside of libxlMakeDomBuildInfo() there's a huge switch() for each virDomainHyperv case. Instead of checking whether feature is enabled in each 'case', let's just check it at the beginning of each loop. Signed-off-by: Michal Privoznik --- src/libxl/libxl_conf.c | 67 +++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 40 deletions(-) diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index 9d8301169b..9395ac675e 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -608,60 +608,49 @@ libxlMakeDomBuildInfo(virDomainDef *def, } =20 for (i =3D 0; i < VIR_DOMAIN_HYPERV_LAST; i++) { + if (def->hyperv_features[i] !=3D VIR_TRISTATE_SWITCH_ON) + continue; + switch ((virDomainHyperv) i) { case VIR_DOMAIN_HYPERV_VPINDEX: case VIR_DOMAIN_HYPERV_RELAXED: /* Already set by base flag */ break; case VIR_DOMAIN_HYPERV_SYNIC: - if (def->hyperv_features[i] =3D=3D VIR_TRISTATE_SWITCH= _ON) { - libxl_bitmap_set(&b_info->u.hvm.viridian_enable, - LIBXL_VIRIDIAN_ENLIGHTENMENT_SYNI= C); - } + libxl_bitmap_set(&b_info->u.hvm.viridian_enable, + LIBXL_VIRIDIAN_ENLIGHTENMENT_SYNIC); break; case VIR_DOMAIN_HYPERV_STIMER: - if (def->hyperv_features[i] =3D=3D VIR_TRISTATE_SWITCH= _ON) { - /* STIMER implies synic and clock features */ - libxl_bitmap_set(&b_info->u.hvm.viridian_enable, - LIBXL_VIRIDIAN_ENLIGHTENMENT_STIM= ER); - libxl_bitmap_set(&b_info->u.hvm.viridian_enable, - LIBXL_VIRIDIAN_ENLIGHTENMENT_SYNI= C); - libxl_bitmap_set(&b_info->u.hvm.viridian_enable, - LIBXL_VIRIDIAN_ENLIGHTENMENT_TIME= _REF_COUNT); - libxl_bitmap_set(&b_info->u.hvm.viridian_enable, - LIBXL_VIRIDIAN_ENLIGHTENMENT_REFE= RENCE_TSC); - } + /* STIMER implies synic and clock features */ + libxl_bitmap_set(&b_info->u.hvm.viridian_enable, + LIBXL_VIRIDIAN_ENLIGHTENMENT_STIMER); + libxl_bitmap_set(&b_info->u.hvm.viridian_enable, + LIBXL_VIRIDIAN_ENLIGHTENMENT_SYNIC); + libxl_bitmap_set(&b_info->u.hvm.viridian_enable, + LIBXL_VIRIDIAN_ENLIGHTENMENT_TIME_REF= _COUNT); + libxl_bitmap_set(&b_info->u.hvm.viridian_enable, + LIBXL_VIRIDIAN_ENLIGHTENMENT_REFERENC= E_TSC); break; case VIR_DOMAIN_HYPERV_VAPIC: - if (def->hyperv_features[i] =3D=3D VIR_TRISTATE_SWITCH= _ON) { - libxl_bitmap_set(&b_info->u.hvm.viridian_enable, - LIBXL_VIRIDIAN_ENLIGHTENMENT_APIC= _ASSIST); - } + libxl_bitmap_set(&b_info->u.hvm.viridian_enable, + LIBXL_VIRIDIAN_ENLIGHTENMENT_APIC_ASS= IST); break; case VIR_DOMAIN_HYPERV_FREQUENCIES: - if (def->hyperv_features[i] =3D=3D VIR_TRISTATE_SWITCH= _ON) { - libxl_bitmap_set(&b_info->u.hvm.viridian_enable, - LIBXL_VIRIDIAN_ENLIGHTENMENT_FREQ= ); - } + libxl_bitmap_set(&b_info->u.hvm.viridian_enable, + LIBXL_VIRIDIAN_ENLIGHTENMENT_FREQ); break; case VIR_DOMAIN_HYPERV_TLBFLUSH: - if (def->hyperv_features[i] =3D=3D VIR_TRISTATE_SWITCH= _ON) { - libxl_bitmap_set(&b_info->u.hvm.viridian_enable, - LIBXL_VIRIDIAN_ENLIGHTENMENT_HCAL= L_REMOTE_TLB_FLUSH); - } + libxl_bitmap_set(&b_info->u.hvm.viridian_enable, + LIBXL_VIRIDIAN_ENLIGHTENMENT_HCALL_RE= MOTE_TLB_FLUSH); break; case VIR_DOMAIN_HYPERV_IPI: - if (def->hyperv_features[i] =3D=3D VIR_TRISTATE_SWITCH= _ON) { - libxl_bitmap_set(&b_info->u.hvm.viridian_enable, - LIBXL_VIRIDIAN_ENLIGHTENMENT_HCAL= L_IPI); - } + libxl_bitmap_set(&b_info->u.hvm.viridian_enable, + LIBXL_VIRIDIAN_ENLIGHTENMENT_HCALL_IP= I); break; case VIR_DOMAIN_HYPERV_SPINLOCKS: case VIR_DOMAIN_HYPERV_VENDOR_ID: - if (def->hyperv_features[i] =3D=3D VIR_TRISTATE_SWITCH= _ON) { - const char *name =3D virDomainHypervTypeToString(i= ); - VIR_WARN("Hyper-v flag '%s' specified per-domain b= ut is a global Xen setting and will be ignored.", name); - } + VIR_WARN("Hyper-v flag '%s' specified per-domain but i= s a global Xen setting and will be ignored.", + virDomainHypervTypeToString(i)); break; case VIR_DOMAIN_HYPERV_RUNTIME: case VIR_DOMAIN_HYPERV_RESET: @@ -670,11 +659,9 @@ libxlMakeDomBuildInfo(virDomainDef *def, case VIR_DOMAIN_HYPERV_AVIC: case VIR_DOMAIN_HYPERV_EMSR_BITMAP: case VIR_DOMAIN_HYPERV_XMM_INPUT: - if (def->hyperv_features[i] =3D=3D VIR_TRISTATE_SWITCH= _ON) { - const char *name =3D virDomainHypervTypeToString(i= ); - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Hyper-v enlightenment feature '%1$s' is not= supported for Xen domains."), name); - } + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Hyper-v enlightenment feature '%1$s'= is not supported for Xen domains."), + virDomainHypervTypeToString(i)); break; case VIR_DOMAIN_HYPERV_LAST: break; --=20 2.49.1 From nobody Tue Oct 28 08:17:43 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=1759757420; cv=none; d=zohomail.com; s=zohoarc; b=CMrY4e0N9GS1qpbBAAzZDAgIee2gvGnyc2QmYGZEujksRQy7nAv0CKzDrrD5Mv8BTpcm/iwaRg4ixGlTyoTSGbnhK5IWYOdCa/QICtJDOswHdwH6sJZX/7j0jibjZcI18AB+zxcyeKdNsA9IWWdL7cWklOq/evAn/iBuJY3me5I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1759757420; 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=6b/I14Zez8nujvwi6Kq/B2eUOjqUwCRDOxDseIDdoH8=; b=D7v+NMmvlNLr2Xub2ZqcxkEt0nYLoObyasGmCDSRrSEZcZZgtIYP/s0wdGCx1axR/nJ/P9gCqLf3muWmsd0byCTZxTzGMZNmBdZk+uEPcU3hzjuC1IFRnZKIOqtGXCf01PYqcDAxqKm2keT7LqmDSJitSo49Zpnm+bz5tWUP5DY= 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 1759757420194316.1294215027493; Mon, 6 Oct 2025 06:30:20 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 3C36A4182E; Mon, 6 Oct 2025 09:30:19 -0400 (EDT) Received: from [172.19.199.17] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 8398D44319; Mon, 6 Oct 2025 09:19:36 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 6254241C81; Mon, 6 Oct 2025 09:15:12 -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 EA44341C7F for ; Mon, 6 Oct 2025 09:15:10 -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-680-L68TSUlvNWmYStyiEMtWlw-1; Mon, 06 Oct 2025 09:15:09 -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 7FC151955F3C for ; Mon, 6 Oct 2025 13:15:08 +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 745C430002CC for ; Mon, 6 Oct 2025 13:15:07 +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=1759756510; 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=6b/I14Zez8nujvwi6Kq/B2eUOjqUwCRDOxDseIDdoH8=; b=IGUzAkP4/LuG7mL8Z07qhMd+B90hncWBbCCr8IH2gFPS1RQKBFgzzCjXaLAzAAh4ZErbk8 9z3VEHv/Zl1Sq66jGCOo3fs+8OrLCFhfBxI7bcELd4RTmIr56nvh799Nt8Zy0rROrl/Hqy IKRqnp6h3emK4m+++IQfQ9GURbjBbIs= X-MC-Unique: L68TSUlvNWmYStyiEMtWlw-1 X-Mimecast-MFC-AGG-ID: L68TSUlvNWmYStyiEMtWlw_1759756508 To: devel@lists.libvirt.org Subject: [PATCH 10/20] conf: More hyperv related members into a single struct Date: Mon, 6 Oct 2025 15:14:41 +0200 Message-ID: <2dbab69bca5432efd9295e11a93ca146a86ab1ef.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: dDWgwuXZ-X09RNGyAtXYIdqzUHaGtCq2L_kAjKdKjWY_1759756508 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 4GEDHJWRKDYSZ6ACE3XWWXTCAHW6S7X7 X-Message-ID-Hash: 4GEDHJWRKDYSZ6ACE3XWWXTCAHW6S7X7 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: 1759757421990116600 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik So far, we have an array of integers (hyperv_features), an uint (hyperv_spinlocks), a string (hyperv_vendor_id) and some tristate switches scattered across virDomainDef. Soon, new knobs will be introduced and keeping the current state would only worsen readability. Introduce virDomainHypervFeatures struct to place hyperv related features there. Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c | 77 ++++++++++++++++++++++------------------- src/conf/domain_conf.h | 15 ++++---- src/conf/virconftypes.h | 2 ++ src/libxl/libxl_conf.c | 2 +- src/qemu/qemu_command.c | 16 ++++----- src/qemu/qemu_process.c | 8 ++--- 6 files changed, 66 insertions(+), 54 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 55b1a1a691..99ed633836 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -4020,6 +4020,13 @@ virDomainOSDefClear(virDomainOSDef *os) } =20 =20 +static void +virDomainHypervFeaturesClear(virDomainHypervFeatures *hv) +{ + g_free(hv->vendor_id); +} + + void virDomainDefFree(virDomainDef *def) { size_t i; @@ -4147,8 +4154,8 @@ void virDomainDefFree(virDomainDef *def) g_free(def->emulator); g_free(def->description); g_free(def->title); + virDomainHypervFeaturesClear(&def->hyperv); g_free(def->kvm_features); - g_free(def->hyperv_vendor_id); g_free(def->tcg_features); =20 virBlkioDeviceArrayClear(def->blkio.devices, @@ -17049,7 +17056,7 @@ virDomainFeaturesHyperVDefParse(virDomainDef *def, &value) < 0) return -1; =20 - def->hyperv_features[feature] =3D value; + def->hyperv.features[feature] =3D value; =20 switch ((virDomainHyperv) feature) { case VIR_DOMAIN_HYPERV_RELAXED: @@ -17075,11 +17082,11 @@ virDomainFeaturesHyperVDefParse(virDomainDef *def, while (child) { if (STREQ((const char *)child->name, "direct")) { if (virXMLPropTristateSwitch(child, "state", VIR_XML_P= ROP_REQUIRED, - &def->hyperv_tlbflush_dir= ect) < 0) + &def->hyperv.tlbflush_dir= ect) < 0) return -1; } else if (STREQ((const char *)child->name, "extended")) { if (virXMLPropTristateSwitch(child, "state", VIR_XML_P= ROP_REQUIRED, - &def->hyperv_tlbflush_ext= ended) < 0) + &def->hyperv.tlbflush_ext= ended) < 0) return -1; } else { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -17106,7 +17113,7 @@ virDomainFeaturesHyperVDefParse(virDomainDef *def, } =20 if (virXMLPropTristateSwitch(child, "state", VIR_XML_PROP_= REQUIRED, - &def->hyperv_stimer_direct) <= 0) + &def->hyperv.stimer_direct) <= 0) return -1; =20 child =3D xmlNextElementSibling(child); @@ -17118,10 +17125,10 @@ virDomainFeaturesHyperVDefParse(virDomainDef *def, break; =20 if (virXMLPropUInt(node, "retries", 0, VIR_XML_PROP_REQUIRED, - &def->hyperv_spinlocks) < 0) + &def->hyperv.spinlocks) < 0) return -1; =20 - if (def->hyperv_spinlocks < 0xFFF) { + if (def->hyperv.spinlocks < 0xFFF) { virReportError(VIR_ERR_XML_ERROR, "%s", _("HyperV spinlock retry count must be at l= east 4095")); return -1; @@ -17132,15 +17139,15 @@ virDomainFeaturesHyperVDefParse(virDomainDef *def, if (value !=3D VIR_TRISTATE_SWITCH_ON) break; =20 - g_clear_pointer(&def->hyperv_vendor_id, g_free); + g_clear_pointer(&def->hyperv.vendor_id, g_free); =20 - if (!(def->hyperv_vendor_id =3D virXMLPropString(node, "value"= ))) { + if (!(def->hyperv.vendor_id =3D virXMLPropString(node, "value"= ))) { virReportError(VIR_ERR_XML_ERROR, "%s", _("missing 'value' attribute for HyperV fea= ture 'vendor_id'")); return -1; } =20 - if (!STRLIM(def->hyperv_vendor_id, VIR_DOMAIN_HYPERV_VENDOR_ID= _MAX)) { + if (!STRLIM(def->hyperv.vendor_id, VIR_DOMAIN_HYPERV_VENDOR_ID= _MAX)) { virReportError(VIR_ERR_XML_ERROR, _("HyperV vendor_id value must not be more = than %1$d characters."), VIR_DOMAIN_HYPERV_VENDOR_ID_MAX); @@ -17148,7 +17155,7 @@ virDomainFeaturesHyperVDefParse(virDomainDef *def, } =20 /* ensure that the string can be passed to qemu */ - if (strchr(def->hyperv_vendor_id, ',')) { + if (strchr(def->hyperv.vendor_id, ',')) { virReportError(VIR_ERR_XML_ERROR, "%s", _("HyperV vendor_id value is invalid")); return -1; @@ -21641,12 +21648,12 @@ virDomainDefFeaturesCheckABIStability(virDomainDe= f *src, case VIR_DOMAIN_HYPERV_AVIC: case VIR_DOMAIN_HYPERV_EMSR_BITMAP: case VIR_DOMAIN_HYPERV_XMM_INPUT: - if (src->hyperv_features[i] !=3D dst->hyperv_features[i]) { + if (src->hyperv.features[i] !=3D dst->hyperv.features[i]) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("State of HyperV enlightenment featur= e '%1$s' differs: source: '%2$s', destination: '%3$s'"), virDomainHypervTypeToString(i), - virTristateSwitchTypeToString(src->hype= rv_features[i]), - virTristateSwitchTypeToString(dst->hype= rv_features[i])); + virTristateSwitchTypeToString(src->hype= rv.features[i]), + virTristateSwitchTypeToString(dst->hype= rv.features[i])); return false; } =20 @@ -21654,21 +21661,21 @@ virDomainDefFeaturesCheckABIStability(virDomainDe= f *src, =20 case VIR_DOMAIN_HYPERV_SPINLOCKS: /* spinlock count matters! */ - if (src->hyperv_spinlocks !=3D dst->hyperv_spinlocks) { + if (src->hyperv.spinlocks !=3D dst->hyperv.spinlocks) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("HyperV spinlock retry count differs:= source: '%1$u', destination: '%2$u'"), - src->hyperv_spinlocks, - dst->hyperv_spinlocks); + src->hyperv.spinlocks, + dst->hyperv.spinlocks); return false; } break; =20 case VIR_DOMAIN_HYPERV_VENDOR_ID: - if (STRNEQ_NULLABLE(src->hyperv_vendor_id, dst->hyperv_ven= dor_id)) { + if (STRNEQ_NULLABLE(src->hyperv.vendor_id, dst->hyperv.ven= dor_id)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("HyperV vendor_id differs: source: '%= 1$s', destination: '%2$s'"), - src->hyperv_vendor_id, - dst->hyperv_vendor_id); + src->hyperv.vendor_id, + dst->hyperv.vendor_id); return false; } break; @@ -21679,12 +21686,12 @@ virDomainDefFeaturesCheckABIStability(virDomainDe= f *src, } } =20 - if (src->hyperv_features[VIR_DOMAIN_HYPERV_STIMER] =3D=3D VIR_TRISTATE= _SWITCH_ON) { - if (src->hyperv_stimer_direct !=3D dst->hyperv_stimer_direct) { + if (src->hyperv.features[VIR_DOMAIN_HYPERV_STIMER] =3D=3D VIR_TRISTATE= _SWITCH_ON) { + if (src->hyperv.stimer_direct !=3D dst->hyperv.stimer_direct) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("State of HyperV stimer direct feature differ= s: source: '%1$s', destination: '%2$s'"), - virTristateSwitchTypeToString(src->hyperv_stime= r_direct), - virTristateSwitchTypeToString(dst->hyperv_stime= r_direct)); + virTristateSwitchTypeToString(src->hyperv.stime= r_direct), + virTristateSwitchTypeToString(dst->hyperv.stime= r_direct)); return false; } } @@ -28599,11 +28606,11 @@ virDomainFeaturesHyperVDefFormat(virBuffer *buf, g_auto(virBuffer) hypervAttrBuf =3D VIR_BUFFER_INITIALIZER; g_auto(virBuffer) hypervChildBuf =3D VIR_BUFFER_INIT_CHILD(&childB= uf); =20 - if (def->hyperv_features[j] =3D=3D VIR_TRISTATE_SWITCH_ABSENT) + if (def->hyperv.features[j] =3D=3D VIR_TRISTATE_SWITCH_ABSENT) continue; =20 virBufferAsprintf(&hypervAttrBuf, " state=3D'%s'", - virTristateSwitchTypeToString(def->hyperv_featur= es[j])); + virTristateSwitchTypeToString(def->hyperv.featur= es[j])); =20 switch ((virDomainHyperv) j) { case VIR_DOMAIN_HYPERV_RELAXED: @@ -28622,34 +28629,34 @@ virDomainFeaturesHyperVDefFormat(virBuffer *buf, break; =20 case VIR_DOMAIN_HYPERV_SPINLOCKS: - if (def->hyperv_features[j] =3D=3D VIR_TRISTATE_SWITCH_ON) { + if (def->hyperv.features[j] =3D=3D VIR_TRISTATE_SWITCH_ON) { virBufferAsprintf(&hypervAttrBuf, - " retries=3D'%d'", def->hyperv_spinlocks= ); + " retries=3D'%d'", def->hyperv.spinlocks= ); } break; =20 case VIR_DOMAIN_HYPERV_STIMER: - if (def->hyperv_features[j] =3D=3D VIR_TRISTATE_SWITCH_ON && - def->hyperv_stimer_direct =3D=3D VIR_TRISTATE_SWITCH_ON) { + if (def->hyperv.features[j] =3D=3D VIR_TRISTATE_SWITCH_ON && + def->hyperv.stimer_direct =3D=3D VIR_TRISTATE_SWITCH_ON) { virBufferAddLit(&hypervChildBuf, "\n= "); } =20 break; =20 case VIR_DOMAIN_HYPERV_VENDOR_ID: - if (def->hyperv_features[j] =3D=3D VIR_TRISTATE_SWITCH_ON) { + if (def->hyperv.features[j] =3D=3D VIR_TRISTATE_SWITCH_ON) { virBufferEscapeString(&hypervAttrBuf, " value=3D'%s'", - def->hyperv_vendor_id); + def->hyperv.vendor_id); } break; =20 case VIR_DOMAIN_HYPERV_TLBFLUSH: - if (def->hyperv_features[j] !=3D VIR_TRISTATE_SWITCH_ON) + if (def->hyperv.features[j] !=3D VIR_TRISTATE_SWITCH_ON) break; =20 - if (def->hyperv_tlbflush_direct =3D=3D VIR_TRISTATE_SWITCH_ON) + if (def->hyperv.tlbflush_direct =3D=3D VIR_TRISTATE_SWITCH_ON) virBufferAddLit(&hypervChildBuf, "\n= "); - if (def->hyperv_tlbflush_extended =3D=3D VIR_TRISTATE_SWITCH_O= N) + if (def->hyperv.tlbflush_extended =3D=3D VIR_TRISTATE_SWITCH_O= N) virBufferAddLit(&hypervChildBuf, "= \n"); break; =20 diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 39807b5fe3..fe6ea63bd9 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -3124,6 +3124,14 @@ struct _virDomainPstoreDef { virDomainDeviceInfo info; }; =20 +struct _virDomainHypervFeatures { + int features[VIR_DOMAIN_HYPERV_LAST]; + unsigned int spinlocks; + virTristateSwitch stimer_direct; + virTristateSwitch tlbflush_direct; + virTristateSwitch tlbflush_extended; + char *vendor_id; +}; =20 #define SCSI_SUPER_WIDE_BUS_MAX_CONT_UNIT 64 #define SCSI_WIDE_BUS_MAX_CONT_UNIT 16 @@ -3195,19 +3203,14 @@ struct _virDomainDef { * See virDomainDefFeaturesCheckABIStability() for details. */ int features[VIR_DOMAIN_FEATURE_LAST]; int caps_features[VIR_DOMAIN_PROCES_CAPS_FEATURE_LAST]; - int hyperv_features[VIR_DOMAIN_HYPERV_LAST]; + virDomainHypervFeatures hyperv; virDomainFeatureKVM *kvm_features; int msrs_features[VIR_DOMAIN_MSRS_LAST]; int xen_features[VIR_DOMAIN_XEN_LAST]; virDomainXenPassthroughMode xen_passthrough_mode; - unsigned int hyperv_spinlocks; - virTristateSwitch hyperv_stimer_direct; - virTristateSwitch hyperv_tlbflush_direct; - virTristateSwitch hyperv_tlbflush_extended; virGICVersion gic_version; virDomainHPTResizing hpt_resizing; unsigned long long hpt_maxpagesize; /* Stored in KiB */ - char *hyperv_vendor_id; virTristateSwitch apic_eoi; virDomainFeatureTCG *tcg_features; =20 diff --git a/src/conf/virconftypes.h b/src/conf/virconftypes.h index 93fc9c9217..6e2573035a 100644 --- a/src/conf/virconftypes.h +++ b/src/conf/virconftypes.h @@ -142,6 +142,8 @@ typedef struct _virDomainHubDef virDomainHubDef; =20 typedef struct _virDomainHugePage virDomainHugePage; =20 +typedef struct _virDomainHypervFeatures virDomainHypervFeatures; + typedef struct _virDomainIOMMUDef virDomainIOMMUDef; =20 typedef struct _virDomainIOThreadIDDef virDomainIOThreadIDDef; diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index 9395ac675e..875e9441a2 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -608,7 +608,7 @@ libxlMakeDomBuildInfo(virDomainDef *def, } =20 for (i =3D 0; i < VIR_DOMAIN_HYPERV_LAST; i++) { - if (def->hyperv_features[i] !=3D VIR_TRISTATE_SWITCH_ON) + if (def->hyperv.features[i] !=3D VIR_TRISTATE_SWITCH_ON) continue; =20 switch ((virDomainHyperv) i) { diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 9276d2d5d2..ffe24ae256 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -6492,7 +6492,7 @@ qemuBuildCpuHypervCommandLine(virBuffer *buf, case VIR_DOMAIN_HYPERV_AVIC: case VIR_DOMAIN_HYPERV_EMSR_BITMAP: case VIR_DOMAIN_HYPERV_XMM_INPUT: - if (def->hyperv_features[i] =3D=3D VIR_TRISTATE_SWITCH_ON) { + if (def->hyperv.features[i] =3D=3D VIR_TRISTATE_SWITCH_ON) { const char *name =3D virDomainHypervTypeToString(i); g_autofree char *full_name =3D g_strdup_printf("hv-%s", na= me); const char *qemu_name =3D virQEMUCapsCPUFeatureToQEMU(def-= >os.arch, @@ -6500,27 +6500,27 @@ qemuBuildCpuHypervCommandLine(virBuffer *buf, virBufferAsprintf(buf, ",%s=3Don", qemu_name); } if ((i =3D=3D VIR_DOMAIN_HYPERV_STIMER) && - (def->hyperv_stimer_direct =3D=3D VIR_TRISTATE_SWITCH_ON)) + (def->hyperv.stimer_direct =3D=3D VIR_TRISTATE_SWITCH_ON)) virBufferAsprintf(buf, ",%s=3Don", VIR_CPU_x86_HV_STIMER_D= IRECT); if (i =3D=3D VIR_DOMAIN_HYPERV_TLBFLUSH) { - if (def->hyperv_tlbflush_direct =3D=3D VIR_TRISTATE_SWITCH= _ON) + if (def->hyperv.tlbflush_direct =3D=3D VIR_TRISTATE_SWITCH= _ON) virBufferAsprintf(buf, ",%s=3Don", VIR_CPU_x86_HV_TLBF= LUSH_DIRECT); - if (def->hyperv_tlbflush_extended =3D=3D VIR_TRISTATE_SWIT= CH_ON) + if (def->hyperv.tlbflush_extended =3D=3D VIR_TRISTATE_SWIT= CH_ON) virBufferAsprintf(buf, ",%s=3Don", VIR_CPU_x86_HV_TLBF= LUSH_EXT); } break; =20 case VIR_DOMAIN_HYPERV_SPINLOCKS: - if (def->hyperv_features[i] =3D=3D VIR_TRISTATE_SWITCH_ON) + if (def->hyperv.features[i] =3D=3D VIR_TRISTATE_SWITCH_ON) virBufferAsprintf(buf, ",%s=3D0x%x", VIR_CPU_x86_HV_SPINLOCKS, - def->hyperv_spinlocks); + def->hyperv.spinlocks); break; =20 case VIR_DOMAIN_HYPERV_VENDOR_ID: - if (def->hyperv_features[i] =3D=3D VIR_TRISTATE_SWITCH_ON) + if (def->hyperv.features[i] =3D=3D VIR_TRISTATE_SWITCH_ON) virBufferAsprintf(buf, ",hv-vendor-id=3D%s", - def->hyperv_vendor_id); + def->hyperv.vendor_id); break; =20 case VIR_DOMAIN_HYPERV_LAST: diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index ead5bf3e48..02a03a7ce2 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -4418,7 +4418,7 @@ qemuProcessVerifyHypervFeatures(virDomainDef *def, i =3D=3D VIR_DOMAIN_HYPERV_SPINLOCKS) continue; =20 - if (def->hyperv_features[i] !=3D VIR_TRISTATE_SWITCH_ON) + if (def->hyperv.features[i] !=3D VIR_TRISTATE_SWITCH_ON) continue; =20 cpuFeature =3D g_strdup_printf("hv-%s", virDomainHypervTypeToStrin= g(i)); @@ -4429,7 +4429,7 @@ qemuProcessVerifyHypervFeatures(virDomainDef *def, return -1; } else if (rc =3D=3D 1) { if (i =3D=3D VIR_DOMAIN_HYPERV_STIMER) { - if (def->hyperv_stimer_direct !=3D VIR_TRISTATE_SWITCH_ON) + if (def->hyperv.stimer_direct !=3D VIR_TRISTATE_SWITCH_ON) continue; =20 rc =3D virCPUDataCheckFeature(cpu, VIR_CPU_x86_HV_STIMER_D= IRECT); @@ -4444,7 +4444,7 @@ qemuProcessVerifyHypervFeatures(virDomainDef *def, return -1; } if (i =3D=3D VIR_DOMAIN_HYPERV_TLBFLUSH) { - if (def->hyperv_tlbflush_direct =3D=3D VIR_TRISTATE_SWITCH= _ON) { + if (def->hyperv.tlbflush_direct =3D=3D VIR_TRISTATE_SWITCH= _ON) { rc =3D virCPUDataCheckFeature(cpu, VIR_CPU_x86_HV_TLBF= LUSH_DIRECT); if (rc < 0) return -1; @@ -4455,7 +4455,7 @@ qemuProcessVerifyHypervFeatures(virDomainDef *def, return -1; } } - if (def->hyperv_tlbflush_extended =3D=3D VIR_TRISTATE_SWIT= CH_ON) { + if (def->hyperv.tlbflush_extended =3D=3D VIR_TRISTATE_SWIT= CH_ON) { rc =3D virCPUDataCheckFeature(cpu, VIR_CPU_x86_HV_TLBF= LUSH_EXT); if (rc < 0) return -1; --=20 2.49.1 From nobody Tue Oct 28 08:17:43 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=1759757511; cv=none; d=zohomail.com; s=zohoarc; b=V1h6OjUH5nMGDVGkA2hDg8Gk8uzhsmTczZEEyY93tc2r7KxbXdJ7Cip6FXKUMAubNGUFYDnojAnTpHZjpqd38ksio/5pLXAUFxscyEwfdkqNuq8Dut4CwKqVZANRyF8GV5rIQcLU+WB0mn/wUEu76Nwl0BRbFJo8fKsA4Q7ZIUM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1759757511; 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=qK8M3jruUup9eoQfAhaiZpqyyDMuCxiIKByWhYuxj1M=; b=PzPwHcORanmP3n8szCKPw72NJzth7aSf6qsbTW/QzzdviJWq6tlFJF7y2i3zCGdj46nVogXaskaZ/6mgy2G1hkSfvHCVupmLuSf9MU6rdcBkXM+1YwJY+vqXNC6szGYDjBaEfswODoOSOwH+VqBGBdbHCqLWjcnyi8QNuMDUxzM= 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 1759757511349560.407146689383; Mon, 6 Oct 2025 06:31:51 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 7EF0C43FD9; Mon, 6 Oct 2025 09:31:50 -0400 (EDT) Received: from [172.19.199.17] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 5AC5244AFF; Mon, 6 Oct 2025 09:20:02 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 1B46241C7F; Mon, 6 Oct 2025 09:15:12 -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 DBC6341C83 for ; Mon, 6 Oct 2025 09:15:11 -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-659-_7xR6uiFOxCnpdPJb7JUfQ-1; Mon, 06 Oct 2025 09:15:10 -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 891391955F2A for ; Mon, 6 Oct 2025 13:15:09 +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 C92B93001FCA for ; Mon, 6 Oct 2025 13:15:08 +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=1759756511; 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=qK8M3jruUup9eoQfAhaiZpqyyDMuCxiIKByWhYuxj1M=; b=YP2fTomB21+OPwLNqo4dW4XFN6EHmR6Qsit8+XW/GtQzboJQfRpymM27+SHbsUdGFSVpmU 75pLuwkHwW+YbWC9bF+0fwkkjVUfFsOfjOxx5plsVXBsZFEdyqnii/3tGcwMB8xF/+XuNE ZD61MXBt8MpJRLfRhlNa6pu30UHvCkQ= X-MC-Unique: _7xR6uiFOxCnpdPJb7JUfQ-1 X-Mimecast-MFC-AGG-ID: _7xR6uiFOxCnpdPJb7JUfQ_1759756509 To: devel@lists.libvirt.org Subject: [PATCH 11/20] docs: Drop remark on now unsupported version of QEMU Date: Mon, 6 Oct 2025 15:14:42 +0200 Message-ID: <9afcc222be639805c0fe0946f66b962e4fe2d308.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: 0Xk-kAT2iE-_gr1WeG6bwwr_gn6QBBrxMMPNnwdgtiU_1759756509 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: Q44UFCBRF47URQ7GL3ONHZAT2X4QACXV X-Message-ID-Hash: Q44UFCBRF47URQ7GL3ONHZAT2X4QACXV 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: 1759757514982116600 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik In formatdomaincaps.rst under section documenting hyperv features there's a paragraph describing behaviour with QEMU older than 6.1.0. Well, as of v11.2.0-rc1~216 the minimum required version is 6.2.0 rendering the paragraph needless. Drop it. Signed-off-by: Michal Privoznik --- docs/formatdomaincaps.rst | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/formatdomaincaps.rst b/docs/formatdomaincaps.rst index 664194b16d..4eb8211b09 100644 --- a/docs/formatdomaincaps.rst +++ b/docs/formatdomaincaps.rst @@ -871,10 +871,6 @@ are supported. The ``features`` enum corresponds to th= e ```` element (well, its children) as documented in `Hypervisor features `__. =20 -Please note that depending on the QEMU version some capabilities might be -missing even though QEMU does support them. This is because prior to QEMU-= 6.1.0 -not all features were reported by QEMU. - Launch security ^^^^^^^^^^^^^^^ =20 --=20 2.49.1 From nobody Tue Oct 28 08:17:43 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=1759757627; cv=none; d=zohomail.com; s=zohoarc; b=oGiDDsXGQLj58LSda+zsaTsLdx0jHglMO1dy2L9q+nql+OBxNnYlSCe4ROcJatpAmdNZnh9nKBxFVpG4aInNQFtEWwSlvxJPkVya1+ZGVsYabuQvWA6FFV/HOIvBxjkdDU3DQyNXVqzzG55uJbXUAemXNLr13HDbqB3WyOkn0EQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1759757627; 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=aMka0AVoLYS/Y+4IIDQqQGWig5h4uImUczrRtV90mkI=; b=hkHFgGY598hSryQELVs+0aBYMkIHbuh+2o8jCxVJDBxG7KaiB/2J68U9TkcDgc/vwH5Mq58UokyjQCpM6VugnEjYoJeWy2OwNU85Gv8f6/ruQ7rEliqoNySXeU2x1n8EL83hmjcxABHZtWgxyWuXBhX4w/+42A6hYyXso8RTsdo= 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 1759757627846948.8218449443222; Mon, 6 Oct 2025 06:33:47 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id A06DC4402E; Mon, 6 Oct 2025 09:33:43 -0400 (EDT) Received: from [172.19.199.17] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 490E341C9B; Mon, 6 Oct 2025 09:20:19 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 8000141C81; Mon, 6 Oct 2025 09:15:14 -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 2D77541C80 for ; Mon, 6 Oct 2025 09:15:13 -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-628-TUreUq0QNgCE1y3MzlNGEw-1; Mon, 06 Oct 2025 09:15:11 -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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id AD5541800294 for ; Mon, 6 Oct 2025 13:15:10 +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 008353001FCA for ; Mon, 6 Oct 2025 13:15:09 +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=1759756512; 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=aMka0AVoLYS/Y+4IIDQqQGWig5h4uImUczrRtV90mkI=; b=B0KN/2lCIAIDJopHh9MB3kCVcMYyl+mq1RKoVcmFaDmbUGLqSudCuVbd+jWdtP6Fi42B9O ty5c9mEh821rc0MZCagm2OoDFEmqhaZIwVoLY3eZhgSvCpZ1IqYOIn+7o7tafgh3w/jmzo aaT7s1s1ulxFSuaU2kA8P5q7JzxOBdQ= X-MC-Unique: TUreUq0QNgCE1y3MzlNGEw-1 X-Mimecast-MFC-AGG-ID: TUreUq0QNgCE1y3MzlNGEw_1759756510 To: devel@lists.libvirt.org Subject: [PATCH 12/20] conf: Report default hyperv values in domain capabilities Date: Mon, 6 Oct 2025 15:14:43 +0200 Message-ID: <290e1493667147d4df61eb72243dbc36e7489495.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: fBdvGEXy0yJtBiRrUkKepT-qTr_fy-sEy2aa1JHPEb4_1759756510 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 6FYDOLC7PJG3GRHSGWAXPSDJC7EE4MVJ X-Message-ID-Hash: 6FYDOLC7PJG3GRHSGWAXPSDJC7EE4MVJ 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: 1759757630911116600 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik So far the set of available Hyper-V enlightenments are reported in domain capabilities. Well, some enlightenments are more than just simple on/off switch. For instance, the 'spinlocks' enlightenment expects a number, or 'vendor_id' expects a string. All of these have some default values (at least in QEMU) and are used when the passthrough mode is set. Allow querying these defaults in domain capabilities XML. Signed-off-by: Michal Privoznik --- docs/formatdomaincaps.rst | 5 ++- src/conf/domain_capabilities.c | 61 ++++++++++++++++++++++++++++++++- src/conf/domain_capabilities.h | 11 ++++++ src/conf/schemas/domaincaps.rng | 29 ++++++++++++++++ src/libvirt_private.syms | 2 ++ src/qemu/qemu_capabilities.c | 12 +++---- 6 files changed, 111 insertions(+), 9 deletions(-) diff --git a/docs/formatdomaincaps.rst b/docs/formatdomaincaps.rst index 4eb8211b09..32dc09d41e 100644 --- a/docs/formatdomaincaps.rst +++ b/docs/formatdomaincaps.rst @@ -869,7 +869,10 @@ Hyper-V Enlightenments Report which features improving behavior of guests running Microsoft Windo= ws are supported. The ``features`` enum corresponds to the ```` elem= ent (well, its children) as documented in `Hypervisor features -`__. +`__. The ``defaults`` element then +contains child elements describing default values as reported by hyperviso= r, +e.h. whether direct or extended TLB flushes are available. :since:`(since +11.9.0)` =20 Launch security ^^^^^^^^^^^^^^^ diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index f29c4e0515..422b68c085 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -92,6 +92,32 @@ virSGXCapabilitiesFree(virSGXCapability *cap) } =20 =20 +void +virDomainCapsFeatureHypervFree(virDomainCapsFeatureHyperv *cap) +{ + if (!cap) + return; + + g_free(cap->vendor_id); + g_free(cap); +} + + +virDomainCapsFeatureHyperv * +virDomainCapsFeatureHypervCopy(virDomainCapsFeatureHyperv *cap) +{ + virDomainCapsFeatureHyperv *ret =3D NULL; + + if (!cap) + return NULL; + + ret =3D g_memdup2(cap, sizeof(virDomainCapsFeatureHyperv)); + ret->vendor_id =3D g_strdup(cap->vendor_id); + + return ret; +} + + static void virDomainCapsDispose(void *obj) { @@ -105,7 +131,7 @@ virDomainCapsDispose(void *obj) virCPUDefFree(caps->cpu.hostModel); virSEVCapabilitiesFree(caps->sev); virSGXCapabilitiesFree(caps->sgx); - g_free(caps->hyperv); + virDomainCapsFeatureHypervFree(caps->hyperv); =20 values =3D &caps->os.loader.values; for (i =3D 0; i < values->nvalues; i++) @@ -791,6 +817,8 @@ static void virDomainCapsFeatureHypervFormat(virBuffer *buf, const virDomainCapsFeatureHyperv *hyperv) { + virBuffer defaults =3D VIR_BUFFER_INIT_CHILD(buf); + if (!hyperv) return; =20 @@ -798,6 +826,37 @@ virDomainCapsFeatureHypervFormat(virBuffer *buf, =20 ENUM_PROCESS(hyperv, features, virDomainHypervTypeToString); =20 + virBufferAdjustIndent(&defaults, 2); + + if (VIR_DOMAIN_CAPS_ENUM_IS_SET(hyperv->features, VIR_DOMAIN_HYPERV_SP= INLOCKS) && + hyperv->spinlocks !=3D 0) { + virBufferAsprintf(&defaults, "%u\n", hyperv= ->spinlocks); + } + + if (VIR_DOMAIN_CAPS_ENUM_IS_SET(hyperv->features, VIR_DOMAIN_HYPERV_ST= IMER) && + hyperv->stimer_direct !=3D VIR_TRISTATE_SWITCH_ABSENT) { + virBufferAsprintf(&defaults, "%s\n", + virTristateSwitchTypeToString(hyperv->stimer_dir= ect)); + } + + if (VIR_DOMAIN_CAPS_ENUM_IS_SET(hyperv->features, VIR_DOMAIN_HYPERV_TL= BFLUSH)) { + if (hyperv->tlbflush_direct !=3D VIR_TRISTATE_SWITCH_ABSENT) { + virBufferAsprintf(&defaults, "%s\n", + virTristateSwitchTypeToString(hyperv->tlbflu= sh_direct)); + } + + if (hyperv->tlbflush_extended !=3D VIR_TRISTATE_SWITCH_ABSENT) { + virBufferAsprintf(&defaults, "%s\n", + virTristateSwitchTypeToString(hyperv->tlbflu= sh_extended)); + } + } + + if (VIR_DOMAIN_CAPS_ENUM_IS_SET(hyperv->features, VIR_DOMAIN_HYPERV_VE= NDOR_ID)) { + virBufferEscapeString(&defaults, "%s\n", hy= perv->vendor_id); + } + + virXMLFormatElement(buf, "defaults", NULL, &defaults); + FORMAT_EPILOGUE(hyperv); } =20 diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h index 43141dbdd5..437981c711 100644 --- a/src/conf/domain_capabilities.h +++ b/src/conf/domain_capabilities.h @@ -163,6 +163,11 @@ typedef struct _virDomainCapsFeatureHyperv virDomainCa= psFeatureHyperv; struct _virDomainCapsFeatureHyperv { virTristateBool supported; virDomainCapsEnum features; /* Info about supported virDomainHyperv fe= atures */ + unsigned int spinlocks; + virTristateSwitch stimer_direct; + virTristateSwitch tlbflush_direct; + virTristateSwitch tlbflush_extended; + char *vendor_id; }; =20 STATIC_ASSERT_ENUM(VIR_DOMAIN_LAUNCH_SECURITY_LAST); @@ -378,3 +383,9 @@ void virSGXCapabilitiesFree(virSGXCapability *capabilities); =20 G_DEFINE_AUTOPTR_CLEANUP_FUNC(virSGXCapability, virSGXCapabilitiesFree); + +void virDomainCapsFeatureHypervFree(virDomainCapsFeatureHyperv *capabiliti= es); +G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainCapsFeatureHyperv, virDomainCapsFea= tureHypervFree); + +virDomainCapsFeatureHyperv * +virDomainCapsFeatureHypervCopy(virDomainCapsFeatureHyperv *cap); diff --git a/src/conf/schemas/domaincaps.rng b/src/conf/schemas/domaincaps.= rng index 7edae54931..8d0380951d 100644 --- a/src/conf/schemas/domaincaps.rng +++ b/src/conf/schemas/domaincaps.rng @@ -509,6 +509,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + =20 diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index e2457a1569..8b7321e4e0 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -217,6 +217,8 @@ virDomainCapsCPUUsableTypeFromString; virDomainCapsCPUUsableTypeToString; virDomainCapsEnumClear; virDomainCapsEnumSet; +virDomainCapsFeatureHypervCopy; +virDomainCapsFeatureHypervFree; virDomainCapsFormat; virDomainCapsNew; virSEVCapabilitiesFree; diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 5b485d7bfb..2ccddbfcaa 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2070,8 +2070,7 @@ virQEMUCaps *virQEMUCapsNewCopy(virQEMUCaps *qemuCaps) if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_SGX_EPC)) virQEMUCapsSGXInfoCopy(&ret->sgxCapabilities, qemuCaps->sgxCapabil= ities); =20 - ret->hypervCapabilities =3D g_memdup2(qemuCaps->hypervCapabilities, - sizeof(virDomainCapsFeatureHyperv)= ); + ret->hypervCapabilities =3D virDomainCapsFeatureHypervCopy(qemuCaps->h= ypervCapabilities); =20 return g_steal_pointer(&ret); } @@ -2113,7 +2112,7 @@ void virQEMUCapsDispose(void *obj) virSEVCapabilitiesFree(qemuCaps->sevCapabilities); virSGXCapabilitiesFree(qemuCaps->sgxCapabilities); =20 - g_free(qemuCaps->hypervCapabilities); + virDomainCapsFeatureHypervFree(qemuCaps->hypervCapabilities); =20 virQEMUCapsAccelClear(&qemuCaps->kvm); virQEMUCapsAccelClear(&qemuCaps->hvf); @@ -3138,7 +3137,7 @@ static int virQEMUCapsProbeHypervCapabilities(virQEMUCaps *qemuCaps, qemuMonitorCPUModelInfo *fullQEMU) { - g_autofree virDomainCapsFeatureHyperv *hvcaps =3D NULL; + g_autoptr(virDomainCapsFeatureHyperv) hvcaps =3D NULL; size_t i; =20 if (!fullQEMU) @@ -4494,7 +4493,7 @@ static int virQEMUCapsParseHypervCapabilities(virQEMUCaps *qemuCaps, xmlXPathContextPtr ctxt) { - g_autofree virDomainCapsFeatureHyperv *hvcaps =3D NULL; + g_autoptr(virDomainCapsFeatureHyperv) hvcaps =3D NULL; xmlNodePtr n =3D NULL; g_autofree xmlNodePtr *capNodes =3D NULL; int ncapNodes; @@ -6930,8 +6929,7 @@ static void virQEMUCapsFillDomainFeatureHypervCaps(virQEMUCaps *qemuCaps, virDomainCaps *domCaps) { - domCaps->hyperv =3D g_memdup2(qemuCaps->hypervCapabilities, - sizeof(virDomainCapsFeatureHyperv)); + domCaps->hyperv =3D virDomainCapsFeatureHypervCopy(qemuCaps->hypervCap= abilities); } =20 =20 --=20 2.49.1 From nobody Tue Oct 28 08:17:43 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 From nobody Tue Oct 28 08:17:43 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=1759757989; cv=none; d=zohomail.com; s=zohoarc; b=Atl43gXGM61DjdjgY6WrwsPWjFyPJwCDEk+pSl1CdSy52MgqQh/N/4bmqlZTW1Mmm/54X71yPyhqNZwcnHXBAZXXNSxOWylu1OVpiwrAB9auaCypvjXnYHH5d2oJd9ynVb7RKcIJuDbMQXgGaFWfhv2jwu5HGuogmeU82eJHw10= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1759757989; 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=cSyDhMLl42xgoqg4AZGZxD+nDR/d/JdSDmJU1eWqK54=; b=hWLt2iVjXamcUdsUegw5HyRg8gphMnJc9EmLzvamBcBrP5PE33M8aD1OnvdpNW8z793efb6IV1XDiyy3IUO1sZKM1uPr1cn8mZnVx/Be93OVcUWYXASkGQmMUL5R/e2vrky2E2XNE0iep70VGuTFgQ3TWAVlWURJ7a7hvHfTPH0= 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 1759757989525781.635148647204; Mon, 6 Oct 2025 06:39:49 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 69EA244258; Mon, 6 Oct 2025 09:39:48 -0400 (EDT) Received: from [172.19.199.17] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id B4703440C6; Mon, 6 Oct 2025 09:20:59 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 141C541C82; Mon, 6 Oct 2025 09:15:17 -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 CD3FE41C7E for ; Mon, 6 Oct 2025 09:15:15 -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-689-ZtxtNqm2O4WYkGElJYCelA-1; Mon, 06 Oct 2025 09:15:13 -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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2ECFD1800292 for ; Mon, 6 Oct 2025 13:15:13 +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 419A930002CC for ; Mon, 6 Oct 2025 13:15:12 +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=1759756515; 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=cSyDhMLl42xgoqg4AZGZxD+nDR/d/JdSDmJU1eWqK54=; b=OetANl6CG9BRht2oAj3+vxlvZo+nfZxxJ8WZmHlgEy1ic4XObAPyEG2BwLGqsdUPuLqQ0A pO8nWYjM3llMPFXWOxmYUVnJ2b86RCYawWCIrZWokBZnzRt0/Ze6wXYp7UIKXbOd4G5Ijc hWTvNYOph0ocNPpJ1RAvg24TmZHDaoU= X-MC-Unique: ZtxtNqm2O4WYkGElJYCelA-1 X-Mimecast-MFC-AGG-ID: ZtxtNqm2O4WYkGElJYCelA_1759756513 To: devel@lists.libvirt.org Subject: [PATCH 14/20] qemu_capabilities: Fetch new hyperv domcaps Date: Mon, 6 Oct 2025 15:14:45 +0200 Message-ID: <03179e5d2346b2d3cfa2e5fad823fe310858966f.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: P6k4VlhTu_j17dwyG6GOTDQBUokjljNSP8ImUkMvR_c_1759756513 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: TZMUI6CCDGXSR5RFIQEVTNUTGCZBALEZ X-Message-ID-Hash: TZMUI6CCDGXSR5RFIQEVTNUTGCZBALEZ 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: 1759757997329116600 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik Now that everything is prepared, we can start storing the default values for some hyperv features that are reported in domain capabilities XML later. Signed-off-by: Michal Privoznik --- src/qemu/qemu_capabilities.c | 44 +++++++++++++++++++ .../qemu_10.0.0-q35.x86_64+amdsev.xml | 7 +++ .../domaincapsdata/qemu_10.0.0-q35.x86_64.xml | 7 +++ .../qemu_10.0.0-tcg.x86_64+amdsev.xml | 7 +++ .../domaincapsdata/qemu_10.0.0-tcg.x86_64.xml | 7 +++ .../qemu_10.0.0.x86_64+amdsev.xml | 7 +++ tests/domaincapsdata/qemu_10.0.0.x86_64.xml | 7 +++ .../qemu_10.1.0-q35.x86_64+inteltdx.xml | 7 +++ .../domaincapsdata/qemu_10.1.0-q35.x86_64.xml | 7 +++ .../qemu_10.1.0-tcg.x86_64+inteltdx.xml | 7 +++ .../domaincapsdata/qemu_10.1.0-tcg.x86_64.xml | 7 +++ .../qemu_10.1.0.x86_64+inteltdx.xml | 7 +++ tests/domaincapsdata/qemu_10.1.0.x86_64.xml | 7 +++ .../domaincapsdata/qemu_10.2.0-q35.x86_64.xml | 7 +++ .../domaincapsdata/qemu_10.2.0-tcg.x86_64.xml | 7 +++ tests/domaincapsdata/qemu_10.2.0.x86_64.xml | 7 +++ .../domaincapsdata/qemu_8.0.0-q35.x86_64.xml | 7 +++ .../domaincapsdata/qemu_8.0.0-tcg.x86_64.xml | 7 +++ tests/domaincapsdata/qemu_8.0.0.x86_64.xml | 7 +++ .../domaincapsdata/qemu_8.1.0-q35.x86_64.xml | 7 +++ .../domaincapsdata/qemu_8.1.0-tcg.x86_64.xml | 7 +++ tests/domaincapsdata/qemu_8.1.0.x86_64.xml | 7 +++ .../domaincapsdata/qemu_8.2.0-q35.x86_64.xml | 7 +++ .../domaincapsdata/qemu_8.2.0-tcg.x86_64.xml | 7 +++ tests/domaincapsdata/qemu_8.2.0.x86_64.xml | 7 +++ .../domaincapsdata/qemu_9.0.0-q35.x86_64.xml | 7 +++ .../domaincapsdata/qemu_9.0.0-tcg.x86_64.xml | 7 +++ tests/domaincapsdata/qemu_9.0.0.x86_64.xml | 7 +++ .../domaincapsdata/qemu_9.1.0-q35.x86_64.xml | 7 +++ .../domaincapsdata/qemu_9.1.0-tcg.x86_64.xml | 7 +++ tests/domaincapsdata/qemu_9.1.0.x86_64.xml | 7 +++ .../qemu_9.2.0-q35.x86_64+amdsev.xml | 7 +++ .../domaincapsdata/qemu_9.2.0-q35.x86_64.xml | 7 +++ .../qemu_9.2.0-tcg.x86_64+amdsev.xml | 7 +++ .../domaincapsdata/qemu_9.2.0-tcg.x86_64.xml | 7 +++ .../qemu_9.2.0.x86_64+amdsev.xml | 7 +++ tests/domaincapsdata/qemu_9.2.0.x86_64.xml | 7 +++ .../caps_10.0.0_x86_64+amdsev.xml | 5 +++ .../caps_10.0.0_x86_64.xml | 5 +++ .../caps_10.1.0_x86_64+inteltdx.xml | 5 +++ .../caps_10.1.0_x86_64.xml | 5 +++ .../caps_10.2.0_x86_64.xml | 5 +++ .../caps_8.0.0_x86_64.xml | 5 +++ .../caps_8.1.0_x86_64.xml | 5 +++ .../caps_8.2.0_x86_64.xml | 5 +++ .../caps_9.0.0_x86_64.xml | 5 +++ .../caps_9.1.0_x86_64.xml | 5 +++ .../caps_9.2.0_x86_64+amdsev.xml | 5 +++ .../caps_9.2.0_x86_64.xml | 5 +++ 49 files changed, 356 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index f571596b30..2f4664fce3 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -3155,6 +3155,50 @@ virQEMUCapsProbeHypervCapabilities(virQEMUCaps *qemu= Caps, if (!(name =3D STRSKIP(prop.name, "hv-"))) continue; =20 + if (STREQ(prop.name, VIR_CPU_x86_HV_SPINLOCKS)) { + if (prop.type !=3D QEMU_MONITOR_CPU_PROPERTY_NUMBER) { + VIR_DEBUG("Unexpected type '%s' for name '%s'", + qemuMonitorCPUPropertyTypeToString(prop.type), p= rop.name); + continue; + } + + if ((uint32_t)prop.value.number !=3D (uint32_t)-1) + hvcaps->spinlocks =3D prop.value.number; + } else if (STREQ(prop.name, VIR_CPU_x86_HV_STIMER_DIRECT)) { + if (prop.type !=3D QEMU_MONITOR_CPU_PROPERTY_BOOLEAN) { + VIR_DEBUG("Unexpected type '%s' for name '%s'", + qemuMonitorCPUPropertyTypeToString(prop.type), p= rop.name); + } else { + hvcaps->stimer_direct =3D virTristateSwitchFromBool(prop.v= alue.boolean); + } + continue; + } else if (STREQ(prop.name, VIR_CPU_x86_HV_TLBFLUSH_DIRECT)) { + if (prop.type !=3D QEMU_MONITOR_CPU_PROPERTY_BOOLEAN) { + VIR_DEBUG("Unexpected type '%s' for name '%s'", + qemuMonitorCPUPropertyTypeToString(prop.type), p= rop.name); + } else { + hvcaps->tlbflush_direct =3D virTristateSwitchFromBool(prop= .value.boolean); + } + continue; + } else if (STREQ(prop.name, VIR_CPU_x86_HV_TLBFLUSH_EXT)) { + if (prop.type !=3D QEMU_MONITOR_CPU_PROPERTY_BOOLEAN) { + VIR_DEBUG("Unexpected type '%s' for name '%s'", + qemuMonitorCPUPropertyTypeToString(prop.type), p= rop.name); + } else { + hvcaps->tlbflush_extended =3D virTristateSwitchFromBool(pr= op.value.boolean); + } + continue; + } else if (STREQ(prop.name, "hv-vendor-id")) { + if (prop.type !=3D QEMU_MONITOR_CPU_PROPERTY_STRING) { + VIR_DEBUG("Unexpected type '%s' for name '%s'", + qemuMonitorCPUPropertyTypeToString(prop.type), p= rop.name); + continue; + } + + if (STRNEQ(prop.value.string, "")) + hvcaps->vendor_id =3D g_strdup(prop.value.string); + } + hvprop =3D virDomainHypervTypeFromString(name); =20 if (hvprop < 0) { diff --git a/tests/domaincapsdata/qemu_10.0.0-q35.x86_64+amdsev.xml b/tests= /domaincapsdata/qemu_10.0.0-q35.x86_64+amdsev.xml index 5ef892e1ff..ec2944d380 100644 --- a/tests/domaincapsdata/qemu_10.0.0-q35.x86_64+amdsev.xml +++ b/tests/domaincapsdata/qemu_10.0.0-q35.x86_64+amdsev.xml @@ -861,6 +861,13 @@ emsr_bitmap xmm_input + + 4095 + on + on + on + Linux KVM Hv + diff --git a/tests/domaincapsdata/qemu_10.0.0-q35.x86_64.xml b/tests/domain= capsdata/qemu_10.0.0-q35.x86_64.xml index 60cee93cb6..abe4536c18 100644 --- a/tests/domaincapsdata/qemu_10.0.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_10.0.0-q35.x86_64.xml @@ -1716,6 +1716,13 @@ emsr_bitmap xmm_input + + 4095 + on + on + on + Linux KVM Hv + diff --git a/tests/domaincapsdata/qemu_10.0.0-tcg.x86_64+amdsev.xml b/tests= /domaincapsdata/qemu_10.0.0-tcg.x86_64+amdsev.xml index 6dc5bccfed..481092d7b1 100644 --- a/tests/domaincapsdata/qemu_10.0.0-tcg.x86_64+amdsev.xml +++ b/tests/domaincapsdata/qemu_10.0.0-tcg.x86_64+amdsev.xml @@ -1830,6 +1830,13 @@ emsr_bitmap xmm_input + + 4095 + on + on + on + Linux KVM Hv + diff --git a/tests/domaincapsdata/qemu_10.0.0-tcg.x86_64.xml b/tests/domain= capsdata/qemu_10.0.0-tcg.x86_64.xml index de4fbe0dbe..3bec568edf 100644 --- a/tests/domaincapsdata/qemu_10.0.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_10.0.0-tcg.x86_64.xml @@ -1824,6 +1824,13 @@ emsr_bitmap xmm_input + + 4095 + on + on + on + Linux KVM Hv + diff --git a/tests/domaincapsdata/qemu_10.0.0.x86_64+amdsev.xml b/tests/dom= aincapsdata/qemu_10.0.0.x86_64+amdsev.xml index 74bc0dc84e..818876eb89 100644 --- a/tests/domaincapsdata/qemu_10.0.0.x86_64+amdsev.xml +++ b/tests/domaincapsdata/qemu_10.0.0.x86_64+amdsev.xml @@ -861,6 +861,13 @@ emsr_bitmap xmm_input + + 4095 + on + on + on + Linux KVM Hv + diff --git a/tests/domaincapsdata/qemu_10.0.0.x86_64.xml b/tests/domaincaps= data/qemu_10.0.0.x86_64.xml index b41e9ae196..c9c89b202b 100644 --- a/tests/domaincapsdata/qemu_10.0.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_10.0.0.x86_64.xml @@ -1716,6 +1716,13 @@ emsr_bitmap xmm_input + + 4095 + on + on + on + Linux KVM Hv + diff --git a/tests/domaincapsdata/qemu_10.1.0-q35.x86_64+inteltdx.xml b/tes= ts/domaincapsdata/qemu_10.1.0-q35.x86_64+inteltdx.xml index fafa28ecbe..e7b1e4d1ae 100644 --- a/tests/domaincapsdata/qemu_10.1.0-q35.x86_64+inteltdx.xml +++ b/tests/domaincapsdata/qemu_10.1.0-q35.x86_64+inteltdx.xml @@ -773,6 +773,13 @@ emsr_bitmap xmm_input + + 4095 + on + on + on + Linux KVM Hv + diff --git a/tests/domaincapsdata/qemu_10.1.0-q35.x86_64.xml b/tests/domain= capsdata/qemu_10.1.0-q35.x86_64.xml index 3479493fca..9c832a7bfd 100644 --- a/tests/domaincapsdata/qemu_10.1.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_10.1.0-q35.x86_64.xml @@ -1741,6 +1741,13 @@ emsr_bitmap xmm_input + + 4095 + on + on + on + Linux KVM Hv + diff --git a/tests/domaincapsdata/qemu_10.1.0-tcg.x86_64+inteltdx.xml b/tes= ts/domaincapsdata/qemu_10.1.0-tcg.x86_64+inteltdx.xml index eba8023fc8..b0eb35c6c8 100644 --- a/tests/domaincapsdata/qemu_10.1.0-tcg.x86_64+inteltdx.xml +++ b/tests/domaincapsdata/qemu_10.1.0-tcg.x86_64+inteltdx.xml @@ -1820,6 +1820,13 @@ emsr_bitmap xmm_input + + 4095 + on + on + on + Linux KVM Hv + diff --git a/tests/domaincapsdata/qemu_10.1.0-tcg.x86_64.xml b/tests/domain= capsdata/qemu_10.1.0-tcg.x86_64.xml index fd4ea39d42..fb6540b94a 100644 --- a/tests/domaincapsdata/qemu_10.1.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_10.1.0-tcg.x86_64.xml @@ -1821,6 +1821,13 @@ emsr_bitmap xmm_input + + 4095 + on + on + on + Linux KVM Hv + diff --git a/tests/domaincapsdata/qemu_10.1.0.x86_64+inteltdx.xml b/tests/d= omaincapsdata/qemu_10.1.0.x86_64+inteltdx.xml index 9ea7d779b5..468dc22ce9 100644 --- a/tests/domaincapsdata/qemu_10.1.0.x86_64+inteltdx.xml +++ b/tests/domaincapsdata/qemu_10.1.0.x86_64+inteltdx.xml @@ -773,6 +773,13 @@ emsr_bitmap xmm_input + + 4095 + on + on + on + Linux KVM Hv + diff --git a/tests/domaincapsdata/qemu_10.1.0.x86_64.xml b/tests/domaincaps= data/qemu_10.1.0.x86_64.xml index fc90d0d680..df171bb5d7 100644 --- a/tests/domaincapsdata/qemu_10.1.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_10.1.0.x86_64.xml @@ -1741,6 +1741,13 @@ emsr_bitmap xmm_input + + 4095 + on + on + on + Linux KVM Hv + diff --git a/tests/domaincapsdata/qemu_10.2.0-q35.x86_64.xml b/tests/domain= capsdata/qemu_10.2.0-q35.x86_64.xml index ef88475fd5..96b443899a 100644 --- a/tests/domaincapsdata/qemu_10.2.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_10.2.0-q35.x86_64.xml @@ -994,6 +994,13 @@ emsr_bitmap xmm_input + + 4095 + on + on + on + Linux KVM Hv + diff --git a/tests/domaincapsdata/qemu_10.2.0-tcg.x86_64.xml b/tests/domain= capsdata/qemu_10.2.0-tcg.x86_64.xml index fd4ea39d42..fb6540b94a 100644 --- a/tests/domaincapsdata/qemu_10.2.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_10.2.0-tcg.x86_64.xml @@ -1821,6 +1821,13 @@ emsr_bitmap xmm_input + + 4095 + on + on + on + Linux KVM Hv + diff --git a/tests/domaincapsdata/qemu_10.2.0.x86_64.xml b/tests/domaincaps= data/qemu_10.2.0.x86_64.xml index 204e5a5bc6..1deb00fff3 100644 --- a/tests/domaincapsdata/qemu_10.2.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_10.2.0.x86_64.xml @@ -994,6 +994,13 @@ emsr_bitmap xmm_input + + 4095 + on + on + on + Linux KVM Hv + diff --git a/tests/domaincapsdata/qemu_8.0.0-q35.x86_64.xml b/tests/domainc= apsdata/qemu_8.0.0-q35.x86_64.xml index 7fd6a8b043..8a5277934d 100644 --- a/tests/domaincapsdata/qemu_8.0.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_8.0.0-q35.x86_64.xml @@ -1262,6 +1262,13 @@ emsr_bitmap xmm_input + + 4095 + on + off + off + Linux KVM Hv + diff --git a/tests/domaincapsdata/qemu_8.0.0-tcg.x86_64.xml b/tests/domainc= apsdata/qemu_8.0.0-tcg.x86_64.xml index 949534b6cc..9348304998 100644 --- a/tests/domaincapsdata/qemu_8.0.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_8.0.0-tcg.x86_64.xml @@ -1755,6 +1755,13 @@ emsr_bitmap xmm_input + + 4095 + on + off + off + Linux KVM Hv + diff --git a/tests/domaincapsdata/qemu_8.0.0.x86_64.xml b/tests/domaincapsd= ata/qemu_8.0.0.x86_64.xml index db709b0355..f68a87f2e0 100644 --- a/tests/domaincapsdata/qemu_8.0.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_8.0.0.x86_64.xml @@ -1262,6 +1262,13 @@ emsr_bitmap xmm_input + + 4095 + on + off + off + Linux KVM Hv + diff --git a/tests/domaincapsdata/qemu_8.1.0-q35.x86_64.xml b/tests/domainc= apsdata/qemu_8.1.0-q35.x86_64.xml index 5130dd0c6c..a9a113326a 100644 --- a/tests/domaincapsdata/qemu_8.1.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_8.1.0-q35.x86_64.xml @@ -1520,6 +1520,13 @@ emsr_bitmap xmm_input + + 4095 + on + on + on + Linux KVM Hv + diff --git a/tests/domaincapsdata/qemu_8.1.0-tcg.x86_64.xml b/tests/domainc= apsdata/qemu_8.1.0-tcg.x86_64.xml index 8381303e99..f1f41fbe96 100644 --- a/tests/domaincapsdata/qemu_8.1.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_8.1.0-tcg.x86_64.xml @@ -1776,6 +1776,13 @@ emsr_bitmap xmm_input + + 4095 + on + on + on + Linux KVM Hv + diff --git a/tests/domaincapsdata/qemu_8.1.0.x86_64.xml b/tests/domaincapsd= ata/qemu_8.1.0.x86_64.xml index 705e7be2e7..13541e8421 100644 --- a/tests/domaincapsdata/qemu_8.1.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_8.1.0.x86_64.xml @@ -1520,6 +1520,13 @@ emsr_bitmap xmm_input + + 4095 + on + on + on + Linux KVM Hv + diff --git a/tests/domaincapsdata/qemu_8.2.0-q35.x86_64.xml b/tests/domainc= apsdata/qemu_8.2.0-q35.x86_64.xml index 8e026e2f40..dabdf47c6b 100644 --- a/tests/domaincapsdata/qemu_8.2.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_8.2.0-q35.x86_64.xml @@ -1522,6 +1522,13 @@ emsr_bitmap xmm_input + + 4095 + on + on + on + Linux KVM Hv + diff --git a/tests/domaincapsdata/qemu_8.2.0-tcg.x86_64.xml b/tests/domainc= apsdata/qemu_8.2.0-tcg.x86_64.xml index 5878c09b14..7538570678 100644 --- a/tests/domaincapsdata/qemu_8.2.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_8.2.0-tcg.x86_64.xml @@ -1743,6 +1743,13 @@ emsr_bitmap xmm_input + + 4095 + on + on + on + Linux KVM Hv + diff --git a/tests/domaincapsdata/qemu_8.2.0.x86_64.xml b/tests/domaincapsd= ata/qemu_8.2.0.x86_64.xml index 921e87a285..ffcfc42b08 100644 --- a/tests/domaincapsdata/qemu_8.2.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_8.2.0.x86_64.xml @@ -1522,6 +1522,13 @@ emsr_bitmap xmm_input + + 4095 + on + on + on + Linux KVM Hv + diff --git a/tests/domaincapsdata/qemu_9.0.0-q35.x86_64.xml b/tests/domainc= apsdata/qemu_9.0.0-q35.x86_64.xml index 16f8b46b15..7289d5fbdc 100644 --- a/tests/domaincapsdata/qemu_9.0.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_9.0.0-q35.x86_64.xml @@ -1522,6 +1522,13 @@ emsr_bitmap xmm_input + + 4095 + on + on + on + Linux KVM Hv + diff --git a/tests/domaincapsdata/qemu_9.0.0-tcg.x86_64.xml b/tests/domainc= apsdata/qemu_9.0.0-tcg.x86_64.xml index 79411ea73f..141edc67f3 100644 --- a/tests/domaincapsdata/qemu_9.0.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_9.0.0-tcg.x86_64.xml @@ -1672,6 +1672,13 @@ emsr_bitmap xmm_input + + 4095 + on + on + on + Linux KVM Hv + diff --git a/tests/domaincapsdata/qemu_9.0.0.x86_64.xml b/tests/domaincapsd= ata/qemu_9.0.0.x86_64.xml index fa378cf372..5a636f06a8 100644 --- a/tests/domaincapsdata/qemu_9.0.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_9.0.0.x86_64.xml @@ -1522,6 +1522,13 @@ emsr_bitmap xmm_input + + 4095 + on + on + on + Linux KVM Hv + diff --git a/tests/domaincapsdata/qemu_9.1.0-q35.x86_64.xml b/tests/domainc= apsdata/qemu_9.1.0-q35.x86_64.xml index c7ae480df8..4003af73de 100644 --- a/tests/domaincapsdata/qemu_9.1.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_9.1.0-q35.x86_64.xml @@ -1658,6 +1658,13 @@ emsr_bitmap xmm_input + + 4095 + on + on + on + Linux KVM Hv + diff --git a/tests/domaincapsdata/qemu_9.1.0-tcg.x86_64.xml b/tests/domainc= apsdata/qemu_9.1.0-tcg.x86_64.xml index 94b530d1e8..2fdeeb143a 100644 --- a/tests/domaincapsdata/qemu_9.1.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_9.1.0-tcg.x86_64.xml @@ -1777,6 +1777,13 @@ emsr_bitmap xmm_input + + 4095 + on + on + on + Linux KVM Hv + diff --git a/tests/domaincapsdata/qemu_9.1.0.x86_64.xml b/tests/domaincapsd= ata/qemu_9.1.0.x86_64.xml index fce0504d60..ba78d5d24d 100644 --- a/tests/domaincapsdata/qemu_9.1.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_9.1.0.x86_64.xml @@ -1658,6 +1658,13 @@ emsr_bitmap xmm_input + + 4095 + on + on + on + Linux KVM Hv + diff --git a/tests/domaincapsdata/qemu_9.2.0-q35.x86_64+amdsev.xml b/tests/= domaincapsdata/qemu_9.2.0-q35.x86_64+amdsev.xml index 3667417d1b..099c503551 100644 --- a/tests/domaincapsdata/qemu_9.2.0-q35.x86_64+amdsev.xml +++ b/tests/domaincapsdata/qemu_9.2.0-q35.x86_64+amdsev.xml @@ -861,6 +861,13 @@ emsr_bitmap xmm_input + + 4095 + on + on + on + Linux KVM Hv + diff --git a/tests/domaincapsdata/qemu_9.2.0-q35.x86_64.xml b/tests/domainc= apsdata/qemu_9.2.0-q35.x86_64.xml index b4437dd3d0..f83af00819 100644 --- a/tests/domaincapsdata/qemu_9.2.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_9.2.0-q35.x86_64.xml @@ -1716,6 +1716,13 @@ emsr_bitmap xmm_input + + 4095 + on + on + on + Linux KVM Hv + diff --git a/tests/domaincapsdata/qemu_9.2.0-tcg.x86_64+amdsev.xml b/tests/= domaincapsdata/qemu_9.2.0-tcg.x86_64+amdsev.xml index d214915a48..28b9647f14 100644 --- a/tests/domaincapsdata/qemu_9.2.0-tcg.x86_64+amdsev.xml +++ b/tests/domaincapsdata/qemu_9.2.0-tcg.x86_64+amdsev.xml @@ -1830,6 +1830,13 @@ emsr_bitmap xmm_input + + 4095 + on + on + on + Linux KVM Hv + diff --git a/tests/domaincapsdata/qemu_9.2.0-tcg.x86_64.xml b/tests/domainc= apsdata/qemu_9.2.0-tcg.x86_64.xml index 04c13a1335..f3469cdade 100644 --- a/tests/domaincapsdata/qemu_9.2.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_9.2.0-tcg.x86_64.xml @@ -1824,6 +1824,13 @@ emsr_bitmap xmm_input + + 4095 + on + on + on + Linux KVM Hv + diff --git a/tests/domaincapsdata/qemu_9.2.0.x86_64+amdsev.xml b/tests/doma= incapsdata/qemu_9.2.0.x86_64+amdsev.xml index 9b62c679b7..462365ee12 100644 --- a/tests/domaincapsdata/qemu_9.2.0.x86_64+amdsev.xml +++ b/tests/domaincapsdata/qemu_9.2.0.x86_64+amdsev.xml @@ -861,6 +861,13 @@ emsr_bitmap xmm_input + + 4095 + on + on + on + Linux KVM Hv + diff --git a/tests/domaincapsdata/qemu_9.2.0.x86_64.xml b/tests/domaincapsd= ata/qemu_9.2.0.x86_64.xml index 3d970f53db..756e2cf90a 100644 --- a/tests/domaincapsdata/qemu_9.2.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_9.2.0.x86_64.xml @@ -1716,6 +1716,13 @@ emsr_bitmap xmm_input + + 4095 + on + on + on + Linux KVM Hv + diff --git a/tests/qemucapabilitiesdata/caps_10.0.0_x86_64+amdsev.xml b/tes= ts/qemucapabilitiesdata/caps_10.0.0_x86_64+amdsev.xml index b83de7cc4d..e410e11dbe 100644 --- a/tests/qemucapabilitiesdata/caps_10.0.0_x86_64+amdsev.xml +++ b/tests/qemucapabilitiesdata/caps_10.0.0_x86_64+amdsev.xml @@ -3374,5 +3374,10 @@ + 4095 + on + on + on + Linux KVM Hv diff --git a/tests/qemucapabilitiesdata/caps_10.0.0_x86_64.xml b/tests/qemu= capabilitiesdata/caps_10.0.0_x86_64.xml index 4545de53ef..6b50ff6249 100644 --- a/tests/qemucapabilitiesdata/caps_10.0.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_10.0.0_x86_64.xml @@ -4223,5 +4223,10 @@ + 4095 + on + on + on + Linux KVM Hv diff --git a/tests/qemucapabilitiesdata/caps_10.1.0_x86_64+inteltdx.xml b/t= ests/qemucapabilitiesdata/caps_10.1.0_x86_64+inteltdx.xml index 3381f0bafa..3d5d53d3e7 100644 --- a/tests/qemucapabilitiesdata/caps_10.1.0_x86_64+inteltdx.xml +++ b/tests/qemucapabilitiesdata/caps_10.1.0_x86_64+inteltdx.xml @@ -3581,5 +3581,10 @@ + 4095 + on + on + on + Linux KVM Hv diff --git a/tests/qemucapabilitiesdata/caps_10.1.0_x86_64.xml b/tests/qemu= capabilitiesdata/caps_10.1.0_x86_64.xml index 014e0ff44e..9628c5c999 100644 --- a/tests/qemucapabilitiesdata/caps_10.1.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_10.1.0_x86_64.xml @@ -4899,5 +4899,10 @@ + 4095 + on + on + on + Linux KVM Hv diff --git a/tests/qemucapabilitiesdata/caps_10.2.0_x86_64.xml b/tests/qemu= capabilitiesdata/caps_10.2.0_x86_64.xml index b9fe3dc807..4245fa14de 100644 --- a/tests/qemucapabilitiesdata/caps_10.2.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_10.2.0_x86_64.xml @@ -3944,5 +3944,10 @@ + 4095 + on + on + on + Linux KVM Hv diff --git a/tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml b/tests/qemuc= apabilitiesdata/caps_8.0.0_x86_64.xml index 555b078971..f0053a9742 100644 --- a/tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml @@ -3453,5 +3453,10 @@ + 4095 + on + off + off + Linux KVM Hv diff --git a/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml b/tests/qemuc= apabilitiesdata/caps_8.1.0_x86_64.xml index 5e44997c91..c8782763aa 100644 --- a/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml @@ -3782,5 +3782,10 @@ + 4095 + on + on + on + Linux KVM Hv diff --git a/tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml b/tests/qemuc= apabilitiesdata/caps_8.2.0_x86_64.xml index 232a060750..21f40b7f5a 100644 --- a/tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml @@ -3756,5 +3756,10 @@ + 4095 + on + on + on + Linux KVM Hv diff --git a/tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml b/tests/qemuc= apabilitiesdata/caps_9.0.0_x86_64.xml index 4953de2247..5ec8321bf2 100644 --- a/tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml @@ -3692,5 +3692,10 @@ + 4095 + on + on + on + Linux KVM Hv diff --git a/tests/qemucapabilitiesdata/caps_9.1.0_x86_64.xml b/tests/qemuc= apabilitiesdata/caps_9.1.0_x86_64.xml index df062944e2..4c0d5a28f9 100644 --- a/tests/qemucapabilitiesdata/caps_9.1.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_9.1.0_x86_64.xml @@ -3949,5 +3949,10 @@ + 4095 + on + on + on + Linux KVM Hv diff --git a/tests/qemucapabilitiesdata/caps_9.2.0_x86_64+amdsev.xml b/test= s/qemucapabilitiesdata/caps_9.2.0_x86_64+amdsev.xml index 048d1b1462..6caddd450f 100644 --- a/tests/qemucapabilitiesdata/caps_9.2.0_x86_64+amdsev.xml +++ b/tests/qemucapabilitiesdata/caps_9.2.0_x86_64+amdsev.xml @@ -3123,5 +3123,10 @@ + 4095 + on + on + on + Linux KVM Hv diff --git a/tests/qemucapabilitiesdata/caps_9.2.0_x86_64.xml b/tests/qemuc= apabilitiesdata/caps_9.2.0_x86_64.xml index dd2d876cad..665b82560c 100644 --- a/tests/qemucapabilitiesdata/caps_9.2.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_9.2.0_x86_64.xml @@ -3930,5 +3930,10 @@ + 4095 + on + on + on + Linux KVM Hv --=20 2.49.1 From nobody Tue Oct 28 08:17:43 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=1759758247; cv=none; d=zohomail.com; s=zohoarc; b=EuSQC6HpDKUSuNRTxzG5nYFBAFFzD/l0+/H4CgrPuEfuVunG743Ve7dM3v4TO1Ojqp1Dtcn3VfNw3lNq4qtN/2f+sDEMk62bR6m4hob7Lmqqne+l9qvSRYkCRkWzfMC/xrK9waxDdjRAi9qkc/8TQqw9siGDL3MpURcXHYsuePI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1759758247; 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=wpY5lEdSTaMN8M2rvsmCMMcfRbvwOtPefBwQOP4ws+M=; b=CtyRQyyqfZqK1SDXrd4KST4F8mJmyhworyCFeZYauoP4DCydKfMcN53uCKkEbswzvGZcKRzfSZB85llQ1ByRyJtI95wt/xhBG7cqgnhczzHQxtgNS5DpZljyBFMBRGWosycijbBpHw34mmsgcF7bJSjSREgDh7DWdZVuckfmI+E= 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 1759758247408725.3129198006948; Mon, 6 Oct 2025 06:44:07 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 2C42B4415A; Mon, 6 Oct 2025 09:44:04 -0400 (EDT) Received: from [172.19.199.17] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 466F944C25; Mon, 6 Oct 2025 09:21:23 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 7D90B41C8C; Mon, 6 Oct 2025 09:15:20 -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 0D35941C7F for ; Mon, 6 Oct 2025 09:15:17 -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-201-Yey7DIyfMwO7efj9AhlwbA-1; Mon, 06 Oct 2025 09:15:15 -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 4E67A19560BB for ; Mon, 6 Oct 2025 13:15:14 +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 97D6730002CC for ; Mon, 6 Oct 2025 13:15:13 +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=1759756516; 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=Fl8Q+PgYM++3B798qRQxWFZFfzip6mAoHNtQS94Tkgo=; b=MQw+T0T0aIQoxCUPHzLyPSraZBn17hB03HYl4z6gsVwtBLjg3wLosGDYBPp3k01P6NlQr/ sEdMhkA6tU1oWhT/gADqAMblCUqrtyRUXS26vwkUBf3y7Czp9PpCPfCseDqpCXTzpYU3a4 zjNB2J5zMI5Qryo++zit4KcfsoUm8SI= X-MC-Unique: Yey7DIyfMwO7efj9AhlwbA-1 X-Mimecast-MFC-AGG-ID: Yey7DIyfMwO7efj9AhlwbA_1759756514 To: devel@lists.libvirt.org Subject: [PATCH 15/20] hyperv: Support hv-time enlightenment Date: Mon, 6 Oct 2025 15:14:46 +0200 Message-ID: <2558583ff32a93ad56b394805cd36380fc93883f.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: 3r_cFVb4gpG7pvgSSrCCl65x1SNKQKv0PM1iL7EAsus_1759756514 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: BPHQHYOAJFAFOQE2JZBOZ5E4BEWUZCQH X-Message-ID-Hash: BPHQHYOAJFAFOQE2JZBOZ5E4BEWUZCQH 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: 1759758249089116600 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik QEMU supports this enlightenment since version 2.0. It's required by some other enlightenments (e.g. hv-stimer, hv-stimer-direct). >From QEMU docs: ``hv-time`` Enables two Hyper-V-specific clocksources available to the guest: MSR-bas= ed Hyper-V clocksource (HV_X64_MSR_TIME_REF_COUNT, 0x40000020) and Reference= TSC page (enabled via MSR HV_X64_MSR_REFERENCE_TSC, 0x40000021). Both clockso= urces are per-guest, Reference TSC page clocksource allows for exit-less time s= tamp readings. Using this enlightenment leads to significant speedup of all ti= mestamp related operations. Signed-off-by: Michal Privoznik --- docs/formatdomain.rst | 2 ++ src/conf/domain_conf.c | 4 ++++ src/conf/domain_conf.h | 1 + src/conf/schemas/domaincommon.rng | 5 +++++ src/cpu/cpu_x86.c | 5 +++++ src/cpu/cpu_x86_data.h | 1 + src/libxl/libxl_conf.c | 4 ++++ src/qemu/qemu_command.c | 1 + src/qemu/qemu_process.c | 1 + tests/domaincapsdata/qemu_10.0.0-q35.x86_64+amdsev.xml | 1 + tests/domaincapsdata/qemu_10.0.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_10.0.0-tcg.x86_64+amdsev.xml | 1 + tests/domaincapsdata/qemu_10.0.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_10.0.0.x86_64+amdsev.xml | 1 + tests/domaincapsdata/qemu_10.0.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_10.1.0-q35.x86_64+inteltdx.xml | 1 + tests/domaincapsdata/qemu_10.1.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_10.1.0-tcg.x86_64+inteltdx.xml | 1 + tests/domaincapsdata/qemu_10.1.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_10.1.0.x86_64+inteltdx.xml | 1 + tests/domaincapsdata/qemu_10.1.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_10.2.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_10.2.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_10.2.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_8.0.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_8.0.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_8.0.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_8.1.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_8.1.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_8.1.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_8.2.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_8.2.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_8.2.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_9.0.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_9.0.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_9.0.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_9.1.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_9.1.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_9.1.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_9.2.0-q35.x86_64+amdsev.xml | 1 + tests/domaincapsdata/qemu_9.2.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_9.2.0-tcg.x86_64+amdsev.xml | 1 + tests/domaincapsdata/qemu_9.2.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_9.2.0.x86_64+amdsev.xml | 1 + tests/domaincapsdata/qemu_9.2.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_10.0.0_x86_64+amdsev.xml | 1 + tests/qemucapabilitiesdata/caps_10.0.0_x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_10.1.0_x86_64+inteltdx.xml | 1 + tests/qemucapabilitiesdata/caps_10.1.0_x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_10.2.0_x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_9.1.0_x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_9.2.0_x86_64+amdsev.xml | 1 + tests/qemucapabilitiesdata/caps_9.2.0_x86_64.xml | 1 + tests/qemuxmlconfdata/hyperv.x86_64-latest.args | 2 +- tests/qemuxmlconfdata/hyperv.x86_64-latest.xml | 1 + tests/qemuxmlconfdata/hyperv.xml | 1 + 60 files changed, 75 insertions(+), 1 deletion(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index f50dce477f..473233c5d1 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -2078,6 +2078,7 @@ Hypervisors may allow certain CPU / machine features = to be toggled on/off. +