From nobody Fri Dec 12 15:14:28 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=1761724655; cv=none; d=zohomail.com; s=zohoarc; b=HM//GR0yY8GGvu+jreQQBg6n/DaFAHuD+mYsGKKO5naFuJIuW5ghZvXWc+Vmp1dDT3RpcL+nMPJi/RyFtuAoqvUggli2Zqwmx+crGyuIZNpg8O4wgWaKOjE1KNqsMAnJDMZkAuVntE5zYQx4pJ19+HJVyJrkISVagslgbiD06hU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761724655; 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=w+m++DuY9mU1yeer6OQKQB1pQcSx7yYEdY8hIZnL1Ik=; b=F0spcYBNFCd2uEqJEcT4TNeuPVBlmHxvgcQJvq0SMLBneYNAFdWz0IcFakGGlhWayqzYOjLRV35F84Zbo0DSU0RbhM5sGyA68SdOuf8TmmBPzn9WwNqQnrp0qfFJsZyg2jmHwdxoazOYUL4NyMvubHZBwXgUQ0HT0VQPFQkbNqw= 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 1761724655871715.3082931655096; Wed, 29 Oct 2025 00:57:35 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id C462F3F838; Wed, 29 Oct 2025 03:57:30 -0400 (EDT) Received: from [172.19.199.29] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id E2BA741A37; Wed, 29 Oct 2025 03:56:02 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 011C84184F; Wed, 29 Oct 2025 03:53:23 -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 22AE54186B for ; Wed, 29 Oct 2025 03:53:22 -0400 (EDT) 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-607-TuorLAK5NsWAsG8xg3WNxw-1; Wed, 29 Oct 2025 03:53:20 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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 7E417196F747 for ; Wed, 29 Oct 2025 07:53:19 +0000 (UTC) Received: from moe (unknown [10.43.3.236]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C8B451800452 for ; Wed, 29 Oct 2025 07:53:18 +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=1761724401; 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=w+m++DuY9mU1yeer6OQKQB1pQcSx7yYEdY8hIZnL1Ik=; b=cZRefC8OLGcF+SpQPDNrAnVYsD3d3LB7kQxwbee2P/aV0kZ0Dy3W7k7B+S9iG+8Sfn6t3A Z97FeGVaC53B6IiKpSzTRgagSe2rLvvm3DA/tSCOe48RMi3zLkr3ufJDL5haa5Q5S5m3eY +yTT0bJOGSHe4UlpDDfli/mu+f73eos= X-MC-Unique: TuorLAK5NsWAsG8xg3WNxw-1 X-Mimecast-MFC-AGG-ID: TuorLAK5NsWAsG8xg3WNxw_1761724399 To: devel@lists.libvirt.org Subject: [PATCH 2/7] domain_cof: Switch to virXMLFormatElement() in virDomainMemoryDefFormat() Date: Wed, 29 Oct 2025 08:53:02 +0100 Message-ID: <453b9b320246568db86d72be9e561a3c0551463e.1761724370.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: uDyUC9HnqXXmYKTSgosW2ZA3XjbgHMMIJiKK3x7duoA_1761724399 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: K4SVCHCHOUJW3RJXMNQ4GDIWIZ6SXBGX X-Message-ID-Hash: K4SVCHCHOUJW3RJXMNQ4GDIWIZ6SXBGX 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: 1761724657481158500 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik SSIA Signed-off-by: Michal Privoznik Reviewed-by: Jiri Denemark --- src/conf/domain_conf.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 0a647a1b44..0d32bcad47 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -26604,33 +26604,32 @@ virDomainMemoryDefFormat(virBuffer *buf, unsigned int flags) { const char *model =3D virDomainMemoryModelTypeToString(def->model); + g_auto(virBuffer) attrBuf =3D VIR_BUFFER_INITIALIZER; + g_auto(virBuffer) childBuf =3D VIR_BUFFER_INIT_CHILD(buf); =20 - virBufferAsprintf(buf, "access) - virBufferAsprintf(buf, " access=3D'%s'", + virBufferAsprintf(&attrBuf, " access=3D'%s'", virDomainMemoryAccessTypeToString(def->access)); if (def->discard) - virBufferAsprintf(buf, " discard=3D'%s'", + virBufferAsprintf(&attrBuf, " discard=3D'%s'", virTristateBoolTypeToString(def->discard)); - virBufferAddLit(buf, ">\n"); - virBufferAdjustIndent(buf, 2); =20 if (def->model =3D=3D VIR_DOMAIN_MEMORY_MODEL_NVDIMM && def->target.nvdimm.uuid) { char uuidstr[VIR_UUID_STRING_BUFLEN]; =20 virUUIDFormat(def->target.nvdimm.uuid, uuidstr); - virBufferAsprintf(buf, "%s\n", uuidstr); + virBufferAsprintf(&childBuf, "%s\n", uuidstr); } =20 - virDomainMemorySourceDefFormat(buf, def); + virDomainMemorySourceDefFormat(&childBuf, def); =20 - virDomainMemoryTargetDefFormat(buf, def, flags); + virDomainMemoryTargetDefFormat(&childBuf, def, flags); =20 - virDomainDeviceInfoFormat(buf, &def->info, flags); + virDomainDeviceInfoFormat(&childBuf, &def->info, flags); =20 - virBufferAdjustIndent(buf, -2); - virBufferAddLit(buf, "\n"); + virXMLFormatElement(buf, "memory", &attrBuf, &childBuf); } =20 static void --=20 2.51.0