From nobody Wed Apr 15 07:00:19 2026 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=1770902878; cv=none; d=zohomail.com; s=zohoarc; b=F17DPbQkXnzPaqxnfNp/xPot9LHCdguKpbMLDDKPSdaI84JCS+9Iu2bMWXiP6H1EZ2nrJciekyvkOnV4RvXJ6RQeTGbxAKymMvhEai8FwAa7JE6HABuODz/svbF1A7SQaqA5KM4Vd8cOjIts8+rg1mTqi57RQm3Wj3Pkow1A0NI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770902878; 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=Iqvndq3p7Lv51ldZuvr2UbvtFrOrqBunBDXQMiXQDE0=; b=juimeYnas36v6mu4pp8vA0XNBPEYKMeV5U/5T3/+7PU/i34lbZf7TA5a0M6sML4ePqcysqTnfjLZGUQolu8PgkM/aBq9jxzPUE525DJt+rPH5ZUTcf/m9KzWNkxzXeg+dbTzWhgXNn3U2eWM6G+d20TfghktztFHrIph6p+6Bd0= 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 1770902878308654.4456355205235; Thu, 12 Feb 2026 05:27:58 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id B9E78423F2; Thu, 12 Feb 2026 08:27:57 -0500 (EST) Received: from [172.19.199.6] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 07A1443EE3; Thu, 12 Feb 2026 07:52:56 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 8B51D4553B; Thu, 12 Feb 2026 07:51:31 -0500 (EST) Received: from mx1.osci.io (unknown [8.43.85.229]) (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 892B341972 for ; Thu, 12 Feb 2026 07:40:09 -0500 (EST) Received: by mx1.osci.io (Postfix, from userid 995) id 129DF2AE28; Wed, 11 Feb 2026 06:50:32 -0500 (EST) 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 ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mx1.osci.io (Postfix) with ESMTPS id 8BBBC2AE24 for ; Wed, 11 Feb 2026 06:50:31 -0500 (EST) Received: from mx-prod-mc-01.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-681-yKgn89AEPICX0jlvUvYw9A-1; Wed, 11 Feb 2026 06:50:29 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A56031956089 for ; Wed, 11 Feb 2026 11:50:28 +0000 (UTC) Received: from moe (unknown [10.43.3.236]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0D40419560A3 for ; Wed, 11 Feb 2026 11:50:27 +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=-5.0 required=5.0 tests=BAYES_00,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=1770810630; 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=Iqvndq3p7Lv51ldZuvr2UbvtFrOrqBunBDXQMiXQDE0=; b=WG6BHDOpC16o3yFbVjbXzYM4o4IYYDgDFd4luFnvW4UVoLt6RrBLZyEaQYNUZ3+6JS1UVT pDrfNn6quPapOdWb67KNb4ZJ/hvxAsk9Y7GaiVHrN2/kZoIToU7xrozDC8FrxtdOaVIq8N ek1QsEZrpqoaTU18/bhP70M2ZPOM8Bo= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770810631; 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=Iqvndq3p7Lv51ldZuvr2UbvtFrOrqBunBDXQMiXQDE0=; b=iUe71SoBDWlnGF+2F6sgezwnVH3ymkrOh84WlQTCZ9hESP8snQk8hjwlkwg9Nps0j/gTfF H1iTIm5kxLk2bfiRDfrmdtsMJmAJdSBt+JqLnv6IVIKR9NX+BQ5VkQDZnx0IuojbNylsoj VS99hTnCYQb4FRC1uG++AH/0nUB7szg= X-MC-Unique: yKgn89AEPICX0jlvUvYw9A-1 X-Mimecast-MFC-AGG-ID: yKgn89AEPICX0jlvUvYw9A_1770810628 To: devel@lists.libvirt.org Subject: [PATCH 1/2] conf: Parse hyperv features even for host-model Date: Wed, 11 Feb 2026 12:50:23 +0100 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: cwWijeZKTwIoF9jCyVkUW1QWlslg5vQQWMFuK1fdI2Y_1770810628 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: HXSL6IUD3W55YZZHRNH3PMLZ5Q3RNJWK X-Message-ID-Hash: HXSL6IUD3W55YZZHRNH3PMLZ5Q3RNJWK 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 (found 2 invalid signatures) X-ZM-MESSAGEID: 1770902881203154100 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik As it turns out, some users of the hyperv "host-model" mode might want to override the hypervisor defaults. For instance disable a feature that's on by default, or vice versa. Currently, this is not possible because as soon as our XML parser sees the "host-model" mode it exits early and skips parsing of individual features (for "custom" mode). Well, do not return early and parse the rest. Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- docs/formatdomain.rst | 3 +++ src/conf/domain_conf.c | 3 +-- src/conf/schemas/domaincommon.rng | 8 ++++---- tests/qemuxmlconfdata/hyperv-host-model.x86_64-latest.xml | 6 +++++- tests/qemuxmlconfdata/hyperv-host-model.xml | 6 +++++- 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 87644ad42a..31eba779c1 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -2197,6 +2197,9 @@ are: enlightenments are supported by hypervisor and expands them on domain startup into the live XML. In a sense, this is similar to ``host-mod= el`` CPU mode (See `CPU model and topology`_). :since:`Since 11.9.0` + It is also possible to set features, like in ``custom`` mode. These = are + then left untouched and no expansion is done for them. :since:`Since + 12.1.0` =20 The ``mode`` attribute can be omitted and will default to ``custom``. =20 diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index e88dc62520..aee7de9669 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -17220,8 +17220,7 @@ virDomainFeaturesHyperVDefParse(virDomainDef *def, =20 def->features[VIR_DOMAIN_FEATURE_HYPERV] =3D mode; =20 - if (mode =3D=3D VIR_DOMAIN_HYPERV_MODE_PASSTHROUGH || - mode =3D=3D VIR_DOMAIN_HYPERV_MODE_HOST_MODEL) + if (mode =3D=3D VIR_DOMAIN_HYPERV_MODE_PASSTHROUGH) return 0; =20 node =3D xmlFirstElementChild(node); diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincom= mon.rng index e659900687..c2b886dbdc 100644 --- a/src/conf/schemas/domaincommon.rng +++ b/src/conf/schemas/domaincommon.rng @@ -8080,13 +8080,13 @@ passthrough - - host-model - - custom + + custom + host-model + diff --git a/tests/qemuxmlconfdata/hyperv-host-model.x86_64-latest.xml b/te= sts/qemuxmlconfdata/hyperv-host-model.x86_64-latest.xml index 453a43b3c9..9535cee02a 100644 --- a/tests/qemuxmlconfdata/hyperv-host-model.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/hyperv-host-model.x86_64-latest.xml @@ -10,7 +10,11 @@ - + + + + + qemu64 diff --git a/tests/qemuxmlconfdata/hyperv-host-model.xml b/tests/qemuxmlcon= fdata/hyperv-host-model.xml index fae00d86dd..473a41892d 100644 --- a/tests/qemuxmlconfdata/hyperv-host-model.xml +++ b/tests/qemuxmlconfdata/hyperv-host-model.xml @@ -10,7 +10,11 @@ - + + + + + destroy --=20 2.52.0 From nobody Wed Apr 15 07:00:19 2026 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=1770904855; cv=none; d=zohomail.com; s=zohoarc; b=Zdwz3+H0Rn+BCLCXtWsgkIv3E+atxhDOiwSO2vsMzVxnT7v2EfcolMR71saPmUBEdcmtMfViP+iNl5rZ11FVjuxc+poZ2khiLc7hfsYdqVEeBmuwK+2uggA2Ym3qWQlVccfdvMZrb5hHD8lUfpZRdi9SzWiMTxvl5hDR3yjx1KQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770904855; 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=r63uYzcxbrc9FnSGWZt8zyscC2/C/pfzZwF7ayYLb8M=; b=WEt5DDU8fAJXD1T0T75OeRJIqzFnbSB2U5bpv8/CPkPUV1Enc4rmLTCThOXgkpJAkL4h1GRI/2MouSIzOv1BU5u2rr0zuYRefiquQYL49iY8jhbvmpxxH9IQP/rA2qeHWraygJyuIsUo4aTAQF/w/ECP67JZPQXXBIB3MAm47nI= 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 1770904855312640.1868288618016; Thu, 12 Feb 2026 06:00:55 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 9B0BA45192; Thu, 12 Feb 2026 09:00:54 -0500 (EST) Received: from [172.19.199.6] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 49623454C4; Thu, 12 Feb 2026 07:51:24 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 63B9C3F308; Thu, 12 Feb 2026 07:50:43 -0500 (EST) Received: from mx1.osci.io (unknown [8.43.85.229]) (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 032904506B for ; Thu, 12 Feb 2026 07:38:55 -0500 (EST) Received: by mx1.osci.io (Postfix, from userid 995) id 290AC2AE29; Wed, 11 Feb 2026 06:50:33 -0500 (EST) 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 ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mx1.osci.io (Postfix) with ESMTPS id 905AB2AE27 for ; Wed, 11 Feb 2026 06:50:32 -0500 (EST) 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-374-DcJ9djtWNM2b9ozJ24BDVQ-1; Wed, 11 Feb 2026 06:50:30 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 A58E31800342 for ; Wed, 11 Feb 2026 11:50:29 +0000 (UTC) Received: from moe (unknown [10.43.3.236]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0DCEE19560A3 for ; Wed, 11 Feb 2026 11:50:28 +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=-5.0 required=5.0 tests=BAYES_00,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=1770810631; 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=r63uYzcxbrc9FnSGWZt8zyscC2/C/pfzZwF7ayYLb8M=; b=WzkDZgvC2Mum/9rasMezpXp5YhZ8DHRMwgqExZLa3p7AXsra1KEIz+8wIpRAdbPSk4+O9N YWz60guwFj+jBs+lAUcY0WAAxxnBnY16coLZw+rD9mndS8P6WA/BplO1f1+bbs/Nd2oFJF iSJKp1TF6mMApamlwBwhpSgGUL30vtE= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770810632; 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=r63uYzcxbrc9FnSGWZt8zyscC2/C/pfzZwF7ayYLb8M=; b=V1j4jPDscNnXbVJhlXbZvIRMGDvUHFSvq1CaC6QIvhMAq+euz8kNxlPEc60hsdSbRundS2 L5mMjZJNbwtx+/IfnwYKe6lF4RG2m4MF+oW2ABvDSdsib/vlMEkFI4puAjBrcivOGLaakK nRq1uFixZy/VgF5V/cF0TYIcK2XpYaM= X-MC-Unique: DcJ9djtWNM2b9ozJ24BDVQ-1 X-Mimecast-MFC-AGG-ID: DcJ9djtWNM2b9ozJ24BDVQ_1770810629 To: devel@lists.libvirt.org Subject: [PATCH 2/2] qemu: Wire up new hyperv host-model mode behavior Date: Wed, 11 Feb 2026 12:50:24 +0100 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: JBqAhXHwdAyUUcaphaypXU-gC-Sdtg5UjEoZ3MekiuI_1770810629 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: G3YVDW4F7PH3PHUYY6K7A2CI4YTSJ7F6 X-Message-ID-Hash: G3YVDW4F7PH3PHUYY6K7A2CI4YTSJ7F6 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 (found 2 invalid signatures) X-ZM-MESSAGEID: 1770904859053154100 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik Since some hyperv features might be already enabled/disabled when entering qemuProcessEnableDomainFeatures() only those which are not set in domain XML (i.e. are VIR_TRISTATE_SWITCH_ABSENT) should be modified. Furthermore, some features are not a simple on/off switch, but a number or a string even. Well, that doesn't matter really as the logic for setting them is the same: only set their value iff they are not already set. Resolves: https://issues.redhat.com/browse/RHEL-148219 Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- src/qemu/qemu_process.c | 24 ++++++++++++------- .../hyperv-host-model.x86_64-latest.args | 2 +- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index c5b2a5fda8..27aa1896d4 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -6960,30 +6960,38 @@ qemuProcessEnableDomainFeatures(virDomainObj *vm) } =20 for (i =3D 0; i < VIR_DOMAIN_HYPERV_LAST; i++) { + virTristateSwitch origState =3D vm->def->hyperv.features[i]; + if (!VIR_DOMAIN_CAPS_ENUM_IS_SET(hv->features, i)) continue; =20 - vm->def->hyperv.features[i] =3D VIR_TRISTATE_SWITCH_ON; + if (vm->def->hyperv.features[i] =3D=3D VIR_TRISTATE_SWITCH_ABSENT) + vm->def->hyperv.features[i] =3D VIR_TRISTATE_SWITCH_ON; =20 if (i =3D=3D VIR_DOMAIN_HYPERV_SPINLOCKS) { if (hv->spinlocks !=3D 0) { - vm->def->hyperv.spinlocks =3D hv->spinlocks; + if (vm->def->hyperv.spinlocks =3D=3D 0) + vm->def->hyperv.spinlocks =3D hv->spinlocks; } else { - vm->def->hyperv.features[i] =3D VIR_TRISTATE_SWITCH_ABSENT; + vm->def->hyperv.features[i] =3D origState; } } else if (i =3D=3D VIR_DOMAIN_HYPERV_STIMER) { - vm->def->hyperv.stimer_direct =3D hv->stimer_direct; + if (vm->def->hyperv.stimer_direct =3D=3D VIR_TRISTATE_SWITCH_A= BSENT) + vm->def->hyperv.stimer_direct =3D hv->stimer_direct; /* Both hv-stimer and hv-stimer-direct require hv-time which is * expose as a timer. Enable it. */ qemuProcessMaybeAddHypervTimer(vm->def); } else if (i =3D=3D VIR_DOMAIN_HYPERV_TLBFLUSH) { - vm->def->hyperv.tlbflush_direct =3D hv->tlbflush_direct; - vm->def->hyperv.tlbflush_extended =3D hv->tlbflush_extended; + if (vm->def->hyperv.tlbflush_direct =3D=3D VIR_TRISTATE_SWITCH= _ABSENT) + vm->def->hyperv.tlbflush_direct =3D hv->tlbflush_direct; + if (vm->def->hyperv.tlbflush_extended =3D=3D VIR_TRISTATE_SWIT= CH_ABSENT) + vm->def->hyperv.tlbflush_extended =3D hv->tlbflush_extende= d; } else if (i =3D=3D VIR_DOMAIN_HYPERV_VENDOR_ID) { if (hv->vendor_id) { - vm->def->hyperv.vendor_id =3D g_strdup(hv->vendor_id); + if (!vm->def->hyperv.vendor_id) + vm->def->hyperv.vendor_id =3D g_strdup(hv->vendor_id); } else { - vm->def->hyperv.features[i] =3D VIR_TRISTATE_SWITCH_ABSENT; + vm->def->hyperv.features[i] =3D origState; } } } diff --git a/tests/qemuxmlconfdata/hyperv-host-model.x86_64-latest.args b/t= ests/qemuxmlconfdata/hyperv-host-model.x86_64-latest.args index 58502ff51e..d1f2326da1 100644 --- a/tests/qemuxmlconfdata/hyperv-host-model.x86_64-latest.args +++ b/tests/qemuxmlconfdata/hyperv-host-model.x86_64-latest.args @@ -12,7 +12,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/va= r/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ -machine pc,usb=3Doff,dump-guest-core=3Doff,memory-backend=3Dpc.ram,acpi= =3Don \ -accel tcg \ --cpu 'qemu64,hv-time=3Don,hv-relaxed=3Don,hv-vapic=3Don,hv-spinlocks=3D0xf= ff,hv-vpindex=3Don,hv-runtime=3Don,hv-synic=3Don,hv-stimer=3Don,hv-stimer-d= irect=3Don,hv-reset=3Don,hv-vendor-id=3DLinux KVM Hv,hv-frequencies=3Don,hv= -reenlightenment=3Don,hv-tlbflush=3Don,hv-tlbflush-direct=3Don,hv-tlbflush-= ext=3Don,hv-ipi=3Don,hv-avic=3Don,hv-emsr-bitmap=3Don,hv-xmm-input=3Don' \ +-cpu 'qemu64,hv-time=3Don,hv-relaxed=3Don,hv-vapic=3Don,hv-spinlocks=3D0x2= 000,hv-vpindex=3Don,hv-runtime=3Don,hv-synic=3Don,hv-stimer=3Don,hv-stimer-= direct=3Don,hv-reset=3Don,hv-vendor-id=3DLinux KVM Hv,hv-frequencies=3Don,h= v-reenlightenment=3Don,hv-tlbflush=3Don,hv-tlbflush-direct=3Don,hv-tlbflush= -ext=3Don,hv-ipi=3Don,hv-avic=3Don,hv-emsr-bitmap=3Don' \ -m size=3D219136k \ -object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'= \ -overcommit mem-lock=3Doff \ --=20 2.52.0