From nobody Fri May 17 02:03:20 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=1658232311; cv=none; d=zohomail.com; s=zohoarc; b=WufenxMD+MLsab7BAKvxjQyU26o6jDRl4J/fJC7bVPQBQBBlZBF3HsNVqvxdCbgH/Z6C6/F56DZxki9FV1RxQbc1/a5vhedQQ4RgQTyQC/ClmrMkGYtJt9v45hFeS9Q8+4CE4lgILhe+10rkI2Sp8JGM8eYzJlqqPAvyrqgq35A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658232311; 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=vZbe07noK1ffbXv+Q0voECOOHQ7yY5c67IN2wIOokhA=; b=Wysu0eVkS97OySArQFFT//GgM/LpjcSxHMtT6Mw0zniUifL4/cJHd8CcScd1x211VBg3zVfq6SehI+aKcSTLIC0R4MQZ1OWkKGZGoARmsC9QFoHNfDZeKPLqP7boTANlPO7UkyBfxTo4AVmr48jTbOaN4soXl4mSjp5Gcafagh8= 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 165823231113678.51514826913115; Tue, 19 Jul 2022 05:05:11 -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-376-Ft01PORZNx-DfeXqpKc36w-1; Tue, 19 Jul 2022 08:05:05 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DACF918E6C54; Tue, 19 Jul 2022 12:05:00 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5AD841121319; Tue, 19 Jul 2022 12:05:00 +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 590B919274CF; Tue, 19 Jul 2022 12:04:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id F2515194707F for ; Tue, 19 Jul 2022 12:04:57 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id E6D64401E92; Tue, 19 Jul 2022 12:04:57 +0000 (UTC) Received: from maggie.brq.redhat.com (unknown [10.34.246.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 668FE492C3B for ; Tue, 19 Jul 2022 12:04:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658232309; 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=vZbe07noK1ffbXv+Q0voECOOHQ7yY5c67IN2wIOokhA=; b=WQ+SJUAsvDOScVCHTN/HJ+Lj2Uwk8OALnUoSDKfhajaX/xuM1R9JVBOiC5G+JgUSt28E43 MXGCJVQ/TVKDMc0M8NHsIRC9hBs+pNxKPG7NZlX92H8Pp4/1PM5NVuVEyFThvTajZVl3HK iJTiwN4aQt6GnB25XpAR7TjUosiR5MM= X-MC-Unique: Ft01PORZNx-DfeXqpKc36w-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 1/2] qemu_capabilities: Indent properly Date: Tue, 19 Jul 2022 14:04:54 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 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.3 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: 1658232311797100003 Content-Type: text/plain; charset="utf-8"; x-default="true" When formatting qemuCaps XML, the element is misaligned. This is because it contains multiple lines and virBufferAsprintf() does not expect that. Switch to virBufferAddStr() which does. Signed-off-by: Michal Privoznik Reviewed-by: Tim Wiederhake --- src/qemu/qemu_capabilities.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index cf8f33475c..30b396d32d 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -4756,7 +4756,7 @@ virQEMUCapsFormatCache(virQEMUCaps *qemuCaps) =20 if (qemuCaps->cpuData) { g_autofree char * cpudata =3D virCPUDataFormat(qemuCaps->cpuData); - virBufferAsprintf(&buf, "%s", cpudata); + virBufferAddStr(&buf, cpudata); } =20 virBufferAsprintf(&buf, "%s\n", --=20 2.35.1 From nobody Fri May 17 02:03:20 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=1658232309; cv=none; d=zohomail.com; s=zohoarc; b=LHhGZ/M7zVV/iI4tPmCIeFWkrrkYX0KQbePz4Fqpo0shka4b9LhdP3Mwj7jRHeAktjJf5ozNGn2YQ/sX0azqBy972fzX3sz06JUl7bFcoHQA5ist4KH8S0UkAN9wUBtWPir3O6QnicPP0WBnM0gAoFlzBbtLOd/WZMepSyphLAA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658232309; 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=0HCb+5WQ/mRrkdGGLHePhVtI4Rlsz6+qYTvB4dKgsq4=; b=HWR7SYxU22L7nT+N5cKx+s+PidmPkDv7Tr5Mnaxqq+SlKqeurzBhIBsQ+aWsgyU31ZXgsKbz8S2SCYC+Wgk5MTXOkXJKwNOOtfxo4yp5Sl6XXE0pU8dqKxLgv+m5NpcrRZsma/TPP8SRzniILSwhdvEYK8Cm6sfuGm8tEJZqNVs= 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 1658232309321903.8613398031483; Tue, 19 Jul 2022 05:05:09 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-444-arlUeiaqPE-qro5YqLY9cA-1; Tue, 19 Jul 2022 08:05:04 -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 10B673821C11; Tue, 19 Jul 2022 12:05:01 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id EF7EE2166B29; Tue, 19 Jul 2022 12:05:00 +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 B88CF19451EF; Tue, 19 Jul 2022 12:05:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B95541945DA7 for ; Tue, 19 Jul 2022 12:04:58 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id A328D492C3B; Tue, 19 Jul 2022 12:04:58 +0000 (UTC) Received: from maggie.brq.redhat.com (unknown [10.34.246.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2A5F0401E92 for ; Tue, 19 Jul 2022 12:04:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658232308; 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=0HCb+5WQ/mRrkdGGLHePhVtI4Rlsz6+qYTvB4dKgsq4=; b=i9vA+O1SiYilu+4QRj0yrLettsGXtvqhk9T3tAXxwh2Hzw3L1KOOgce0HNgIG1yqCJBQMb HF+AG75ePxHkyT1h2/CaoiRLiWq30vtGgMa7xTihHlqCP5XsDFZrla68k784SMdXl2r6wj XYnqe2yG9y6EX6D6q9CdlkaiGYONMio= X-MC-Unique: arlUeiaqPE-qro5YqLY9cA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 2/2] domain_conf: Switch to virBufferAddLit for literal strings Date: Tue, 19 Jul 2022 14:04:55 +0200 Message-Id: <776b182eb3e4756fc17791e8219fc56fda1900d7.1658232272.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 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: 1658232309793100001 Content-Type: text/plain; charset="utf-8"; x-default="true" There's no need to use virBufferAddStr() for literal strings without any newline character as it's more expensive than virBufferAddLit(). Signed-off-by: Michal Privoznik Reviewed-by: Tim Wiederhake --- src/conf/domain_conf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 4c7a5a044c..44a01ab628 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -25376,7 +25376,7 @@ virDomainGraphicsDefFormat(virBuffer *buf, =20 case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NONE: if (flags & VIR_DOMAIN_DEF_FORMAT_MIGRATABLE) - virBufferAddStr(buf, " autoport=3D'no'"); + virBufferAddLit(buf, " autoport=3D'no'"); break; =20 case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_SOCKET: @@ -25388,7 +25388,7 @@ virDomainGraphicsDefFormat(virBuffer *buf, * parsed as listen type "none". */ if ((flags & VIR_DOMAIN_DEF_FORMAT_MIGRATABLE) && glisten->fromConfig) { - virBufferAddStr(buf, " autoport=3D'yes'"); + virBufferAddLit(buf, " autoport=3D'yes'"); } break; =20 --=20 2.35.1