From nobody Mon May 6 04:56:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.120 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=1573568320; cv=none; d=zoho.com; s=zohoarc; b=E2xQeF8iKOLjqSPFabwCfztknu8PUPagPYJYks9szizIgyQVmH6yj9tUGtVEPLqC2pZ3mZ2HGBoTTq+Tu2h0EQ3LjnaWPPT/Gg0o/YrhIeBlCupt0DmIOnETgl5wkluUI/Lhe0A4QEiRPWCYBASDSCLQ8MH+lOk4mGUWGVdlP7c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573568320; 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=nqMGXi+9hqGXPgM/1IccOdu32fr9QyhzRMR127JJIyU=; b=ISeCYp42pY72KVOCEAdgBLz0Sdk+D5zJ/CAYpp9QfHGOrZ5JwG1a01wHPAZ94SnXwKacYeH8ovRpdg84rR/QriY/2hp5WiJBcUM6pzoLUsJRnHdiAoVPupQvcnDM8E6aft8/MyoMZXbiMmmqa1D03uTT7Ya7r3lEDfFM33MEiS8= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1573568320141981.222224837454; Tue, 12 Nov 2019 06:18:40 -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-63-iomRN8AIMEGGmQiKHxG9Jw-1; Tue, 12 Nov 2019 09:18:36 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 326B51800D63; Tue, 12 Nov 2019 14:18:31 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C65E5808B; Tue, 12 Nov 2019 14:18:30 +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 9720A4BB78; Tue, 12 Nov 2019 14:18:28 +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 xACEIPtU001040 for ; Tue, 12 Nov 2019 09:18:25 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4C8E7101E26E; Tue, 12 Nov 2019 14:18:25 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id CBE4810027B8 for ; Tue, 12 Nov 2019 14:18:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573568317; 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=nqMGXi+9hqGXPgM/1IccOdu32fr9QyhzRMR127JJIyU=; b=SehIFJPFOwWGvYiAHanHQRhTsK81thQKlMmjaprqr0nITvQxiDI7KCzm1jE9pf6JRQjIBw pF12jW8rtUpHhv9x9s6OQWkO42HWw5VVtrERLu6BqZB2u4uawEVGCn9akOPYnt8vrShGAT e9c0UHM3PTBcdh3orqF0nl51F+My46w= From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 12 Nov 2019 15:18:14 +0100 Message-Id: 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 1/7] util: buffer: Add init macro for automatically setting child XML indent 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.84 on 10.5.11.23 X-MC-Unique: iomRN8AIMEGGmQiKHxG9Jw-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" Add a new macro which initializes a virBuffer on the stack and also sets the indent level to be used for child XML element formatting. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/util/virbuffer.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/util/virbuffer.h b/src/util/virbuffer.h index 8eb9608c71..a2e30c07dc 100644 --- a/src/util/virbuffer.h +++ b/src/util/virbuffer.h @@ -35,6 +35,15 @@ typedef virBuffer *virBufferPtr; #define VIR_BUFFER_INITIALIZER { NULL, 0 } +/** + * VIR_BUFFER_INIT_CHILD: + * @parentbuf: parent buffer for XML element formatting + * + * Intitialize a virBuffer structure and set up the indentation level for + * formatting XML subelements of @parentbuf. + */ +#define VIR_BUFFER_INIT_CHILD(parentbuf) { NULL, (parentbuf)->indent + 2 } + struct _virBuffer { GString *str; int indent; --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 04:56:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; 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 207.211.31.81 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=1573568329; cv=none; d=zoho.com; s=zohoarc; b=jdLIUajwyaCfWr0ydhmtFq/4uuZvBKS40+J1A405p4w+AYs4f+CEX8S73yDM68X/K89I/SoA6XtzWOP7XvVbZyTVE6Puq3q3hRm9rbugHdRgCby2VPKpvNE51mxttry8AwNuMeunYCvM1wXuFjSzq3eywyCyS4aQcK6yIxgKU0Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573568329; 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=0IIJ7ge5OOwKOpXECHlUcTTPCHiQc6U6Y/VDpNSv5SU=; b=d4E+Rl6oOl7gVFOjWL7HpEkWYtOuiLum42lF1lJ5YRaIgVPqc31QyZta58OQdsL6x+7SsTxOYuMCnULsu0UONumcPupaQjlUrYa/UefwbYb/Sdc1e1QDOvBlytR2TBdYj8Yqr4HhMo1Eb+slns0S5OHDDCkEU5musEit6U/i3W0= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 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 [207.211.31.81]) by mx.zohomail.com with SMTPS id 1573568329186601.2766346146834; Tue, 12 Nov 2019 06:18:49 -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-397-P9SzWlIQN1Ch78NPze_ITQ-1; Tue, 12 Nov 2019 09:18:45 -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 94A8E81A334; Tue, 12 Nov 2019 14:18:40 +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 6D90360D0B; Tue, 12 Nov 2019 14:18:40 +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 260781819AD1; Tue, 12 Nov 2019 14:18:40 +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 xACEIQwU001045 for ; Tue, 12 Nov 2019 09:18:26 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1ACC0101E26E; Tue, 12 Nov 2019 14:18:26 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9983B10027B8 for ; Tue, 12 Nov 2019 14:18:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573568328; 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=0IIJ7ge5OOwKOpXECHlUcTTPCHiQc6U6Y/VDpNSv5SU=; b=bkOifM0GSZqXOU/gLb5B4+ULtjmcbajf6AqsQuF1/DnWaFBbvrRX3N7pLuQ9fYmuOMlD1z mThKbzbKlsWYP69t2/OiUiupuSr/mXJZGENUMlnndTWeeZKvTGmkhIA6OcSc1HdwlC9sbq r3uRpZIU4L6nuR7vg1yr+tTIOOtB6hA= From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 12 Nov 2019 15:18:15 +0100 Message-Id: <88dbd7f53794e5a64eed2ab24f149ff4d1f79591.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 2/7] qemu: domain: 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: P9SzWlIQN1Ch78NPze_ITQ-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 Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_domain.c | 35 ++++++++++------------------------- 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 58a82fbd60..16cbc41118 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -2298,7 +2298,7 @@ static int qemuStorageSourcePrivateDataFormat(virStorageSourcePtr src, virBufferPtr buf) { - g_auto(virBuffer) tmp =3D VIR_BUFFER_INITIALIZER; + g_auto(virBuffer) tmp =3D VIR_BUFFER_INIT_CHILD(buf); qemuDomainStorageSourcePrivatePtr srcPriv =3D QEMU_DOMAIN_STORAGE_SOUR= CE_PRIVATE(src); int ret =3D -1; @@ -2317,8 +2317,6 @@ qemuStorageSourcePrivateDataFormat(virStorageSourcePt= r src, if (virStorageSourcePrivateDataFormatRelPath(src, buf) < 0) goto cleanup; - virBufferSetChildIndent(&tmp, buf); - if (srcPriv) { qemuStorageSourcePrivateDataFormatSecinfo(&tmp, srcPriv->secinfo, = "auth"); qemuStorageSourcePrivateDataFormatSecinfo(&tmp, srcPriv->encinfo, = "encryption"); @@ -2444,11 +2442,9 @@ qemuDomainObjPrivateXMLFormatBlockjobFormatSource(vi= rBufferPtr buf, bool chain) { g_auto(virBuffer) attrBuf =3D VIR_BUFFER_INITIALIZER; - g_auto(virBuffer) childBuf =3D VIR_BUFFER_INITIALIZER; + g_auto(virBuffer) childBuf =3D VIR_BUFFER_INIT_CHILD(buf); unsigned int xmlflags =3D VIR_DOMAIN_DEF_FORMAT_STATUS; - virBufferSetChildIndent(&childBuf, buf); - virBufferAsprintf(&attrBuf, " type=3D'%s' format=3D'%s'", virStorageTypeToString(src->type), virStorageFileFormatTypeToString(src->format)); @@ -2471,20 +2467,17 @@ qemuDomainObjPrivateXMLFormatBlockjobIterator(void = *payload, const void *name G_GNUC_UNUS= ED, void *opaque) { + struct qemuDomainPrivateBlockJobFormatData *data =3D opaque; g_auto(virBuffer) attrBuf =3D VIR_BUFFER_INITIALIZER; - g_auto(virBuffer) childBuf =3D VIR_BUFFER_INITIALIZER; - g_auto(virBuffer) chainsBuf =3D VIR_BUFFER_INITIALIZER; + g_auto(virBuffer) childBuf =3D VIR_BUFFER_INIT_CHILD(data->buf); + g_auto(virBuffer) chainsBuf =3D VIR_BUFFER_INIT_CHILD(&childBuf); qemuBlockJobDataPtr job =3D payload; const char *state =3D qemuBlockjobStateTypeToString(job->state); const char *newstate =3D NULL; - struct qemuDomainPrivateBlockJobFormatData *data =3D opaque; if (job->newstate !=3D -1) newstate =3D qemuBlockjobStateTypeToString(job->newstate); - virBufferSetChildIndent(&childBuf, data->buf); - virBufferSetChildIndent(&chainsBuf, &childBuf); - virBufferEscapeString(&attrBuf, " name=3D'%s'", job->name); virBufferEscapeString(&attrBuf, " type=3D'%s'", qemuBlockjobTypeToStri= ng(job->type)); virBufferEscapeString(&attrBuf, " state=3D'%s'", state); @@ -2567,7 +2560,7 @@ qemuDomainObjPrivateXMLFormatBlockjobs(virBufferPtr b= uf, { qemuDomainObjPrivatePtr priv =3D vm->privateData; g_auto(virBuffer) attrBuf =3D VIR_BUFFER_INITIALIZER; - g_auto(virBuffer) childBuf =3D VIR_BUFFER_INITIALIZER; + g_auto(virBuffer) childBuf =3D VIR_BUFFER_INIT_CHILD(buf); bool bj =3D qemuDomainHasBlockjob(vm, false); struct qemuDomainPrivateBlockJobFormatData iterdata =3D { priv->driver= ->xmlopt, &childBuf }; @@ -2575,8 +2568,6 @@ qemuDomainObjPrivateXMLFormatBlockjobs(virBufferPtr b= uf, virBufferAsprintf(&attrBuf, " active=3D'%s'", virTristateBoolTypeToString(virTristateBoolFromBool(= bj))); - virBufferSetChildIndent(&childBuf, buf); - if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV) && virHashForEach(priv->blockjobs, qemuDomainObjPrivateXMLFormatBlockjobIterator, @@ -2613,11 +2604,9 @@ qemuDomainObjPrivateXMLFormatNBDMigrationSource(virB= ufferPtr buf, virDomainXMLOptionPtr xmlo= pt) { g_auto(virBuffer) attrBuf =3D VIR_BUFFER_INITIALIZER; - g_auto(virBuffer) childBuf =3D VIR_BUFFER_INITIALIZER; + g_auto(virBuffer) childBuf =3D VIR_BUFFER_INIT_CHILD(buf); int ret =3D -1; - virBufferSetChildIndent(&childBuf, buf); - virBufferAsprintf(&attrBuf, " type=3D'%s' format=3D'%s'", virStorageTypeToString(src->type), virStorageFileFormatTypeToString(src->format)); @@ -2640,19 +2629,17 @@ qemuDomainObjPrivateXMLFormatNBDMigration(virBuffer= Ptr buf, virDomainObjPtr vm) { qemuDomainObjPrivatePtr priv =3D vm->privateData; - g_auto(virBuffer) attrBuf =3D VIR_BUFFER_INITIALIZER; - g_auto(virBuffer) childBuf =3D VIR_BUFFER_INITIALIZER; size_t i; virDomainDiskDefPtr disk; qemuDomainDiskPrivatePtr diskPriv; int ret =3D -1; for (i =3D 0; i < vm->def->ndisks; i++) { + g_auto(virBuffer) attrBuf =3D VIR_BUFFER_INITIALIZER; + g_auto(virBuffer) childBuf =3D VIR_BUFFER_INIT_CHILD(buf); disk =3D vm->def->disks[i]; diskPriv =3D QEMU_DOMAIN_DISK_PRIVATE(disk); - virBufferSetChildIndent(&childBuf, buf); - virBufferAsprintf(&attrBuf, " dev=3D'%s' migrating=3D'%s'", disk->dst, diskPriv->migrating ? "yes" : "no"); @@ -2678,7 +2665,7 @@ qemuDomainObjPrivateXMLFormatJob(virBufferPtr buf, qemuDomainObjPrivatePtr priv) { g_auto(virBuffer) attrBuf =3D VIR_BUFFER_INITIALIZER; - g_auto(virBuffer) childBuf =3D VIR_BUFFER_INITIALIZER; + g_auto(virBuffer) childBuf =3D VIR_BUFFER_INIT_CHILD(buf); qemuDomainJob job =3D priv->job.active; int ret =3D -1; @@ -2689,8 +2676,6 @@ qemuDomainObjPrivateXMLFormatJob(virBufferPtr buf, priv->job.asyncJob =3D=3D QEMU_ASYNC_JOB_NONE) return 0; - virBufferSetChildIndent(&childBuf, buf); - virBufferAsprintf(&attrBuf, " type=3D'%s' async=3D'%s'", qemuDomainJobTypeToString(job), qemuDomainAsyncJobTypeToString(priv->job.asyncJob)); --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 04:56:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; 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 207.211.31.81 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=1573568319; cv=none; d=zoho.com; s=zohoarc; b=V6xwC5+tshvol4QNucCZ4izU/zvFtByZFU8OxvUyN0tnE1sbwqfWltjSqvnV5kYXpbmq+zFylwIaNZr6SertZ+/UtTNl05DNhPB/2pnQCsQktmg4OGo/ibayvrhNXTLeyHaw/7hzhUTDKFO4YEZ1ql+cf2nr+YQgbSrikRroNIw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573568319; 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=IBBSgOO7q4bVJCtS0FqQq0Xvq5YZ10aTlzQ/SVVFW8g=; b=KZQevNFEgqRgPn6BK/ndA5H0JdLGZXUhTt1KCNtuMEXlQTX8IDj+HaoSZsaaSnxfbJqhLGj+4OGQ9lthzYkBAPxRVdC5sKH0P4EzVkLrHhNF8OnayKlI1aeX43HTuhNqXBVf03jHQTHOjOTuKxGhITFNCbsrr6eGxcWhMQVOGhE= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 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 [207.211.31.81]) by mx.zohomail.com with SMTPS id 1573568319603466.2815785053881; Tue, 12 Nov 2019 06:18:39 -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-27-y7S5b4W8MA-1OqZBXvTFwA-1; Tue, 12 Nov 2019 09:18:35 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DF7011005509; Tue, 12 Nov 2019 14:18:30 +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 04D8350; Tue, 12 Nov 2019 14:18:30 +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 F3E8C1819ACE; Tue, 12 Nov 2019 14:18:28 +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 xACEIQsN001056 for ; Tue, 12 Nov 2019 09:18:26 -0500 Received: by smtp.corp.redhat.com (Postfix) id DB727101E26E; Tue, 12 Nov 2019 14:18:26 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 667AB10027B8 for ; Tue, 12 Nov 2019 14:18:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573568317; 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=IBBSgOO7q4bVJCtS0FqQq0Xvq5YZ10aTlzQ/SVVFW8g=; b=ifdeLnpsIntSMSnStFgetnwZLonTvoAuVpsXsUpUMMXVhMIIQwUcetFb0vdLE5U28ogqeH nbppkIjQlUo9U1qGz0t7wPVAXQk3zvBLQp4+K6nK2QGxRv7RE3dr9bh/0iaoH5yAiT3DGp ullqSRF5xEZmGsNjAjJ4IBoz0teIn5A= From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 12 Nov 2019 15:18:16 +0100 Message-Id: <2e0a5927ed517b6dea579beb88dfcb1d61f9728c.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 3/7] util: 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.15 X-MC-Unique: y7S5b4W8MA-1OqZBXvTFwA-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 Reviewed-by: J=C3=A1n Tomko --- src/util/virsysinfo.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c index 9d013067fe..d656b23731 100644 --- a/src/util/virsysinfo.c +++ b/src/util/virsysinfo.c @@ -1482,7 +1482,7 @@ int virSysinfoFormat(virBufferPtr buf, virSysinfoDefPtr def) { virBuffer attrBuf =3D VIR_BUFFER_INITIALIZER; - virBuffer childrenBuf =3D VIR_BUFFER_INITIALIZER; + virBuffer childrenBuf =3D VIR_BUFFER_INIT_CHILD(buf); const char *type =3D virSysinfoTypeToString(def->type); if (!type) { @@ -1493,8 +1493,6 @@ virSysinfoFormat(virBufferPtr buf, virSysinfoDefPtr d= ef) return -1; } - virBufferSetChildIndent(&childrenBuf, buf); - virSysinfoBIOSFormat(&childrenBuf, def->bios); virSysinfoSystemFormat(&childrenBuf, def->system); virSysinfoBaseBoardFormat(&childrenBuf, def->baseBoard, def->nbaseBoar= d); --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 04:56:35 2024 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 Reviewed-by: J=C3=A1n Tomko --- 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 From nobody Mon May 6 04:56:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.120 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=1573568363; cv=none; d=zoho.com; s=zohoarc; b=VXqRD/jOklTEEqkTE7qoWbpaSgUESY2/3ODThlfFB+rTWahsTxiomWCXO3+IX8vZcyjy39TorWsAvi/llf6uqYXnFNtnGFKu1k0j+eVB5Yl5X+LwdO3xNeFkv4Wz/7WFBKQAZeytK33/8OjQ6qImhjI37j1OILaCzGDj8bvvAtg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573568363; 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=E4miYJ/4hXKpzsUrp8FR0T79k2tyUU//pi4VBhJtISQ=; b=NAxb+UQsABiFdnGTrUzUNsnOy6gige8qFXr4pZhFhb4tu3VSA8+CQ1AfEC4fDeADRZECdA6M3HOFuMhVpZv3ZShnYpmlIe3dzgTiGKBNdwDrzortuu07xTO2TohdNJz736/z66C2OWsheby7IukoAeMn98KRG6hX4yVWxla332c= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1573568363794889.2891859489672; Tue, 12 Nov 2019 06:19:23 -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-409-u93xCjqFNmW_al3wd6iXyQ-1; Tue, 12 Nov 2019 09:18:50 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 792DC801E51; Tue, 12 Nov 2019 14:18:45 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 477FD18215; Tue, 12 Nov 2019 14:18:45 +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 F092F4E56C; Tue, 12 Nov 2019 14:18:44 +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 xACEISmh001068 for ; Tue, 12 Nov 2019 09:18:28 -0500 Received: by smtp.corp.redhat.com (Postfix) id 7744B101E26E; Tue, 12 Nov 2019 14:18:28 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0294510027B8 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=1573568362; 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=E4miYJ/4hXKpzsUrp8FR0T79k2tyUU//pi4VBhJtISQ=; b=aupFtjOWzaI0vrYSOnzDx7ff011t1Dqzjk1/zqCpnmXsA95YggddMJt1w6PmZM6iAJ7/91 QhAdHP16FTUmzzfYDEAFPBxzkpd4Jt25DgBJenB5KmE5iYBJAu3SDteQr3iPIl5v2U6DDc DzcOBbZmQKOdCO7+0xCwpIrdnKP+Cl0= From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 12 Nov 2019 15:18:18 +0100 Message-Id: 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 5/7] conf: cpu: 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.16 X-MC-Unique: u93xCjqFNmW_al3wd6iXyQ-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 Reviewed-by: J=C3=A1n Tomko --- src/conf/cpu_conf.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c index 2b644638a7..ca048d899a 100644 --- a/src/conf/cpu_conf.c +++ b/src/conf/cpu_conf.c @@ -683,7 +683,7 @@ virCPUDefFormatBufFull(virBufferPtr buf, { int ret =3D -1; virBuffer attributeBuf =3D VIR_BUFFER_INITIALIZER; - virBuffer childrenBuf =3D VIR_BUFFER_INITIALIZER; + virBuffer childrenBuf =3D VIR_BUFFER_INIT_CHILD(buf); if (!def) return 0; @@ -718,7 +718,6 @@ virCPUDefFormatBufFull(virBufferPtr buf, } /* Format children */ - virBufferSetChildIndent(&childrenBuf, buf); if (def->type =3D=3D VIR_CPU_TYPE_HOST && def->arch) virBufferAsprintf(&childrenBuf, "%s\n", virArchToString(def->arch)); --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 04:56:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.120 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=1573568404; cv=none; d=zoho.com; s=zohoarc; b=Y47h4y0D7nZDz26Hj6+ueNEjM7po3ksnTCoSEP9tZGUQAJMcAs/QbSFJwbbFW0NqjqynTL9g3k3wjKcBZ9Q2v8ZKb1F1Xf3O7zSh6Wfdjd6J4KQKHEdxQ1s44S1NrkEohMBigsTfK2HX8hAcEV3lVdKLWeITyMRDpcxZgFo3el4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573568404; 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=ZczqcshIx3ZWxzuq/UuYHzBzYYM9nzfIhGZXvBIHAKE=; b=MokTNZszeuvbHw+NL93PhH3AoEui1IZnHE2yu5/HHOUWuMdvSpr7nOZCZ2u3oHpQCH1PAlOrh2D+YrU8LIalj0s1vOi74UBbUBd91D0Ab91Vug8LtcOvGCzCcP9t+/JiUDz7hzvfxIJ0ZtgA07gUdTLXwbH7rzde8tKcklTO2Qo= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1573568404883528.972003411075; Tue, 12 Nov 2019 06:20:04 -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-427-53yOjEluMNW776CszUVcsw-1; Tue, 12 Nov 2019 09:18:55 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0C488100551B; Tue, 12 Nov 2019 14:18:49 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D629228D3F; Tue, 12 Nov 2019 14:18:48 +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 968294E570; Tue, 12 Nov 2019 14:18:48 +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 xACEITM0001080 for ; Tue, 12 Nov 2019 09:18:29 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4629C101E26E; Tue, 12 Nov 2019 14:18:29 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id C49CF10027B8 for ; Tue, 12 Nov 2019 14:18:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573568403; 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=ZczqcshIx3ZWxzuq/UuYHzBzYYM9nzfIhGZXvBIHAKE=; b=c6BSwgFJZJegezZO2at5P5Y/3EvsCAF+h8uHFVXUPTylmQdkArU1WWmQTjDYXVJPqj5w9Z q0XZy0uIS6jIIiavP+YhfXOO9jGNR4fKMe9fNuzfuxB7r+GVQMY/7C4a+0aROKdV+qFUur QKwaauMpV5u+ZnbMv7XHscTj9bOUDjw= From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 12 Nov 2019 15:18:19 +0100 Message-Id: <6211a2888bf53eed649d90c32749221d235d8483.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 6/7] conf: domain: 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.84 on 10.5.11.23 X-MC-Unique: 53yOjEluMNW776CszUVcsw-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 Reviewed-by: J=C3=A1n Tomko --- src/conf/domain_conf.c | 101 +++++++++++------------------------------ 1 file changed, 27 insertions(+), 74 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 81ab5eb138..f59f95c5be 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -7112,7 +7112,7 @@ virDomainDeviceInfoFormat(virBufferPtr buf, unsigned int flags) { g_auto(virBuffer) attrBuf =3D VIR_BUFFER_INITIALIZER; - g_auto(virBuffer) childBuf =3D VIR_BUFFER_INITIALIZER; + g_auto(virBuffer) childBuf =3D VIR_BUFFER_INIT_CHILD(buf); int ret =3D -1; if ((flags & VIR_DOMAIN_DEF_FORMAT_ALLOW_BOOT) && info->bootIndex) { @@ -7181,7 +7181,6 @@ virDomainDeviceInfoFormat(virBufferPtr buf, } if (!virZPCIDeviceAddressIsEmpty(&info->addr.pci.zpci)) { - virBufferSetChildIndent(&childBuf, buf); virBufferAsprintf(&childBuf, "\n", info->addr.pci.zpci.uid, @@ -24107,15 +24106,13 @@ virDomainDiskSourceFormatPrivateData(virBufferPtr= buf, unsigned int flags, virDomainXMLOptionPtr xmlopt) { - g_auto(virBuffer) childBuf =3D VIR_BUFFER_INITIALIZER; + g_auto(virBuffer) childBuf =3D VIR_BUFFER_INIT_CHILD(buf); int ret =3D -1; if (!(flags & VIR_DOMAIN_DEF_FORMAT_STATUS) || !xmlopt || !xmlopt->privateData.storageFormat) return 0; - virBufferSetChildIndent(&childBuf, buf); - if (xmlopt->privateData.storageFormat(src, &childBuf) < 0) goto cleanup; @@ -24151,9 +24148,7 @@ virDomainDiskSourceFormat(virBufferPtr buf, virDomainXMLOptionPtr xmlopt) { g_auto(virBuffer) attrBuf =3D VIR_BUFFER_INITIALIZER; - g_auto(virBuffer) childBuf =3D VIR_BUFFER_INITIALIZER; - - virBufferSetChildIndent(&childBuf, buf); + g_auto(virBuffer) childBuf =3D VIR_BUFFER_INIT_CHILD(buf); switch ((virStorageType)src->type) { case VIR_STORAGE_TYPE_FILE: @@ -24238,12 +24233,10 @@ virDomainDiskBackingStoreFormat(virBufferPtr buf, unsigned int flags) { g_auto(virBuffer) attrBuf =3D VIR_BUFFER_INITIALIZER; - g_auto(virBuffer) childBuf =3D VIR_BUFFER_INITIALIZER; + g_auto(virBuffer) childBuf =3D VIR_BUFFER_INIT_CHILD(buf); bool inactive =3D flags & VIR_DOMAIN_DEF_FORMAT_INACTIVE; virStorageSourcePtr backingStore =3D src->backingStore; - virBufferSetChildIndent(&childBuf, buf); - if (!backingStore) return 0; @@ -24293,9 +24286,7 @@ static int virDomainDiskDefFormatIotune(virBufferPtr buf, virDomainDiskDefPtr disk) { - virBuffer childBuf =3D VIR_BUFFER_INITIALIZER; - - virBufferSetChildIndent(&childBuf, buf); + virBuffer childBuf =3D VIR_BUFFER_INIT_CHILD(buf); FORMAT_IOTUNE(total_bytes_sec); FORMAT_IOTUNE(read_bytes_sec); @@ -24404,11 +24395,9 @@ virDomainDiskDefFormatMirror(virBufferPtr buf, virDomainXMLOptionPtr xmlopt) { g_auto(virBuffer) attrBuf =3D VIR_BUFFER_INITIALIZER; - g_auto(virBuffer) childBuf =3D VIR_BUFFER_INITIALIZER; + g_auto(virBuffer) childBuf =3D VIR_BUFFER_INIT_CHILD(buf); const char *formatStr =3D NULL; - virBufferSetChildIndent(&childBuf, buf); - /* For now, mirroring is currently output-only: we only output it * for live domains, therefore we ignore it on input except for * the internal parse on libvirtd restart. We prefer to output @@ -24455,15 +24444,13 @@ virDomainDiskDefFormatPrivateData(virBufferPtr bu= f, unsigned int flags, virDomainXMLOptionPtr xmlopt) { - g_auto(virBuffer) childBuf =3D VIR_BUFFER_INITIALIZER; + g_auto(virBuffer) childBuf =3D VIR_BUFFER_INIT_CHILD(buf); if (!(flags & VIR_DOMAIN_DEF_FORMAT_STATUS) || !xmlopt || !xmlopt->privateData.diskFormat) return 0; - virBufferSetChildIndent(&childBuf, buf); - if (xmlopt->privateData.diskFormat(disk, &childBuf) < 0) return -1; @@ -24641,9 +24628,7 @@ virDomainControllerDefFormat(virBufferPtr buf, const char *model =3D NULL; const char *modelName =3D NULL; g_auto(virBuffer) attrBuf =3D VIR_BUFFER_INITIALIZER; - g_auto(virBuffer) childBuf =3D VIR_BUFFER_INITIALIZER; - - virBufferSetChildIndent(&childBuf, buf); + g_auto(virBuffer) childBuf =3D VIR_BUFFER_INIT_CHILD(buf); if (!type) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -25745,9 +25730,7 @@ virDomainChrSourceDefFormat(virBufferPtr buf, unsigned int flags) { g_auto(virBuffer) attrBuf =3D VIR_BUFFER_INITIALIZER; - g_auto(virBuffer) childBuf =3D VIR_BUFFER_INITIALIZER; - - virBufferSetChildIndent(&childBuf, buf); + g_auto(virBuffer) childBuf =3D VIR_BUFFER_INIT_CHILD(buf); switch ((virDomainChrType)def->type) { case VIR_DOMAIN_CHR_TYPE_NULL: @@ -26023,12 +26006,10 @@ virDomainSmartcardDefFormat(virBufferPtr buf, unsigned int flags) { const char *mode =3D virDomainSmartcardTypeToString(def->type); - g_auto(virBuffer) childBuf =3D VIR_BUFFER_INITIALIZER; + g_auto(virBuffer) childBuf =3D VIR_BUFFER_INIT_CHILD(buf); size_t i; int ret =3D -1; - virBufferSetChildIndent(&childBuf, buf); - if (!mode) { virReportError(VIR_ERR_INTERNAL_ERROR, _("unexpected smartcard type %d"), def->type); @@ -26153,12 +26134,10 @@ virDomainSoundDefFormat(virBufferPtr buf, unsigned int flags) { const char *model =3D virDomainSoundModelTypeToString(def->model); - g_auto(virBuffer) childBuf =3D VIR_BUFFER_INITIALIZER; + g_auto(virBuffer) childBuf =3D VIR_BUFFER_INIT_CHILD(buf); size_t i; int ret =3D -1; - virBufferSetChildIndent(&childBuf, buf); - if (!model) { virReportError(VIR_ERR_INTERNAL_ERROR, _("unexpected sound model %d"), def->model); @@ -26194,7 +26173,7 @@ virDomainMemballoonDefFormat(virBufferPtr buf, { const char *model =3D virDomainMemballoonModelTypeToString(def->model); 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); g_auto(virBuffer) driverAttrBuf =3D VIR_BUFFER_INITIALIZER; if (!model) { @@ -26209,8 +26188,6 @@ virDomainMemballoonDefFormat(virBufferPtr buf, virBufferAsprintf(&attrBuf, " autodeflate=3D'%s'", virTristateSwitchTypeToString(def->autodeflate)); - virBufferSetChildIndent(&childrenBuf, buf); - if (def->period) virBufferAsprintf(&childrenBuf, "\n", def->p= eriod); @@ -26250,9 +26227,7 @@ virDomainWatchdogDefFormat(virBufferPtr buf, const char *model =3D virDomainWatchdogModelTypeToString(def->model); const char *action =3D virDomainWatchdogActionTypeToString(def->action= ); g_auto(virBuffer) attrBuf =3D VIR_BUFFER_INITIALIZER; - g_auto(virBuffer) childBuf =3D VIR_BUFFER_INITIALIZER; - - virBufferSetChildIndent(&childBuf, buf); + g_auto(virBuffer) childBuf =3D VIR_BUFFER_INIT_CHILD(buf); if (!model) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -26280,13 +26255,12 @@ static int virDomainPanicDefFormat(virBufferPtr b= uf, virDomainPanicDefPtr def) { 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); if (def->model) virBufferAsprintf(&attrBuf, " model=3D'%s'", virDomainPanicModelTypeToString(def->model)); - virBufferSetChildIndent(&childrenBuf, buf); if (virDomainDeviceInfoFormat(&childrenBuf, &def->info, 0) < 0) return -1; @@ -26619,7 +26593,7 @@ virDomainInputDefFormat(virBufferPtr buf, const char *type =3D virDomainInputTypeToString(def->type); const char *bus =3D virDomainInputBusTypeToString(def->bus); g_auto(virBuffer) attrBuf =3D VIR_BUFFER_INITIALIZER; - g_auto(virBuffer) childBuf =3D VIR_BUFFER_INITIALIZER; + g_auto(virBuffer) childBuf =3D VIR_BUFFER_INIT_CHILD(buf); g_auto(virBuffer) driverAttrBuf =3D VIR_BUFFER_INITIALIZER; /* don't format keyboard into migratable XML for backward compatibilit= y */ @@ -26654,7 +26628,6 @@ virDomainInputDefFormat(virBufferPtr buf, virBufferAsprintf(&attrBuf, " model=3D'%s'", model); } - virBufferSetChildIndent(&childBuf, buf); virDomainVirtioOptionsFormat(&driverAttrBuf, def->virtio); virXMLFormatElement(&childBuf, "driver", &driverAttrBuf, NULL); @@ -27352,9 +27325,7 @@ virDomainHubDefFormat(virBufferPtr buf, { const char *type =3D virDomainHubTypeToString(def->type); g_auto(virBuffer) attrBuf =3D VIR_BUFFER_INITIALIZER; - g_auto(virBuffer) childBuf =3D VIR_BUFFER_INITIALIZER; - - virBufferSetChildIndent(&childBuf, buf); + g_auto(virBuffer) childBuf =3D VIR_BUFFER_INIT_CHILD(buf); if (!type) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -27621,12 +27592,11 @@ virDomainCachetuneDefFormat(virBufferPtr buf, virDomainResctrlDefPtr resctrl, unsigned int flags) { - g_auto(virBuffer) childrenBuf =3D VIR_BUFFER_INITIALIZER; + g_auto(virBuffer) childrenBuf =3D VIR_BUFFER_INIT_CHILD(buf); size_t i =3D 0; int ret =3D -1; g_autofree char *vcpus =3D NULL; - virBufferSetChildIndent(&childrenBuf, buf); if (virResctrlAllocForeachCache(resctrl->alloc, virDomainCachetuneDefFormatHelper, &childrenBuf) < 0) @@ -27687,11 +27657,10 @@ virDomainMemorytuneDefFormat(virBufferPtr buf, virDomainResctrlDefPtr resctrl, unsigned int flags) { - g_auto(virBuffer) childrenBuf =3D VIR_BUFFER_INITIALIZER; + g_auto(virBuffer) childrenBuf =3D VIR_BUFFER_INIT_CHILD(buf); int ret =3D -1; g_autofree char *vcpus =3D NULL; - virBufferSetChildIndent(&childrenBuf, buf); if (virResctrlAllocForeachMemory(resctrl->alloc, virDomainMemorytuneDefFormatHelper, &childrenBuf) < 0) @@ -27731,10 +27700,9 @@ virDomainCputuneDefFormat(virBufferPtr buf, unsigned int flags) { size_t i; - g_auto(virBuffer) childrenBuf =3D VIR_BUFFER_INITIALIZER; + g_auto(virBuffer) childrenBuf =3D VIR_BUFFER_INIT_CHILD(buf); int ret =3D -1; - virBufferSetChildIndent(&childrenBuf, buf); if (def->cputune.sharesSpecified) virBufferAsprintf(&childrenBuf, "%llu\n", @@ -27916,13 +27884,11 @@ static int virDomainIOMMUDefFormat(virBufferPtr buf, const virDomainIOMMUDef *iommu) { - g_auto(virBuffer) childBuf =3D VIR_BUFFER_INITIALIZER; + g_auto(virBuffer) childBuf =3D VIR_BUFFER_INIT_CHILD(buf); g_auto(virBuffer) attrBuf =3D VIR_BUFFER_INITIALIZER; g_auto(virBuffer) driverAttrBuf =3D VIR_BUFFER_INITIALIZER; int ret =3D -1; - virBufferSetChildIndent(&childBuf, buf); - if (iommu->intremap !=3D VIR_TRISTATE_SWITCH_ABSENT) { virBufferAsprintf(&driverAttrBuf, " intremap=3D'%s'", virTristateSwitchTypeToString(iommu->intremap)); @@ -27957,9 +27923,7 @@ static void virDomainMemtuneFormat(virBufferPtr buf, const virDomainMemtune *mem) { - g_auto(virBuffer) childBuf =3D VIR_BUFFER_INITIALIZER; - - virBufferSetChildIndent(&childBuf, buf); + g_auto(virBuffer) childBuf =3D VIR_BUFFER_INIT_CHILD(buf); if (virMemoryLimitIsSet(mem->hard_limit)) { virBufferAsprintf(&childBuf, @@ -27990,9 +27954,7 @@ static void virDomainMemorybackingFormat(virBufferPtr buf, const virDomainMemtune *mem) { - g_auto(virBuffer) childBuf =3D VIR_BUFFER_INITIALIZER; - - virBufferSetChildIndent(&childBuf, buf); + g_auto(virBuffer) childBuf =3D VIR_BUFFER_INIT_CHILD(buf); if (mem->nhugepages) virDomainHugepagesFormat(&childBuf, mem->hugepages, mem->nhugepage= s); @@ -28020,7 +27982,7 @@ static int virDomainVsockDefFormat(virBufferPtr buf, virDomainVsockDefPtr vsock) { - g_auto(virBuffer) childBuf =3D VIR_BUFFER_INITIALIZER; + g_auto(virBuffer) childBuf =3D VIR_BUFFER_INIT_CHILD(buf); g_auto(virBuffer) attrBuf =3D VIR_BUFFER_INITIALIZER; g_auto(virBuffer) cidAttrBuf =3D VIR_BUFFER_INITIALIZER; int ret =3D -1; @@ -28030,8 +27992,6 @@ virDomainVsockDefFormat(virBufferPtr buf, virDomainVsockModelTypeToString(vsock->model)); } - virBufferSetChildIndent(&childBuf, buf); - if (vsock->auto_cid !=3D VIR_TRISTATE_BOOL_ABSENT) { virBufferAsprintf(&cidAttrBuf, " auto=3D'%s'", virTristateBoolTypeToString(vsock->auto_cid)); @@ -28056,10 +28016,9 @@ static int virDomainDefFormatBlkiotune(virBufferPtr buf, virDomainDefPtr def) { - g_auto(virBuffer) childrenBuf =3D VIR_BUFFER_INITIALIZER; + g_auto(virBuffer) childrenBuf =3D VIR_BUFFER_INIT_CHILD(buf); ssize_t n; - virBufferSetChildIndent(&childrenBuf, buf); if (def->blkio.weight) virBufferAsprintf(&childrenBuf, "%u\n", def->blkio.weight); @@ -28103,14 +28062,12 @@ static int virDomainDefFormatFeatures(virBufferPtr buf, virDomainDefPtr def) { - g_auto(virBuffer) tmpAttrBuf =3D VIR_BUFFER_INITIALIZER; - g_auto(virBuffer) tmpChildBuf =3D VIR_BUFFER_INITIALIZER; - 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_DOMAIN_FEATURE_LAST; i++) { + g_auto(virBuffer) tmpAttrBuf =3D VIR_BUFFER_INITIALIZER; + g_auto(virBuffer) tmpChildBuf =3D VIR_BUFFER_INIT_CHILD(&childBuf); const char *name =3D virDomainFeatureTypeToString(i); size_t j; @@ -28176,7 +28133,6 @@ virDomainDefFormatFeatures(virBufferPtr buf, unsigned long long short_size =3D virFormatIntPretty(def->= tseg_size, &unit); - virBufferSetChildIndent(&tmpChildBuf, &childBuf); virBufferAsprintf(&tmpChildBuf, "%llu\n", unit, short_size); } @@ -28297,8 +28253,6 @@ virDomainDefFormatFeatures(virBufferPtr buf, break; case VIR_DOMAIN_FEATURE_CAPABILITIES: - virBufferSetChildIndent(&tmpChildBuf, &childBuf); - for (j =3D 0; j < VIR_DOMAIN_PROCES_CAPS_FEATURE_LAST; j++) { if (def->caps_features[j] !=3D VIR_TRISTATE_SWITCH_ABSENT) virBufferAsprintf(&tmpChildBuf, "<%s state=3D'%s'/>\n", @@ -28343,7 +28297,6 @@ virDomainDefFormatFeatures(virBufferPtr buf, virDomainHPTResizingTypeToString(def->hp= t_resizing)); } if (def->hpt_maxpagesize > 0) { - virBufferSetChildIndent(&tmpChildBuf, &childBuf); virBufferAsprintf(&tmpChildBuf, "%llu\n", def->hpt_maxpagesize); --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 04:56:35 2024 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=1573568335; cv=none; d=zoho.com; s=zohoarc; b=IdutWdF2WWeZf8Wh8z6ePI/+HQp04++dVq/J6Th3Wppv0tiYmd3peQlGBtL9/a8qutZQ7cZ+jn3UGWaDASixoYcMeXOVfmakJckeAov97vEcPS01a2jVrZeMk34oKAdwvqd2TxYAmu2o8TqdkDvdDLSz385puuNEL8nYPXymL0k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573568335; 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=P9bTUAnaDlYUI1hbhwzpGwz2dh7Kyeo05EHN3yextw4=; b=n0/SBgOtq1p72c5S3qVaYRXKY88Wu+fgd5cAjGRECabQUEb0TFVIo9RlfPITygwHVZu9y6bdiqaCBjBfbQvFh/ujhkv/XzPKwvzYcq84NkvfzE9+cKDMX0YCNTd8Tdim9Mi5XpTdHbIwHhQ40WBbUXsyKQzKEQWkQj0xKsCNXDA= 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 1573568335790826.3154496129172; Tue, 12 Nov 2019 06:18:55 -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-196-wFf7vApbPRKEtb9-ncHkFQ-1; Tue, 12 Nov 2019 09:18:53 -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 E16C41005511; Tue, 12 Nov 2019 14:18:47 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B1AAE60A97; Tue, 12 Nov 2019 14:18:47 +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 6D2044E56D; Tue, 12 Nov 2019 14:18:47 +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 xACEIUxV001095 for ; Tue, 12 Nov 2019 09:18:30 -0500 Received: by smtp.corp.redhat.com (Postfix) id 14348101E26E; Tue, 12 Nov 2019 14:18:30 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 925E610027B8 for ; Tue, 12 Nov 2019 14:18:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573568334; 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=P9bTUAnaDlYUI1hbhwzpGwz2dh7Kyeo05EHN3yextw4=; b=LR4xRpc1PX39HXS3McW7/0hSqUQbJ7SckkLs8ep3bAdVxU6WaY+xc7yQ0EoiRguLravWo1 p0RcBkbLfqHtJZSO1h+GilmNSmbqx9VVcpoOtG41oFEPPNh14/rPLXs0bZBZOX+YyDvJvb nCCiVqhqg62VG019BMTIFTy0YgBkHBQ= From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 12 Nov 2019 15:18:20 +0100 Message-Id: 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 7/7] util: buffer: remove virBufferSetChildIndent 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: wFf7vApbPRKEtb9-ncHkFQ-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" Promote usage of separate buffers for separate formatting passes by removing the now unused virBufferSetChildIndent. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/util/virbuffer.h | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/util/virbuffer.h b/src/util/virbuffer.h index a2e30c07dc..38758a9125 100644 --- a/src/util/virbuffer.h +++ b/src/util/virbuffer.h @@ -88,15 +88,6 @@ void virBufferURIEncodeString(virBufferPtr buf, const ch= ar *str); void virBufferAdjustIndent(virBufferPtr buf, int indent); void virBufferSetIndent(virBufferPtr, int indent); -/** - * virBufferSetChildIndent - * - * Gets the parent indentation, increments it by 2 and sets it to - * child buffer. - */ -#define virBufferSetChildIndent(childBuf_, parentBuf_) \ - virBufferSetIndent(childBuf_, virBufferGetIndent(parentBuf_) + 2) - size_t virBufferGetIndent(const virBuffer *buf); size_t virBufferGetEffectiveIndent(const virBuffer *buf); --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list