From nobody Mon Feb 9 19:53:51 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1560876117; cv=none; d=zoho.com; s=zohoarc; b=hfDsQ0dNbznTbX4xsnzn5Icj318s43rL+Drsu81MK+hpFqjQc6DZq0d/cVBUCdNMppsL2kHuNJj+GMoaS3cpbuscqooLdxOch2p67fwR8bwFwZcSqdq8j4hQfk/9RnxMJZ7AMD1U2/j9ixYM8Z/GCjHR6oPso2vnJxh21SRRr88= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560876117; 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:ARC-Authentication-Results; bh=sSPLh32an5p9t/SVOaJ+E96nOPQMTtGrXqbFW/V6aYk=; b=l5NfbtQiBaNdrICNW+TtgwtgGJ/Mws8ywbBSZSrcTxRDPNXCLij4vS6MePP7VXwkA1+uz5JmTJHcAyItGnD4iIdGcX24c7qP48Xg2qqZvGhGwQIyegQ5iCXDWLJsOiC6pdrKUB5+9I5EmkSnBKkMhhy0FuQDTFsoU6VXF9rHzd0= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1560876117160945.7647334927899; Tue, 18 Jun 2019 09:41:57 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 88C597FDF5; Tue, 18 Jun 2019 16:41:55 +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 63EFE5F1BF; Tue, 18 Jun 2019 16:41:55 +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 17DEC1806B1A; Tue, 18 Jun 2019 16:41:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x5IGDVok024270 for ; Tue, 18 Jun 2019 12:13:31 -0400 Received: by smtp.corp.redhat.com (Postfix) id DBDBF60FAB; Tue, 18 Jun 2019 16:13:31 +0000 (UTC) Received: from aegolius.redhat.com (ovpn-117-198.phx2.redhat.com [10.3.117.198]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A9B5A84EF for ; Tue, 18 Jun 2019 16:13:31 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:12:53 -0500 Message-Id: <20190618161316.1722-24-jjongsma@redhat.com> In-Reply-To: <20190618161316.1722-1-jjongsma@redhat.com> References: <20190618161316.1722-1-jjongsma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 23/46] util: log: use #pragma once in headers 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: , Content-Transfer-Encoding: quoted-printable 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-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 18 Jun 2019 16:41:56 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/util/virlog.h | 55 ++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 29 deletions(-) diff --git a/src/util/virlog.h b/src/util/virlog.h index 775a726b06..a30b760fb4 100644 --- a/src/util/virlog.h +++ b/src/util/virlog.h @@ -19,24 +19,23 @@ * */ =20 -#ifndef LIBVIRT_VIRLOG_H -# define LIBVIRT_VIRLOG_H +#pragma once =20 -# include "internal.h" -# include "virbuffer.h" +#include "internal.h" +#include "virbuffer.h" =20 -# ifdef PACKAGER_VERSION -# ifdef PACKAGER -# define VIR_LOG_VERSION_STRING \ +#ifdef PACKAGER_VERSION +# ifdef PACKAGER +# define VIR_LOG_VERSION_STRING \ "libvirt version: " VERSION ", package: " PACKAGER_VERSION " (" PACKA= GER ")" -# else -# define VIR_LOG_VERSION_STRING \ - "libvirt version: " VERSION ", package: " PACKAGER_VERSION -# endif # else # define VIR_LOG_VERSION_STRING \ - "libvirt version: " VERSION + "libvirt version: " VERSION ", package: " PACKAGER_VERSION # endif +#else +# define VIR_LOG_VERSION_STRING \ + "libvirt version: " VERSION +#endif =20 /* * To be made public @@ -48,7 +47,7 @@ typedef enum { VIR_LOG_ERROR, } virLogPriority; =20 -# define VIR_LOG_DEFAULT VIR_LOG_WARN +#define VIR_LOG_DEFAULT VIR_LOG_WARN =20 typedef enum { VIR_LOG_TO_STDERR =3D 0, @@ -73,7 +72,7 @@ struct _virLogSource { * log statements in a file are conditionally disabled * at compile time due to configure options. */ -# define VIR_LOG_INIT(n) \ +#define VIR_LOG_INIT(n) \ static ATTRIBUTE_UNUSED virLogSource virLogSelf =3D { \ .name =3D "" n "", \ .priority =3D VIR_LOG_ERROR, \ @@ -86,10 +85,10 @@ struct _virLogSource { * are printed to stderr for debugging or to an appropriate channel * defined at runtime from the libvirt daemon configuration file */ -# ifdef ENABLE_DEBUG -# define VIR_DEBUG_INT(src, filename, linenr, funcname, ...) \ +#ifdef ENABLE_DEBUG +# define VIR_DEBUG_INT(src, filename, linenr, funcname, ...) \ virLogMessage(src, VIR_LOG_DEBUG, filename, linenr, funcname, NULL, __= VA_ARGS__) -# else +#else /** * virLogEatParams: * @@ -100,24 +99,24 @@ static inline void virLogEatParams(virLogSourcePtr unu= sed, ...) /* Silence gcc */ unused =3D unused; } -# define VIR_DEBUG_INT(src, filename, linenr, funcname, ...) \ +# define VIR_DEBUG_INT(src, filename, linenr, funcname, ...) \ virLogEatParams(src, filename, linenr, funcname, __VA_ARGS__) -# endif /* !ENABLE_DEBUG */ +#endif /* !ENABLE_DEBUG */ =20 -# define VIR_INFO_INT(src, filename, linenr, funcname, ...) \ +#define VIR_INFO_INT(src, filename, linenr, funcname, ...) \ virLogMessage(src, VIR_LOG_INFO, filename, linenr, funcname, NULL, __V= A_ARGS__) -# define VIR_WARN_INT(src, filename, linenr, funcname, ...) \ +#define VIR_WARN_INT(src, filename, linenr, funcname, ...) \ virLogMessage(src, VIR_LOG_WARN, filename, linenr, funcname, NULL, __V= A_ARGS__) -# define VIR_ERROR_INT(src, filename, linenr, funcname, ...) \ +#define VIR_ERROR_INT(src, filename, linenr, funcname, ...) \ virLogMessage(src, VIR_LOG_ERROR, filename, linenr, funcname, NULL, __= VA_ARGS__) =20 -# define VIR_DEBUG(...) \ - VIR_DEBUG_INT(&virLogSelf, __FILE__, __LINE__, __func__, __VA_ARGS__) -# define VIR_INFO(...) \ +#define VIR_DEBUG(...) \ + VIR_DEBUG_INT(&virLogSelf, __FILE__, __LINE__, __func__, __VA_ARGS__) +#define VIR_INFO(...) \ VIR_INFO_INT(&virLogSelf, __FILE__, __LINE__, __func__, __VA_ARGS__) -# define VIR_WARN(...) \ +#define VIR_WARN(...) \ VIR_WARN_INT(&virLogSelf, __FILE__, __LINE__, __func__, __VA_ARGS__) -# define VIR_ERROR(...) \ +#define VIR_ERROR(...) \ VIR_ERROR_INT(&virLogSelf, __FILE__, __LINE__, __func__, __VA_ARGS__) =20 =20 @@ -238,5 +237,3 @@ int virLogParseOutputs(const char *src, virLogOutputPtr **outputs) ATTRIBUTE_NONNULL(1); int virLogParseFilters(const char *src, virLogFilterPtr **filters) ATTRIBUTE_NONNULL(1); - -#endif /* LIBVIRT_VIRLOG_H */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list