From nobody Tue Sep 9 19:27:16 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1736176293255357.887960661973; Mon, 6 Jan 2025 07:11:33 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 307C9A60; Mon, 6 Jan 2025 10:11:32 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 14C6FA27; Mon, 6 Jan 2025 10:11:14 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id B0480A0C; Mon, 6 Jan 2025 10:11:10 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id D0D0B9F5 for ; Mon, 6 Jan 2025 10:11:07 -0500 (EST) Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-590-ge1IeQ5YMRGfqcr6ma3W5g-1; Mon, 06 Jan 2025 10:11:06 -0500 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-385d735965bso8325746f8f.1 for ; Mon, 06 Jan 2025 07:11:06 -0800 (PST) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a1c832e31sm47425748f8f.33.2025.01.06.07.11.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2025 07:11:04 -0800 (PST) Received: from wheatley.brq.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 1AC2E77AF73E for ; Mon, 06 Jan 2025 16:11:04 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1736176267; 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; bh=bl07JyHcZPbDDHLM4sEjE+F9BwZg0UmNf+A0dZEP5KI=; b=ERhrm+si97sey6hy8Pn2r/DOuP6/mFR+U6FN5ekWop+EsAiZJYxfBt7nIYMfgx+ogwqSAY oFi7uFH8kaiBY9ugWMUKbIZJuxgfaNnRiWGN9E0USF/2DqWxwc+feyYXT1cNxJozyohHoh 8bOY7oymB5GFXyCLZhC2q+iD1o8ZyTw= X-MC-Unique: ge1IeQ5YMRGfqcr6ma3W5g-1 X-Mimecast-MFC-AGG-ID: ge1IeQ5YMRGfqcr6ma3W5g X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736176265; x=1736781065; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=bl07JyHcZPbDDHLM4sEjE+F9BwZg0UmNf+A0dZEP5KI=; b=TN+jD60D3jK44RUkJzwiC2OwDy9K7MKmPTusKzUq3CFQNGNCg9sjvES9U3vtlVlNHE s9XXdA/J84HxnRQRuAyhmNbjxata6YSSPBk5Kj0Wufxvn0Mx2V6Gdxp79cxbD6LGrd0F KatCKsRulwErSI9FJXwQHddE+lJfdHbDTKH3vINvr1SK+GMi7cHSqm1fzxMEr0AB2pZm OaKAoo5ryEMJsQuZ2Nh0FmxQnNksPaP/wBDmdyzxCU6kOP9QLQsOxQQZNNK2FqcCoBEV LErXrkeSn7XtoDmHNVLQzAIeMl+i2NBHAf7Q7ev+6ku6xdypwHHAiekrcrG04qQtArv3 2LNw== X-Gm-Message-State: AOJu0YzWLM5NCngxuYS3WGJV0tRbqGttSeTCOYOfU/JFX6koQChPS1IO 8gM8Vu4FXRIfVXYah20MWOO5LVJUFrXrLAL1BW+vlOYWaS1bBH6bXSAJCarBHbC+c4i1QN8TaXc NQ80//kBwJGk0dZDt2FQUdDswmDLXEo9dSMcAd7JhGXx8cwuMEq+b5dL/yOVNnInEKY3aaJvaJy 9p+zd1VuOfxPaaiDO9ckyFaSZYuceQQrkCZ99i7U0= X-Gm-Gg: ASbGncsrSoWRaRnquP+VLkxQJAVubBdov9qffNoGRrLl0C6lRy+BU8pt+7viAQyXd49 Ubz7C40YcO4p6ULxWI1nCaFpF4pw2LbPM0ZOc/7LgJ+SV1C1dfsgnDGtKwcqdCk3a2me9xsRj+G dF2HU/hMC7dua7juINBLkYcs0XMmwGPCYOAbU+fyxhIZwPesICZCMAFaYovBrrLiaXf065T/49D WE7b9QeCH14T6HXhsneifYRueLnb1W+SLP17t61GJBBzHJavWEo3ylxh4a4FDkTGRdSzJMo/NWp iuxvYegFsM7VhJeu X-Received: by 2002:a05:6000:1549:b0:38a:68f4:66a2 with SMTP id ffacd0b85a97d-38a68f4677amr9399723f8f.31.1736176265201; Mon, 06 Jan 2025 07:11:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IHowj+bWYLDCUa/KfpcCAdG4pZuQntpHTph/kkyBWwFdontMT/i4nScZyKOEfOm6tU6cdgZgA== X-Received: by 2002:a05:6000:1549:b0:38a:68f4:66a2 with SMTP id ffacd0b85a97d-38a68f4677amr9399700f8f.31.1736176264777; Mon, 06 Jan 2025 07:11:04 -0800 (PST) From: Martin Kletzander To: devel@lists.libvirt.org Subject: [PATCH] conf: Adjust hyperv tlbflush formatting Date: Mon, 6 Jan 2025 16:11:01 +0100 Message-ID: <87ff40f2d0b79fe04feed4c3696a5b514bc8eeea.1736176261.git.mkletzan@redhat.com> X-Mailer: git-send-email 2.47.1 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: _blC8ngRpfdprTMy57sODllVYw6GQRGj4mqmP5JR7rs_1736176265 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 6GOJZW23OHFI7I724YAHGAUPKCEJS46Z X-Message-ID-Hash: 6GOJZW23OHFI7I724YAHGAUPKCEJS46Z X-MailFrom: mkletzan@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1736176295295116600 Content-Type: text/plain; charset="utf-8"; x-default="true" Commi 247357cc292a added support for direct and extended modes for tlbflush, but forgot to do the formatting as well. Instead of rewriting the whole hyperv feature formatting to use yet another attribute and child buffers, just fix it in a way the other features are and leave the refactoring to later. One reason for that is that we should fix this ASAP since without this patch the features will be stripped when formatting the XML on the disk and lost after next daemon reload. Signed-off-by: Martin Kletzander --- src/conf/domain_conf.c | 20 ++++++++++++++++++- .../qemuxmlconfdata/hyperv.x86_64-latest.xml | 5 ++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 785eb0e539b4..ae56b292ad1e 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -27972,7 +27972,6 @@ virDomainDefFormatFeatures(virBuffer *buf, 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: @@ -28016,6 +28015,25 @@ virDomainDefFormatFeatures(virBuffer *buf, def->hyperv_vendor_id); break; =20 + case VIR_DOMAIN_HYPERV_TLBFLUSH: + if (def->hyperv_features[j] !=3D VIR_TRISTATE_SWITCH_O= N) { + virBufferAddLit(&childBuf, "/>\n"); + break; + } + if (def->hyperv_tlbflush_direct =3D=3D VIR_TRISTATE_SW= ITCH_ON || + def->hyperv_tlbflush_extended =3D=3D VIR_TRISTATE_= SWITCH_ON) { + virBufferAddLit(&childBuf, ">\n"); + virBufferAdjustIndent(&childBuf, 2); + if (def->hyperv_tlbflush_direct =3D=3D VIR_TRISTAT= E_SWITCH_ON) + virBufferAddLit(&childBuf, "\n"); + if (def->hyperv_tlbflush_extended =3D=3D VIR_TRIST= ATE_SWITCH_ON) + virBufferAddLit(&childBuf, "\n"); + virBufferAdjustIndent(&childBuf, -2); + virBufferAddLit(&childBuf, "\n"); + } else { + virBufferAddLit(&childBuf, "/>\n"); + } + case VIR_DOMAIN_HYPERV_LAST: break; } diff --git a/tests/qemuxmlconfdata/hyperv.x86_64-latest.xml b/tests/qemuxml= confdata/hyperv.x86_64-latest.xml index 36d9161fa811..49537188af3f 100644 --- a/tests/qemuxmlconfdata/hyperv.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/hyperv.x86_64-latest.xml @@ -22,7 +22,10 @@ - + + + + --=20 2.47.1