From nobody Thu May 16 02:11:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1648477665; cv=none; d=zohomail.com; s=zohoarc; b=VwVY7fCQDyuDMOhoX83b/L9d/AxJxTeZrgDKm9/HyUeG95ruzOeLSathaIk1hxtLWctNF4apf762girDDd7B7Oxfigq3ie2FPnWe72gneNDTdsovSjHFS7Aqt/OpByXBRQUvoEPQlDJ+OPz4HsmzPMPQJqUEq9k01Gu70GUQ7Fg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1648477665; 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=hB9VslFVJc3Wh23eT7aLLGLB4l+wp5/4f8/qIC+gPtQ=; b=KE3/l0y/nzCxypQoWht+dv4M010z23+R1/3ML2TvQxbbu+IY+7Vy0PZq0iGZUEKFmGeN156R2VvniarbjzVoLbjJed3EjZbQSTRA9+THlBIuXaf7luy5x+hyYlOVwKLctBBuZgQGRw01MYQGZOprdG59BZXKXNvQZ6FUgAJbJdY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1648477665595848.6093189824636; Mon, 28 Mar 2022 07:27:45 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-668-sHg6YEgEM8u2l9u9FWbGfg-1; Mon, 28 Mar 2022 10:27:40 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 06DA118E004C; Mon, 28 Mar 2022 14:27:38 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 97A56401DB1; Mon, 28 Mar 2022 14:27:36 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 722E21947BBF; Mon, 28 Mar 2022 14:27:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id DEDC41947BBE for ; Mon, 28 Mar 2022 14:27:35 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id D0CE94066C81; Mon, 28 Mar 2022 14:27:35 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4DD984066C80 for ; Mon, 28 Mar 2022 14:27:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648477664; 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=hB9VslFVJc3Wh23eT7aLLGLB4l+wp5/4f8/qIC+gPtQ=; b=PeT1Kc/v5PMV7vYaPPKnNDPpjrYcjZ5aTUf5wS+YKiZK49+634imZZy3Z3Rwov15JUSD9/ HiP88av7cypOfZzYh5dTJWUzEZXZW0qImBVkn3BsMUbVVg0rar1P0tPfSXjys+RaOFf80d wW6gBOgl+J1YQZNBwh1nORrT9UDfYvw= X-MC-Unique: sHg6YEgEM8u2l9u9FWbGfg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/3] virXMLFormatElement: Introduce virXMLFormatElementInternal Date: Mon, 28 Mar 2022 16:27:30 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1648477667054100003 Content-Type: text/plain; charset="utf-8"; x-default="true" The new function aggregates the internal working of virXMLFormatElement and virXMLFormatElementEmpty and also allows skipping the newline after the opening tag to allow using this helper also in cases where we don't format any child elements but directly a value. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/libvirt_private.syms | 1 + src/util/virxml.c | 58 +++++++++++++++++++++++++++++++--------- src/util/virxml.h | 7 +++++ 3 files changed, 54 insertions(+), 12 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 8a3e5f7f7c..3645a2f447 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -3634,6 +3634,7 @@ virXMLCheckIllegalChars; virXMLExtractNamespaceXML; virXMLFormatElement; virXMLFormatElementEmpty; +virXMLFormatElementInternal; virXMLFormatMetadata; virXMLNewNode; virXMLNodeContentString; diff --git a/src/util/virxml.c b/src/util/virxml.c index 8ff59e7cda..0a447df676 100644 --- a/src/util/virxml.c +++ b/src/util/virxml.c @@ -1591,21 +1591,48 @@ virXMLValidatorFree(virXMLValidator *validator) } -/* same as virXMLFormatElement but outputs an empty element if @attrBuf and - * @childBuf are both empty */ +/** + * virXMLFormatElementInternal + * @buf: the parent buffer where the element will be placed + * @name: the name of the element + * @attrBuf: buffer with attributes for element, may be NULL + * @childBuf: buffer with child elements, may be NULL + * @allowEmpty: Format empty element if @attrBuf and @childBuf are empty + * @childNewline: Add a newline after the opening element before formattin= g @childBuf + * + * Helper to format element where attributes or child elements + * are optional and may not be formatted. If both @attrBuf and + * @childBuf are NULL or are empty buffers the element is not + * formatted. + * + * Passing false for @childNewline allows to format elements where we dire= ctly + * output a value without subelements. + * + * Both passed buffers are always consumed and freed. + */ void -virXMLFormatElementEmpty(virBuffer *buf, - const char *name, - virBuffer *attrBuf, - virBuffer *childBuf) +virXMLFormatElementInternal(virBuffer *buf, + const char *name, + virBuffer *attrBuf, + virBuffer *childBuf, + bool allowEmpty, + bool childNewline) { + if (!allowEmpty) { + if ((!attrBuf || virBufferUse(attrBuf) =3D=3D 0) && + (!childBuf || virBufferUse(childBuf) =3D=3D 0)) + return; + } + virBufferAsprintf(buf, "<%s", name); if (attrBuf && virBufferUse(attrBuf) > 0) virBufferAddBuffer(buf, attrBuf); if (childBuf && virBufferUse(childBuf) > 0) { - virBufferAddLit(buf, ">\n"); + virBufferAddLit(buf, ">"); + if (childNewline) + virBufferAddLit(buf, "\n"); virBufferAddBuffer(buf, childBuf); virBufferAsprintf(buf, "\n", name); } else { @@ -1616,6 +1643,17 @@ virXMLFormatElementEmpty(virBuffer *buf, virBufferFreeAndReset(childBuf); } +/* same as virXMLFormatElement but outputs an empty element if @attrBuf and + * @childBuf are both empty */ +void +virXMLFormatElementEmpty(virBuffer *buf, + const char *name, + virBuffer *attrBuf, + virBuffer *childBuf) +{ + virXMLFormatElementInternal(buf, name, attrBuf, childBuf, true, true); +} + /** * virXMLFormatElement @@ -1637,11 +1675,7 @@ virXMLFormatElement(virBuffer *buf, virBuffer *attrBuf, virBuffer *childBuf) { - if ((!attrBuf || virBufferUse(attrBuf) =3D=3D 0) && - (!childBuf || virBufferUse(childBuf) =3D=3D 0)) - return; - - virXMLFormatElementEmpty(buf, name, attrBuf, childBuf); + virXMLFormatElementInternal(buf, name, attrBuf, childBuf, false, true); } diff --git a/src/util/virxml.h b/src/util/virxml.h index c39eae6282..a13853983a 100644 --- a/src/util/virxml.h +++ b/src/util/virxml.h @@ -315,6 +315,13 @@ void virXMLValidatorFree(virXMLValidator *validator); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virXMLValidator, virXMLValidatorFree); +void +virXMLFormatElementInternal(virBuffer *buf, + const char *name, + virBuffer *attrBuf, + virBuffer *childBuf, + bool allowEmpty, + bool childNewline); void virXMLFormatElement(virBuffer *buf, const char *name, --=20 2.35.1 From nobody Thu May 16 02:11:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 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=1648477698; cv=none; d=zohomail.com; s=zohoarc; b=Nhk8Sllqj8/9IBZnHL0tkbRTotsR+DrusbVKgX4Mrfs0VCORquIcgEgh6xIPrWKpAlR285+WGEIJ5a9Px4DRP40L2VpETY+gm75oK29GSJgVjyRipiGxIuUG4EkoxDUQGBhCfKr/s6MZ0qohwZEqJ66UDfKzalTKJMafiihd4J8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1648477698; 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=1GO/hELYM94M9LsyjwY1pW+1fbSXXYcyQAUl8IeiDKE=; b=Tcn7KvZujRw8eGcHZNmAylCOIRfmZ5PcaXq7pMaAM6edZTfvk3BFZNyext+BLiH2+wkzEfuPXVG7A4tcprcguq/rvgoCydis3YlHJ8yKW86WJneWZJc2TEqYCovjLexyDqZyQIeeqVIU+OkfHSYVz0mNKQ7bfTXFQX6D+Tr3130= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1648477698054210.210832478111; Mon, 28 Mar 2022 07:28:18 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-369-iCVX1sSWO_CE2jMpztSwWw-1; Mon, 28 Mar 2022 10:28:15 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0B983185A794; Mon, 28 Mar 2022 14:27:57 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 979802166B46; Mon, 28 Mar 2022 14:27:43 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 03DD71947BBF; Mon, 28 Mar 2022 14:27:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D28141940373 for ; Mon, 28 Mar 2022 14:27:36 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id B4AB24066C81; Mon, 28 Mar 2022 14:27:36 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id 32D1C4066C80 for ; Mon, 28 Mar 2022 14:27:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648477696; 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=1GO/hELYM94M9LsyjwY1pW+1fbSXXYcyQAUl8IeiDKE=; b=Ze+R+mBLpvz/GG3A7Z+7B8pS/S8JiNa3cqYU7atUPJjRO+fefiaODkGeq2DJIK865MR9GI pQxz5GehwdYrlHYHv6XjsupkoKS4iq4/9eiT5htPeOx9yZPWxjzoovLuGKBk7JwSeMS5+5 0U3yC2FW1SEaFWe+eE6r3gRm8eBChoA= X-MC-Unique: iCVX1sSWO_CE2jMpztSwWw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 2/3] virDomainLoaderDefFormat: Use modern XML formatting approach Date: Mon, 28 Mar 2022 16:27:31 +0200 Message-Id: <4a9e6f2a2b4dc778136dfc25b366d2448bc39762.1648477590.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1648477699591100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/conf/domain_conf.c | 40 ++++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index ba8dd7d7d0..98da3f2460 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -26911,34 +26911,30 @@ static void virDomainLoaderDefFormat(virBuffer *buf, virDomainLoaderDef *loader) { - const char *readonly =3D virTristateBoolTypeToString(loader->readonly); - const char *secure =3D virTristateBoolTypeToString(loader->secure); - const char *type =3D virDomainLoaderTypeToString(loader->type); + g_auto(virBuffer) loaderAttrBuf =3D VIR_BUFFER_INITIALIZER; + g_auto(virBuffer) loaderChildBuf =3D VIR_BUFFER_INITIALIZER; + g_auto(virBuffer) nvramAttrBuf =3D VIR_BUFFER_INITIALIZER; + g_auto(virBuffer) nvramChildBuf =3D VIR_BUFFER_INITIALIZER; - virBufferAddLit(buf, "readonly !=3D VIR_TRISTATE_BOOL_ABSENT) + virBufferAsprintf(&loaderAttrBuf, " readonly=3D'%s'", + virTristateBoolTypeToString(loader->readonly)); - if (loader->readonly) - virBufferAsprintf(buf, " readonly=3D'%s'", readonly); - - if (loader->secure) - virBufferAsprintf(buf, " secure=3D'%s'", secure); + if (loader->secure !=3D VIR_TRISTATE_BOOL_ABSENT) + virBufferAsprintf(&loaderAttrBuf, " secure=3D'%s'", + virTristateBoolTypeToString(loader->secure)); if (loader->type !=3D VIR_DOMAIN_LOADER_TYPE_NONE) - virBufferAsprintf(buf, " type=3D'%s'", type); + virBufferAsprintf(&loaderAttrBuf, " type=3D'%s'", + virDomainLoaderTypeToString(loader->type)); - if (loader->path) - virBufferEscapeString(buf, ">%s\n", loader->path); - else - virBufferAddLit(buf, "/>\n"); + virBufferEscapeString(&loaderChildBuf, "%s", loader->path); - if (loader->nvram || loader->nvramTemplate) { - virBufferAddLit(buf, "nvramTempla= te); - if (loader->nvram) - virBufferEscapeString(buf, ">%s\n", loader->nvram); - else - virBufferAddLit(buf, "/>\n"); - } + virXMLFormatElementInternal(buf, "loader", &loaderAttrBuf, &loaderChil= dBuf, false, false); + + virBufferEscapeString(&nvramAttrBuf, " template=3D'%s'", loader->nvram= Template); + virBufferEscapeString(&nvramChildBuf, "%s", loader->nvram); + virXMLFormatElementInternal(buf, "nvram", &nvramAttrBuf, &nvramChildBu= f, false, false); } static void --=20 2.35.1 From nobody Thu May 16 02:11:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1648477666; cv=none; d=zohomail.com; s=zohoarc; b=aRYXVadZ4SDEnq0BqslP0hC4CDm+pC2Lx3PBiktX5mppaNgjPJ3u0hLwojJuYqF7huYj1bCpJ3EfZcLmGZ10TzfEGczrxbHedm8IsN2Y5reh4SSdeaF01CE6c+Qdkg1tflgs7sOsqorDYiKtTAExciu3SVVShltjJ6wLUNme+Q0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1648477666; 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=kSrKQUHoHnluCqpiNd77i7SWakiYAdz3eiOIbOBKuxg=; b=KykpcB77c56vgsrCGr8g8P5uG3MTEFegX8FEc5WEPf67Jgbz5BU3564AXCk4KORJr0haMhGKkBXrMEgaHzOGfogVwWFzgdX2VSv9ftH5ABmXagY0Sh0M4lahjHCIIgEy1+NuvUXk1kSRuaIiCEa8uXgHGTUGMswgDTHQQeBD6ZQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1648477666231182.00009225481188; Mon, 28 Mar 2022 07:27:46 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-640-masSe058NkOSeANFJG9zcw-1; Mon, 28 Mar 2022 10:27:41 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0DA10811E76; Mon, 28 Mar 2022 14:27:39 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id EB55D43F065; Mon, 28 Mar 2022 14:27:38 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B65CD1947BBF; Mon, 28 Mar 2022 14:27:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C25D21940342 for ; Mon, 28 Mar 2022 14:27:37 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 992FF4066C86; Mon, 28 Mar 2022 14:27:37 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id 155A14066C80 for ; Mon, 28 Mar 2022 14:27:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648477665; 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=kSrKQUHoHnluCqpiNd77i7SWakiYAdz3eiOIbOBKuxg=; b=EW5lGQOfZ97Cc3preeoZ5A+YSvtH9sd4XP4o7zfS8MZfrQtR5peT+xFe9d5HzSy10tRopp H32kkwQryo6+qSjMEYIRKNB0a4CVexZYsfNxqMpMRFbqeDH04nV2I3w6eF+6G+akh7AF5T g3ctgFi5ETQ/rQQ8r0DhlUQ763aClXU= X-MC-Unique: masSe058NkOSeANFJG9zcw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 3/3] vboxSetBootDeviceOrder: Remove whitespace alignment in VIR_DEBUG statements Date: Mon, 28 Mar 2022 16:27:32 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1648477667027100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Don't try to align the output, it's not future-proof and it's for debugging only. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/vbox/vbox_common.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c index acd18494d3..734371a201 100644 --- a/src/vbox/vbox_common.c +++ b/src/vbox/vbox_common.c @@ -980,27 +980,27 @@ vboxSetBootDeviceOrder(virDomainDef *def, struct _vbo= xDriver *data, PRUint32 maxBootPosition =3D 0; size_t i =3D 0; - VIR_DEBUG("def->os.type %s", virDomainOSTypeToString(def->= os.type)); - VIR_DEBUG("def->os.arch %s", virArchToString(def->os.arch)= ); - VIR_DEBUG("def->os.machine %s", def->os.machine); - VIR_DEBUG("def->os.nBootDevs %zu", def->os.nBootDevs); - VIR_DEBUG("def->os.bootDevs[0] %d", def->os.bootDevs[0]); - VIR_DEBUG("def->os.bootDevs[1] %d", def->os.bootDevs[1]); - VIR_DEBUG("def->os.bootDevs[2] %d", def->os.bootDevs[2]); - VIR_DEBUG("def->os.bootDevs[3] %d", def->os.bootDevs[3]); - VIR_DEBUG("def->os.init %s", def->os.init); - VIR_DEBUG("def->os.kernel %s", def->os.kernel); - VIR_DEBUG("def->os.initrd %s", def->os.initrd); - VIR_DEBUG("def->os.cmdline %s", def->os.cmdline); - VIR_DEBUG("def->os.root %s", def->os.root); + VIR_DEBUG("def->os.type %s", virDomainOSTypeToString(def->os.type)); + VIR_DEBUG("def->os.arch %s", virArchToString(def->os.arch)); + VIR_DEBUG("def->os.machine %s", def->os.machine); + VIR_DEBUG("def->os.nBootDevs %zu", def->os.nBootDevs); + VIR_DEBUG("def->os.bootDevs[0] %d", def->os.bootDevs[0]); + VIR_DEBUG("def->os.bootDevs[1] %d", def->os.bootDevs[1]); + VIR_DEBUG("def->os.bootDevs[2] %d", def->os.bootDevs[2]); + VIR_DEBUG("def->os.bootDevs[3] %d", def->os.bootDevs[3]); + VIR_DEBUG("def->os.init %s", def->os.init); + VIR_DEBUG("def->os.kernel %s", def->os.kernel); + VIR_DEBUG("def->os.initrd %s", def->os.initrd); + VIR_DEBUG("def->os.cmdline %s", def->os.cmdline); + VIR_DEBUG("def->os.root %s", def->os.root); if (def->os.loader) { - VIR_DEBUG("def->os.loader->path %s", def->os.loader->path); + VIR_DEBUG("def->os.loader->path %s", def->os.loader->path); VIR_DEBUG("def->os.loader->readonly %d", def->os.loader->readonly); - VIR_DEBUG("def->os.loader->type %d", def->os.loader->type); - VIR_DEBUG("def->os.loader->nvram %s", def->os.loader->nvram); + VIR_DEBUG("def->os.loader->type %d", def->os.loader->type); + VIR_DEBUG("def->os.loader->nvram %s", def->os.loader->nvram); } - VIR_DEBUG("def->os.bootloader %s", def->os.bootloader); - VIR_DEBUG("def->os.bootloaderArgs %s", def->os.bootloaderArgs); + VIR_DEBUG("def->os.bootloader %s", def->os.bootloader); + VIR_DEBUG("def->os.bootloaderArgs %s", def->os.bootloaderArgs); gVBoxAPI.UIVirtualBox.GetSystemProperties(data->vboxObj, &systemProper= ties); if (systemProperties) { --=20 2.35.1