From nobody Sun Feb 8 20:59:45 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1573568332; cv=none; d=zoho.com; s=zohoarc; b=WWcv8y9ICrqg3ZRAnAEmtizblVakRDtqY7a/33q2c6ICDBrAZV3UFoscLN6uW9qI/0qZ1nK5F555ltGHpCA8pPM47hCXf9JLQ1kAR5QnAOBBZlKJZV/FpL7TVJ2H9xoFPo6wLyB4QjpFS+7tkc97l/PfgFJ3QpwrmggbIsJpGSQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573568332; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/1iXwC/bR+46jz2Gdbal+LLrhNrVzMsq8q05EIyHQgk=; b=nfC9NGTO3O3pTRWSv5mu2QhkhkcJ9g9ltUBTEzxT4vUTEp5tWKDX2tfo57jXiVV0u/vUr0nIlRxQPOavxvr/CRIiGvXjZlFnSUQ7SqQrtmMJUlg00rmxH6RV3LbkXu3gaspWp0LbLwW1bHLJkIlDzJwUnv9LzEH4LxXWA6i8j+s= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1573568332293184.49510547016484; Tue, 12 Nov 2019 06:18:52 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-332-OOLG8IsqMh-u5rfeYWmipg-1; Tue, 12 Nov 2019 09:18:49 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4E53C800A1E; Tue, 12 Nov 2019 14:18:44 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 26E5E60D0B; Tue, 12 Nov 2019 14:18:44 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id DAE7F1819AD3; Tue, 12 Nov 2019 14:18:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xACEIRGr001062 for ; Tue, 12 Nov 2019 09:18:27 -0500 Received: by smtp.corp.redhat.com (Postfix) id A911C101E59D; Tue, 12 Nov 2019 14:18:27 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 33D87101E26E for ; Tue, 12 Nov 2019 14:18:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573568331; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=/1iXwC/bR+46jz2Gdbal+LLrhNrVzMsq8q05EIyHQgk=; b=NGhZ1MFBb9efUKgce809ZIixg0R4VR8OrQWXE/mYmaOvsWXGgv1YkhJ3CGMdZqlrwCdB/S 6r+Pu+YAcwOJc7Zt9q5la4a0K3CG1RkiTypY3vpiThWIqH46ca7kXhtl1gGCKcbvcx29bK cND2bgoCdwVM8Gi7/lRFkwdas7rhzwg= From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 12 Nov 2019 15:18:17 +0100 Message-Id: <52793807e60ee5643d1ddc34e9ff3af2e2fb94aa.1573568139.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/7] conf: caps: sysinfo: Convert child buffers to use VIR_BUFFER_INIT_CHILD X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: OOLG8IsqMh-u5rfeYWmipg-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Use the new helper to initialize child XML element buffers. Signed-off-by: Peter Krempa --- src/conf/capabilities.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c index 2657750dbc..a7c246b26a 100644 --- a/src/conf/capabilities.c +++ b/src/conf/capabilities.c @@ -915,7 +915,7 @@ virCapabilitiesFormatResctrlMonitor(virBufferPtr buf, virResctrlInfoMonPtr monitor) { size_t i =3D 0; - virBuffer childrenBuf =3D VIR_BUFFER_INITIALIZER; + virBuffer childrenBuf =3D VIR_BUFFER_INIT_CHILD(buf); /* monitor not supported, no capability */ if (!monitor) @@ -937,7 +937,6 @@ virCapabilitiesFormatResctrlMonitor(virBufferPtr buf, "maxMonitors=3D'%u'>\n", monitor->max_monitor); - virBufferSetChildIndent(&childrenBuf, buf); for (i =3D 0; i < monitor->nfeatures; i++) { virBufferAsprintf(&childrenBuf, "\n", @@ -965,7 +964,7 @@ virCapabilitiesFormatCaches(virBufferPtr buf, for (i =3D 0; i < cache->nbanks; i++) { g_auto(virBuffer) attrBuf =3D VIR_BUFFER_INITIALIZER; - g_auto(virBuffer) childrenBuf =3D VIR_BUFFER_INITIALIZER; + g_auto(virBuffer) childrenBuf =3D VIR_BUFFER_INIT_CHILD(buf); virCapsHostCacheBankPtr bank =3D cache->banks[i]; g_autofree char *cpus_str =3D virBitmapFormat(bank->cpus); const char *unit =3D NULL; @@ -985,7 +984,6 @@ virCapabilitiesFormatCaches(virBufferPtr buf, virCacheTypeToString(bank->type), short_size, unit, cpus_str); - virBufferSetChildIndent(&childrenBuf, buf); for (j =3D 0; j < bank->ncontrols; j++) { const char *min_unit; virResctrlInfoPerCachePtr controls =3D bank->controls[j]; @@ -1051,7 +1049,7 @@ virCapabilitiesFormatMemoryBandwidth(virBufferPtr buf, for (i =3D 0; i < memBW->nnodes; i++) { g_auto(virBuffer) attrBuf =3D VIR_BUFFER_INITIALIZER; - g_auto(virBuffer) childrenBuf =3D VIR_BUFFER_INITIALIZER; + g_auto(virBuffer) childrenBuf =3D VIR_BUFFER_INIT_CHILD(buf); virCapsHostMemBWNodePtr node =3D memBW->nodes[i]; virResctrlInfoMemBWPerNodePtr control =3D &node->control; g_autofree char *cpus_str =3D virBitmapFormat(node->cpus); @@ -1063,7 +1061,6 @@ virCapabilitiesFormatMemoryBandwidth(virBufferPtr buf, " id=3D'%u' cpus=3D'%s'", node->id, cpus_str); - virBufferSetChildIndent(&childrenBuf, buf); virBufferAsprintf(&childrenBuf, "\n", @@ -1214,11 +1211,9 @@ static void virCapabilitiesFormatGuestFeatures(virCapsGuestPtr guest, virBufferPtr buf) { - g_auto(virBuffer) childBuf =3D VIR_BUFFER_INITIALIZER; + g_auto(virBuffer) childBuf =3D VIR_BUFFER_INIT_CHILD(buf); size_t i; - virBufferSetChildIndent(&childBuf, buf); - for (i =3D 0; i < VIR_CAPS_GUEST_FEATURE_TYPE_LAST; i++) { virCapsGuestFeaturePtr feature =3D guest->features + i; --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list