From nobody Tue Apr 30 01:28:16 2024 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=1560876061; cv=none; d=zoho.com; s=zohoarc; b=DZ/ksrIMowycb27aNOyZZltxvGHwOpeqjj3rZVSE5c6vBAmHVEs+fHX9j2Rm3fyWKUGA2rFceCZXeNGNBubqbfxlt1sU8NriMQpS9Hdho+3OGDDQPB7wgWMNUoSPL5OIDOsKMYlAlTgSLNTkuTxZfrGeYOgoYXlNw2oCDl+t4lQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560876061; 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=zCdkAzh4ba59eobWAWpgdoq3rpRVK6Nw6dR575oEgEo=; b=Dnqx7hSjA2ItFOwYXvtsmjxiUAIl9srp/CQ4mEACtmHupCe8VZWZkgfu8LsG3H84r25oXyZ9KzV74VRQFMusfUWqdulT1G/jCnApjAPlUcbrnG6lRTgDoZtbpIdsaxWYH0tQ/oZiJy7uhMCPWkYTSwmCEJpUyoipndksGSMmT7Q= 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 1560876061795543.9435053692023; Tue, 18 Jun 2019 09:41:01 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6B4A63092665; Tue, 18 Jun 2019 16:40:51 +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 435021001E65; Tue, 18 Jun 2019 16:40: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 F252C1806B18; Tue, 18 Jun 2019 16:40:44 +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 x5IGDOOo024116 for ; Tue, 18 Jun 2019 12:13:24 -0400 Received: by smtp.corp.redhat.com (Postfix) id 573DB84EF; Tue, 18 Jun 2019 16:13:24 +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 243A360FAB for ; Tue, 18 Jun 2019 16:13:24 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:12:31 -0500 Message-Id: <20190618161316.1722-2-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 01/46] src/locking: 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.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Tue, 18 Jun 2019 16:41:00 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/locking/domain_lock.h | 11 ++++------- src/locking/lock_daemon.h | 9 +++------ src/locking/lock_daemon_config.h | 7 ++----- src/locking/lock_daemon_dispatch.h | 7 ++----- src/locking/lock_driver.h | 18 +++++++----------- src/locking/lock_driver_lockd.h | 5 +---- src/locking/lock_driver_nop.h | 8 ++------ src/locking/lock_manager.h | 9 +++------ 8 files changed, 24 insertions(+), 50 deletions(-) diff --git a/src/locking/domain_lock.h b/src/locking/domain_lock.h index 02417b471b..6f197bf08b 100644 --- a/src/locking/domain_lock.h +++ b/src/locking/domain_lock.h @@ -19,12 +19,11 @@ * */ =20 -#ifndef LIBVIRT_DOMAIN_LOCK_H -# define LIBVIRT_DOMAIN_LOCK_H +#pragma once =20 -# include "internal.h" -# include "domain_conf.h" -# include "lock_manager.h" +#include "internal.h" +#include "domain_conf.h" +#include "lock_manager.h" =20 int virDomainLockProcessStart(virLockManagerPluginPtr plugin, const char *uri, @@ -57,5 +56,3 @@ int virDomainLockLeaseAttach(virLockManagerPluginPtr plug= in, int virDomainLockLeaseDetach(virLockManagerPluginPtr plugin, virDomainObjPtr dom, virDomainLeaseDefPtr lease); - -#endif /* LIBVIRT_DOMAIN_LOCK_H */ diff --git a/src/locking/lock_daemon.h b/src/locking/lock_daemon.h index 5c7f976ea4..7d30551c32 100644 --- a/src/locking/lock_daemon.h +++ b/src/locking/lock_daemon.h @@ -18,11 +18,10 @@ * . */ =20 -#ifndef LIBVIRT_LOCK_DAEMON_H -# define LIBVIRT_LOCK_DAEMON_H +#pragma once =20 -# include "virlockspace.h" -# include "virthread.h" +#include "virlockspace.h" +#include "virthread.h" =20 typedef struct _virLockDaemon virLockDaemon; typedef virLockDaemon *virLockDaemonPtr; @@ -50,5 +49,3 @@ int virLockDaemonAddLockSpace(virLockDaemonPtr lockd, =20 virLockSpacePtr virLockDaemonFindLockSpace(virLockDaemonPtr lockd, const char *path); - -#endif /* LIBVIRT_LOCK_DAEMON_H */ diff --git a/src/locking/lock_daemon_config.h b/src/locking/lock_daemon_con= fig.h index e820d60268..0f47ab1ed0 100644 --- a/src/locking/lock_daemon_config.h +++ b/src/locking/lock_daemon_config.h @@ -19,10 +19,9 @@ * . */ =20 -#ifndef LIBVIRT_LOCK_DAEMON_CONFIG_H -# define LIBVIRT_LOCK_DAEMON_CONFIG_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 typedef struct _virLockDaemonConfig virLockDaemonConfig; typedef virLockDaemonConfig *virLockDaemonConfigPtr; @@ -42,5 +41,3 @@ void virLockDaemonConfigFree(virLockDaemonConfigPtr data); int virLockDaemonConfigLoadFile(virLockDaemonConfigPtr data, const char *filename, bool allow_missing); - -#endif /* LIBVIRT_LOCK_DAEMON_CONFIG_H */ diff --git a/src/locking/lock_daemon_dispatch.h b/src/locking/lock_daemon_d= ispatch.h index 568a7e0160..d269ba10a8 100644 --- a/src/locking/lock_daemon_dispatch.h +++ b/src/locking/lock_daemon_dispatch.h @@ -18,12 +18,9 @@ * . */ =20 -#ifndef LIBVIRT_LOCK_DAEMON_DISPATCH_H -# define LIBVIRT_LOCK_DAEMON_DISPATCH_H +#pragma once =20 -# include "rpc/virnetserverprogram.h" +#include "rpc/virnetserverprogram.h" =20 extern virNetServerProgramProc virLockSpaceProtocolProcs[]; extern size_t virLockSpaceProtocolNProcs; - -#endif /* LIBVIRT_LOCK_DAEMON_DISPATCH_H */ diff --git a/src/locking/lock_driver.h b/src/locking/lock_driver.h index 50c73a70d4..e53c28ee33 100644 --- a/src/locking/lock_driver.h +++ b/src/locking/lock_driver.h @@ -19,11 +19,10 @@ * */ =20 -#ifndef LIBVIRT_LOCK_DRIVER_H -# define LIBVIRT_LOCK_DRIVER_H +#pragma once =20 -# include "internal.h" -# include "domain_conf.h" +#include "internal.h" +#include "domain_conf.h" =20 typedef struct _virLockManager virLockManager; typedef virLockManager *virLockManagerPtr; @@ -102,11 +101,11 @@ struct _virLockManagerParam { * Changes in minor version denote new compatible API entry points * Changes in micro version denote new compatible flags */ -# define VIR_LOCK_MANAGER_VERSION_MAJOR 1 -# define VIR_LOCK_MANAGER_VERSION_MINOR 0 -# define VIR_LOCK_MANAGER_VERSION_MICRO 0 +#define VIR_LOCK_MANAGER_VERSION_MAJOR 1 +#define VIR_LOCK_MANAGER_VERSION_MINOR 0 +#define VIR_LOCK_MANAGER_VERSION_MICRO 0 =20 -# define VIR_LOCK_MANAGER_VERSION \ +#define VIR_LOCK_MANAGER_VERSION \ ((VIR_LOCK_MANAGER_VERSION_MAJOR * 1000 * 1000) + \ (VIR_LOCK_MANAGER_VERSION_MINOR * 1000) + \ (VIR_LOCK_MANAGER_VERSION_MICRO)) @@ -314,6 +313,3 @@ struct _virLockDriver { virLockDriverRelease drvRelease; virLockDriverInquire drvInquire; }; - - -#endif /* LIBVIRT_LOCK_DRIVER_H */ diff --git a/src/locking/lock_driver_lockd.h b/src/locking/lock_driver_lock= d.h index d79d5e738a..b9eaab4831 100644 --- a/src/locking/lock_driver_lockd.h +++ b/src/locking/lock_driver_lockd.h @@ -19,12 +19,9 @@ * */ =20 -#ifndef LIBVIRT_LOCK_DRIVER_LOCKD_H -# define LIBVIRT_LOCK_DRIVER_LOCKD_H +#pragma once =20 enum virLockSpaceProtocolAcquireResourceFlags { VIR_LOCK_SPACE_PROTOCOL_ACQUIRE_RESOURCE_SHARED =3D (1 << 0), VIR_LOCK_SPACE_PROTOCOL_ACQUIRE_RESOURCE_AUTOCREATE =3D (1 << 1), }; - -#endif /* LIBVIRT_LOCK_DRIVER_LOCKD_H */ diff --git a/src/locking/lock_driver_nop.h b/src/locking/lock_driver_nop.h index 2443072e3d..e2525e0bd1 100644 --- a/src/locking/lock_driver_nop.h +++ b/src/locking/lock_driver_nop.h @@ -19,12 +19,8 @@ * */ =20 -#ifndef LIBVIRT_LOCK_DRIVER_NOP_H -# define LIBVIRT_LOCK_DRIVER_NOP_H +#pragma once =20 -# include "lock_driver.h" +#include "lock_driver.h" =20 extern virLockDriver virLockDriverNop; - - -#endif /* LIBVIRT_LOCK_DRIVER_NOP_H */ diff --git a/src/locking/lock_manager.h b/src/locking/lock_manager.h index 71d3909709..4a19f58879 100644 --- a/src/locking/lock_manager.h +++ b/src/locking/lock_manager.h @@ -19,11 +19,10 @@ * */ =20 -#ifndef LIBVIRT_LOCK_MANAGER_H -# define LIBVIRT_LOCK_MANAGER_H +#pragma once =20 -# include "internal.h" -# include "lock_driver.h" +#include "internal.h" +#include "lock_driver.h" =20 typedef struct _virLockManagerPlugin virLockManagerPlugin; typedef virLockManagerPlugin *virLockManagerPluginPtr; @@ -66,5 +65,3 @@ int virLockManagerInquire(virLockManagerPtr manager, unsigned int flags); =20 int virLockManagerFree(virLockManagerPtr manager); - -#endif /* LIBVIRT_LOCK_MANAGER_H */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560874471; cv=none; d=zoho.com; s=zohoarc; b=QuCbj2PLf9z7Bo+fhfipy9aBGxm8l6LzoTs7ilIOKAOPkOwHANLjhCdaxoaVZ5dy26qB9mj1byjjNdZMpP4UFwRx9AEeKQ1AAAYxMmoS8icGMpzXMh+3hehFqaya90IXPrXC38ggaURKywdu1hL6ndvXfw7R1cddV8bu+W7jo8M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560874471; 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=vnUb3NnsaVWydyN2uUx4y6w975RpPlG24htUUCO9c+Y=; b=kDHMvTD8XBWlH3QGiaDMv2YMi2Rwzq+mQBnq65yYw4JdX3Qe1vkA1Eqxu7wkLJdmKwzT4yma9K/w0YlbBaWh0OGRZJeakHsPTgugI4lHJ4KlMQJat4t2a2f2qM2m4gJmKW3VchYhZVpdS/Eq4gXWBPWeRRZONDmgfGpphPHrKS8= 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 1560874471334369.19659198463387; Tue, 18 Jun 2019 09:14:31 -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 EF6CA3082201; Tue, 18 Jun 2019 16:13:51 +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 7525952D1; Tue, 18 Jun 2019 16:13: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 241721806B1A; Tue, 18 Jun 2019 16:13:28 +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 x5IGDOUI024121 for ; Tue, 18 Jun 2019 12:13:24 -0400 Received: by smtp.corp.redhat.com (Postfix) id BA742851A; Tue, 18 Jun 2019 16:13:24 +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 7A72384EF for ; Tue, 18 Jun 2019 16:13:24 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:12:32 -0500 Message-Id: <20190618161316.1722-3-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 02/46] src/lxc: 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.47]); Tue, 18 Jun 2019 16:14:25 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/lxc/lxc_cgroup.h | 13 +++++------- src/lxc/lxc_conf.h | 47 +++++++++++++++++++---------------------- src/lxc/lxc_container.h | 37 +++++++++++++++----------------- src/lxc/lxc_domain.h | 13 +++++------- src/lxc/lxc_driver.h | 5 +---- src/lxc/lxc_fuse.h | 15 ++++++------- src/lxc/lxc_hostdev.h | 9 +++----- src/lxc/lxc_monitor.h | 11 ++++------ src/lxc/lxc_native.h | 11 ++++------ src/lxc/lxc_process.h | 7 ++---- 10 files changed, 69 insertions(+), 99 deletions(-) diff --git a/src/lxc/lxc_cgroup.h b/src/lxc/lxc_cgroup.h index 8b32ca1ede..63e9e837b0 100644 --- a/src/lxc/lxc_cgroup.h +++ b/src/lxc/lxc_cgroup.h @@ -19,13 +19,12 @@ * . */ =20 -#ifndef LIBVIRT_LXC_CGROUP_H -# define LIBVIRT_LXC_CGROUP_H +#pragma once =20 -# include "vircgroup.h" -# include "domain_conf.h" -# include "lxc_fuse.h" -# include "virusb.h" +#include "vircgroup.h" +#include "domain_conf.h" +#include "lxc_fuse.h" +#include "virusb.h" =20 virCgroupPtr virLXCCgroupCreate(virDomainDefPtr def, pid_t initpid, @@ -47,5 +46,3 @@ int virLXCTeardownHostUSBDeviceCgroup(virUSBDevicePtr dev, const char *path, void *opaque); - -#endif /* LIBVIRT_LXC_CGROUP_H */ diff --git a/src/lxc/lxc_conf.h b/src/lxc/lxc_conf.h index d6a1f1ca10..dc5531ebf9 100644 --- a/src/lxc/lxc_conf.h +++ b/src/lxc/lxc_conf.h @@ -19,29 +19,28 @@ * . */ =20 -#ifndef LIBVIRT_LXC_CONF_H -# define LIBVIRT_LXC_CONF_H - -# include "internal.h" -# include "libvirt_internal.h" -# include "domain_conf.h" -# include "domain_event.h" -# include "capabilities.h" -# include "virthread.h" -# include "security/security_manager.h" -# include "configmake.h" -# include "vircgroup.h" -# include "virsysinfo.h" -# include "virusb.h" -# include "virclosecallbacks.h" -# include "virhostdev.h" - -# define LXC_DRIVER_NAME "LXC" - -# define LXC_CONFIG_DIR SYSCONFDIR "/libvirt/lxc" -# define LXC_STATE_DIR LOCALSTATEDIR "/run/libvirt/lxc" -# define LXC_LOG_DIR LOCALSTATEDIR "/log/libvirt/lxc" -# define LXC_AUTOSTART_DIR LXC_CONFIG_DIR "/autostart" +#pragma once + +#include "internal.h" +#include "libvirt_internal.h" +#include "domain_conf.h" +#include "domain_event.h" +#include "capabilities.h" +#include "virthread.h" +#include "security/security_manager.h" +#include "configmake.h" +#include "vircgroup.h" +#include "virsysinfo.h" +#include "virusb.h" +#include "virclosecallbacks.h" +#include "virhostdev.h" + +#define LXC_DRIVER_NAME "LXC" + +#define LXC_CONFIG_DIR SYSCONFDIR "/libvirt/lxc" +#define LXC_STATE_DIR LOCALSTATEDIR "/run/libvirt/lxc" +#define LXC_LOG_DIR LOCALSTATEDIR "/log/libvirt/lxc" +#define LXC_AUTOSTART_DIR LXC_CONFIG_DIR "/autostart" =20 typedef struct _virLXCDriver virLXCDriver; typedef virLXCDriver *virLXCDriverPtr; @@ -120,5 +119,3 @@ static inline void lxcDriverUnlock(virLXCDriverPtr driv= er) { virMutexUnlock(&driver->lock); } - -#endif /* LIBVIRT_LXC_CONF_H */ diff --git a/src/lxc/lxc_container.h b/src/lxc/lxc_container.h index 240c79d5ac..94a6c5309c 100644 --- a/src/lxc/lxc_container.h +++ b/src/lxc/lxc_container.h @@ -18,29 +18,28 @@ * . */ =20 -#ifndef LIBVIRT_LXC_CONTAINER_H -# define LIBVIRT_LXC_CONTAINER_H +#pragma once =20 -# include "lxc_conf.h" -# include "lxc_domain.h" -# include "security/security_manager.h" +#include "lxc_conf.h" +#include "lxc_domain.h" +#include "security/security_manager.h" =20 -# define LXC_DEV_MAJ_MEMORY 1 -# define LXC_DEV_MIN_NULL 3 -# define LXC_DEV_MIN_ZERO 5 -# define LXC_DEV_MIN_FULL 7 -# define LXC_DEV_MIN_RANDOM 8 -# define LXC_DEV_MIN_URANDOM 9 +#define LXC_DEV_MAJ_MEMORY 1 +#define LXC_DEV_MIN_NULL 3 +#define LXC_DEV_MIN_ZERO 5 +#define LXC_DEV_MIN_FULL 7 +#define LXC_DEV_MIN_RANDOM 8 +#define LXC_DEV_MIN_URANDOM 9 =20 -# define LXC_DEV_MAJ_TTY 5 -# define LXC_DEV_MIN_TTY 0 -# define LXC_DEV_MIN_CONSOLE 1 -# define LXC_DEV_MIN_PTMX 2 +#define LXC_DEV_MAJ_TTY 5 +#define LXC_DEV_MIN_TTY 0 +#define LXC_DEV_MIN_CONSOLE 1 +#define LXC_DEV_MIN_PTMX 2 =20 -# define LXC_DEV_MAJ_PTY 136 +#define LXC_DEV_MAJ_PTY 136 =20 -# define LXC_DEV_MAJ_FUSE 10 -# define LXC_DEV_MIN_FUSE 229 +#define LXC_DEV_MAJ_FUSE 10 +#define LXC_DEV_MIN_FUSE 229 =20 int lxcContainerSendContinue(int control); int lxcContainerWaitForContinue(int control); @@ -64,5 +63,3 @@ virArch lxcContainerGetAlt32bitArch(virArch arch); int lxcContainerChown(virDomainDefPtr def, const char *path); =20 bool lxcIsBasicMountLocation(const char *path); - -#endif /* LIBVIRT_LXC_CONTAINER_H */ diff --git a/src/lxc/lxc_domain.h b/src/lxc/lxc_domain.h index 2048481829..92ed4ac594 100644 --- a/src/lxc/lxc_domain.h +++ b/src/lxc/lxc_domain.h @@ -19,13 +19,12 @@ * . */ =20 -#ifndef LIBVIRT_LXC_DOMAIN_H -# define LIBVIRT_LXC_DOMAIN_H +#pragma once =20 -# include "vircgroup.h" -# include "lxc_conf.h" -# include "lxc_monitor.h" -# include "virenum.h" +#include "vircgroup.h" +#include "lxc_conf.h" +#include "lxc_monitor.h" +#include "virenum.h" =20 =20 typedef enum { @@ -113,5 +112,3 @@ virLXCDomainGetMachineName(virDomainDefPtr def, pid_t p= id); int virLXCDomainSetRunlevel(virDomainObjPtr vm, int runlevel); - -#endif /* LIBVIRT_LXC_DOMAIN_H */ diff --git a/src/lxc/lxc_driver.h b/src/lxc/lxc_driver.h index 4af9bb966e..90549d02f2 100644 --- a/src/lxc/lxc_driver.h +++ b/src/lxc/lxc_driver.h @@ -18,10 +18,7 @@ * . */ =20 -#ifndef LIBVIRT_LXC_DRIVER_H -# define LIBVIRT_LXC_DRIVER_H +#pragma once =20 /* Function declarations */ int lxcRegister(void); - -#endif /* LIBVIRT_LXC_DRIVER_H */ diff --git a/src/lxc/lxc_fuse.h b/src/lxc/lxc_fuse.h index 95285ae915..e9cfd9a20a 100644 --- a/src/lxc/lxc_fuse.h +++ b/src/lxc/lxc_fuse.h @@ -18,16 +18,15 @@ * . */ =20 -#ifndef LIBVIRT_LXC_FUSE_H -# define LIBVIRT_LXC_FUSE_H +#pragma once =20 -# define FUSE_USE_VERSION 26 +#define FUSE_USE_VERSION 26 =20 -# if WITH_FUSE -# include -# endif +#if WITH_FUSE +# include +#endif =20 -# include "lxc_conf.h" +#include "lxc_conf.h" =20 struct virLXCMeminfo { unsigned long long memtotal; @@ -56,5 +55,3 @@ typedef struct virLXCFuse *virLXCFusePtr; int lxcSetupFuse(virLXCFusePtr *f, virDomainDefPtr def); int lxcStartFuse(virLXCFusePtr f); void lxcFreeFuse(virLXCFusePtr *f); - -#endif /* LIBVIRT_LXC_FUSE_H */ diff --git a/src/lxc/lxc_hostdev.h b/src/lxc/lxc_hostdev.h index 4fd8ce35d5..d2cdebddc8 100644 --- a/src/lxc/lxc_hostdev.h +++ b/src/lxc/lxc_hostdev.h @@ -19,11 +19,10 @@ * . */ =20 -#ifndef LIBVIRT_LXC_HOSTDEV_H -# define LIBVIRT_LXC_HOSTDEV_H +#pragma once =20 -# include "lxc_conf.h" -# include "domain_conf.h" +#include "lxc_conf.h" +#include "domain_conf.h" =20 int virLXCUpdateActiveUSBHostdevs(virLXCDriverPtr driver, virDomainDefPtr def); @@ -37,5 +36,3 @@ int virLXCPrepareHostDevices(virLXCDriverPtr driver, virDomainDefPtr def); void virLXCDomainReAttachHostDevices(virLXCDriverPtr driver, virDomainDefPtr def); - -#endif /* LIBVIRT_LXC_HOSTDEV_H */ diff --git a/src/lxc/lxc_monitor.h b/src/lxc/lxc_monitor.h index fa47db7254..6d0944c301 100644 --- a/src/lxc/lxc_monitor.h +++ b/src/lxc/lxc_monitor.h @@ -18,12 +18,11 @@ * . */ =20 -#ifndef LIBVIRT_LXC_MONITOR_H -# define LIBVIRT_LXC_MONITOR_H +#pragma once =20 -# include "virobject.h" -# include "domain_conf.h" -# include "lxc_monitor_protocol.h" +#include "virobject.h" +#include "domain_conf.h" +#include "lxc_monitor_protocol.h" =20 typedef struct _virLXCMonitor virLXCMonitor; typedef virLXCMonitor *virLXCMonitorPtr; @@ -59,5 +58,3 @@ void virLXCMonitorClose(virLXCMonitorPtr mon); =20 void virLXCMonitorLock(virLXCMonitorPtr mon); void virLXCMonitorUnlock(virLXCMonitorPtr mon); - -#endif /* LIBVIRT_LXC_MONITOR_H */ diff --git a/src/lxc/lxc_native.h b/src/lxc/lxc_native.h index 57725d3d2b..f16407f2e6 100644 --- a/src/lxc/lxc_native.h +++ b/src/lxc/lxc_native.h @@ -18,13 +18,12 @@ * . */ =20 -#ifndef LIBVIRT_LXC_NATIVE_H -# define LIBVIRT_LXC_NATIVE_H +#pragma once =20 -# include "domain_conf.h" -# include "virenum.h" +#include "domain_conf.h" +#include "virenum.h" =20 -# define LXC_CONFIG_FORMAT "lxc-tools" +#define LXC_CONFIG_FORMAT "lxc-tools" =20 typedef enum { VIR_LXC_NETWORK_CONFIG_NAME, @@ -46,5 +45,3 @@ VIR_ENUM_DECL(virLXCNetworkConfigEntry); virDomainDefPtr lxcParseConfigString(const char *config, virCapsPtr caps, virDomainXMLOptionPtr xmlopt); - -#endif /* LIBVIRT_LXC_NATIVE_H */ diff --git a/src/lxc/lxc_process.h b/src/lxc/lxc_process.h index 7489a3a420..1bf359b229 100644 --- a/src/lxc/lxc_process.h +++ b/src/lxc/lxc_process.h @@ -19,10 +19,9 @@ * . */ =20 -#ifndef LIBVIRT_LXC_PROCESS_H -# define LIBVIRT_LXC_PROCESS_H +#pragma once =20 -# include "lxc_conf.h" +#include "lxc_conf.h" =20 int virLXCProcessStart(virConnectPtr conn, virLXCDriverPtr driver, @@ -54,5 +53,3 @@ char *virLXCProcessSetupInterfaceTap(virDomainDefPtr vm, char *virLXCProcessSetupInterfaceDirect(virConnectPtr conn, virDomainDefPtr def, virDomainNetDefPtr net); - -#endif /* LIBVIRT_LXC_PROCESS_H */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560874463; cv=none; d=zoho.com; s=zohoarc; b=KGWScL6URUtTc0/rys0jeOsWqxzA8autPEEh2eomjnAGwrJSjK50DEqOtZ+n3tgNSd71Q+ehVIwYRbs3HgB0UIq3yDiHPEz4GEwYgp10ZcX+KPQRvW4BcSYAs7U6hN/Rrs710ZteIoiRNB+I9pAxGgW5H52rnvzozW/mwtcwuN4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560874463; 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=nGvO3doMJIq9VnH1MIBFgy3vlRJOiiuAMjmi3RNfr98=; b=G1tsrwHnDOEPdllxmO6Rfcf1QgvHq3p0gBG+WqPNJFerANyT4zLgA3CNOW2r/8zgq+cUBEhib6Q9J9wV8rRmixDFJo1iOrcMsQCRFRn6aWHjcZdvW+e9WDGabZvqJa3tjoqTXo6/mkblzu6dHEVEVo2qlo6p5VGacF0NUGbUMfM= 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 1560874463416195.28925391150813; Tue, 18 Jun 2019 09:14:23 -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 8AC0F30C1AE6; Tue, 18 Jun 2019 16:13:52 +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 1340657AF; Tue, 18 Jun 2019 16:13:39 +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 15B8E1806B19; Tue, 18 Jun 2019 16:13:28 +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 x5IGDPFO024126 for ; Tue, 18 Jun 2019 12:13:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id 176B784EF; Tue, 18 Jun 2019 16:13:25 +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 D9FDB60FAB for ; Tue, 18 Jun 2019 16:13:24 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:12:33 -0500 Message-Id: <20190618161316.1722-4-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 03/46] src/network: 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.40]); Tue, 18 Jun 2019 16:14:12 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/network/bridge_driver.h | 15 ++++++--------- src/network/bridge_driver_platform.h | 15 ++++++--------- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/src/network/bridge_driver.h b/src/network/bridge_driver.h index 44c79f555e..7357c1754c 100644 --- a/src/network/bridge_driver.h +++ b/src/network/bridge_driver.h @@ -19,14 +19,13 @@ * . */ =20 -#ifndef LIBVIRT_BRIDGE_DRIVER_H -# define LIBVIRT_BRIDGE_DRIVER_H +#pragma once =20 -# include "internal.h" -# include "domain_conf.h" -# include "vircommand.h" -# include "virdnsmasq.h" -# include "virnetworkobj.h" +#include "internal.h" +#include "domain_conf.h" +#include "vircommand.h" +#include "virdnsmasq.h" +#include "virnetworkobj.h" =20 int networkRegister(void); @@ -37,5 +36,3 @@ networkDnsmasqConfContents(virNetworkObjPtr obj, char **configstr, dnsmasqContext *dctx, dnsmasqCapsPtr caps); - -#endif /* LIBVIRT_BRIDGE_DRIVER_H */ diff --git a/src/network/bridge_driver_platform.h b/src/network/bridge_driv= er_platform.h index 5f534fc132..1efa0d2af4 100644 --- a/src/network/bridge_driver_platform.h +++ b/src/network/bridge_driver_platform.h @@ -19,14 +19,13 @@ * . */ =20 -#ifndef LIBVIRT_BRIDGE_DRIVER_PLATFORM_H -# define LIBVIRT_BRIDGE_DRIVER_PLATFORM_H +#pragma once =20 -# include "internal.h" -# include "virthread.h" -# include "virdnsmasq.h" -# include "virnetworkobj.h" -# include "object_event.h" +#include "internal.h" +#include "virthread.h" +#include "virdnsmasq.h" +#include "virnetworkobj.h" +#include "object_event.h" =20 /* Main driver state */ struct _virNetworkDriverState { @@ -66,5 +65,3 @@ int networkCheckRouteCollision(virNetworkDefPtr def); int networkAddFirewallRules(virNetworkDefPtr def); =20 void networkRemoveFirewallRules(virNetworkDefPtr def); - -#endif /* LIBVIRT_BRIDGE_DRIVER_PLATFORM_H */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560874494; cv=none; d=zoho.com; s=zohoarc; b=TzOJ84Q6QwaYCbRdrkQhSAQsTI03PcM3m6/t0fjfqF1zc9bPr/njufmA3CAu6nOgosDJf5sJcunqCP4DLgzbu9I6YFmI4mIYkdEM8LSIw6kub91zH3OlzS9ZsulTX97vdzAc57xTUa+cJ0xUFV+C9dsgqppN3+haw6k+1bosH10= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560874494; 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=f+SKHO3JVacDLkj30Hn155F/Defkv5OyY5e3FaSrI0o=; b=d/DIK3SisXt/4Ez9O6TSTTsU37sII8OYSNDv0IbeBUeltMtHEkS24zezYPd9NVWN5cSvb0cO9QSRs6MTyZx4V1wNLq0YoLaIQAqkHv8kAv/txreqdHmylnnTWH0Xp6j7GltlSdoZgm8GWiF9APV1BpyilG73xoJGnpqcPqwbEG4= 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 156087449430758.79969455348589; Tue, 18 Jun 2019 09:14:54 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id D93297FDE9; Tue, 18 Jun 2019 16:14: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 A71EA608C2; Tue, 18 Jun 2019 16:14:43 +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 32AAC8E1F; Tue, 18 Jun 2019 16:14:37 +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 x5IGDPIo024134 for ; Tue, 18 Jun 2019 12:13:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6699860FAB; Tue, 18 Jun 2019 16:13:25 +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 3592F84EF for ; Tue, 18 Jun 2019 16:13:25 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:12:34 -0500 Message-Id: <20190618161316.1722-5-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 04/46] src/nwfilter: 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.79 on 10.5.11.13 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:14:53 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/nwfilter/nwfilter_dhcpsnoop.h | 6 ++---- src/nwfilter/nwfilter_driver.h | 9 +++------ src/nwfilter/nwfilter_ebiptables_driver.h | 13 +++++-------- src/nwfilter/nwfilter_gentech_driver.h | 11 ++++------- src/nwfilter/nwfilter_learnipaddr.h | 13 +++++-------- src/nwfilter/nwfilter_tech_driver.h | 7 ++----- 6 files changed, 21 insertions(+), 38 deletions(-) diff --git a/src/nwfilter/nwfilter_dhcpsnoop.h b/src/nwfilter/nwfilter_dhcp= snoop.h index 38606bdd41..2b9a87fb79 100644 --- a/src/nwfilter/nwfilter_dhcpsnoop.h +++ b/src/nwfilter/nwfilter_dhcpsnoop.h @@ -20,10 +20,9 @@ * . */ =20 -#ifndef LIBVIRT_NWFILTER_DHCPSNOOP_H -# define LIBVIRT_NWFILTER_DHCPSNOOP_H +#pragma once =20 -# include "nwfilter_tech_driver.h" +#include "nwfilter_tech_driver.h" =20 int virNWFilterDHCPSnoopInit(void); void virNWFilterDHCPSnoopShutdown(void); @@ -31,4 +30,3 @@ int virNWFilterDHCPSnoopReq(virNWFilterTechDriverPtr tech= driver, virNWFilterBindingDefPtr binding, virNWFilterDriverStatePtr driver); void virNWFilterDHCPSnoopEnd(const char *ifname); -#endif /* LIBVIRT_NWFILTER_DHCPSNOOP_H */ diff --git a/src/nwfilter/nwfilter_driver.h b/src/nwfilter/nwfilter_driver.h index c315a40649..6c864dd2e3 100644 --- a/src/nwfilter/nwfilter_driver.h +++ b/src/nwfilter/nwfilter_driver.h @@ -22,12 +22,9 @@ * . */ =20 -#ifndef LIBVIRT_NWFILTER_DRIVER_H -# define LIBVIRT_NWFILTER_DRIVER_H +#pragma once =20 -# include "nwfilter_params.h" -# include "nwfilter_conf.h" +#include "nwfilter_params.h" +#include "nwfilter_conf.h" =20 int nwfilterRegister(void); - -#endif /* LIBVIRT_NWFILTER_DRIVER_H */ diff --git a/src/nwfilter/nwfilter_ebiptables_driver.h b/src/nwfilter/nwfil= ter_ebiptables_driver.h index f740856496..cb146f9f97 100644 --- a/src/nwfilter/nwfilter_ebiptables_driver.h +++ b/src/nwfilter/nwfilter_ebiptables_driver.h @@ -19,17 +19,14 @@ * . */ =20 -#ifndef LIBVIRT_NWFILTER_EBIPTABLES_DRIVER_H -# define LIBVIRT_NWFILTER_EBIPTABLES_DRIVER_H +#pragma once =20 -# include "nwfilter_tech_driver.h" +#include "nwfilter_tech_driver.h" =20 -# define MAX_CHAINNAME_LENGTH 32 /* see linux/netfilter_bridge/ebtables.h= */ +#define MAX_CHAINNAME_LENGTH 32 /* see linux/netfilter_bridge/ebtables.h = */ =20 extern virNWFilterTechDriver ebiptables_driver; =20 -# define EBIPTABLES_DRIVER_ID "ebiptables" +#define EBIPTABLES_DRIVER_ID "ebiptables" =20 -# define IPTABLES_MAX_COMMENT_LENGTH 256 - -#endif /* LIBVIRT_NWFILTER_EBIPTABLES_DRIVER_H */ +#define IPTABLES_MAX_COMMENT_LENGTH 256 diff --git a/src/nwfilter/nwfilter_gentech_driver.h b/src/nwfilter/nwfilter= _gentech_driver.h index 945060cd22..cf0560a10a 100644 --- a/src/nwfilter/nwfilter_gentech_driver.h +++ b/src/nwfilter/nwfilter_gentech_driver.h @@ -20,12 +20,11 @@ * . */ =20 -#ifndef LIBVIRT_NWFILTER_GENTECH_DRIVER_H -# define LIBVIRT_NWFILTER_GENTECH_DRIVER_H +#pragma once =20 -# include "virnwfilterobj.h" -# include "virnwfilterbindingdef.h" -# include "nwfilter_tech_driver.h" +#include "virnwfilterobj.h" +#include "virnwfilterbindingdef.h" +#include "nwfilter_tech_driver.h" =20 virNWFilterTechDriverPtr virNWFilterTechDriverForName(const char *name); =20 @@ -55,5 +54,3 @@ virHashTablePtr virNWFilterCreateVarHashmap(const char *m= acaddr, =20 int virNWFilterBuildAll(virNWFilterDriverStatePtr driver, bool newFilters); - -#endif /* LIBVIRT_NWFILTER_GENTECH_DRIVER_H */ diff --git a/src/nwfilter/nwfilter_learnipaddr.h b/src/nwfilter/nwfilter_le= arnipaddr.h index 117d69f4d4..5b9294327f 100644 --- a/src/nwfilter/nwfilter_learnipaddr.h +++ b/src/nwfilter/nwfilter_learnipaddr.h @@ -21,13 +21,12 @@ * . */ =20 -#ifndef LIBVIRT_NWFILTER_LEARNIPADDR_H -# define LIBVIRT_NWFILTER_LEARNIPADDR_H +#pragma once =20 -# include "conf/nwfilter_params.h" -# include "nwfilter_tech_driver.h" -# include "virnwfilterbindingdef.h" -# include +#include "conf/nwfilter_params.h" +#include "nwfilter_tech_driver.h" +#include "virnwfilterbindingdef.h" +#include =20 enum howDetect { DETECT_DHCP =3D 1, @@ -49,5 +48,3 @@ void virNWFilterUnlockIface(const char *ifname); int virNWFilterLearnInit(void); void virNWFilterLearnShutdown(void); void virNWFilterLearnThreadsTerminate(bool allowNewThreads); - -#endif /* LIBVIRT_NWFILTER_LEARNIPADDR_H */ diff --git a/src/nwfilter/nwfilter_tech_driver.h b/src/nwfilter/nwfilter_te= ch_driver.h index f37a0e7d5c..9e1e9332f9 100644 --- a/src/nwfilter/nwfilter_tech_driver.h +++ b/src/nwfilter/nwfilter_tech_driver.h @@ -21,10 +21,9 @@ * . */ =20 -#ifndef LIBVIRT_NWFILTER_TECH_DRIVER_H -# define LIBVIRT_NWFILTER_TECH_DRIVER_H +#pragma once =20 -# include "virnwfilterobj.h" +#include "virnwfilterobj.h" =20 typedef struct _virNWFilterTechDriver virNWFilterTechDriver; typedef virNWFilterTechDriver *virNWFilterTechDriverPtr; @@ -90,5 +89,3 @@ struct _virNWFilterTechDriver { virNWFilterDropAllRules applyDropAllRules; virNWFilterRemoveBasicRules removeBasicRules; }; - -#endif /* LIBVIRT_NWFILTER_TECH_DRIVER_H */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560874505; cv=none; d=zoho.com; s=zohoarc; b=FgcO/vT4soZltFQ95uzRg+pSIsVBGQXqPtmm46JtOHRZxJwz7LnkEvdqmZho49jV6wgG5mz5PrOtDU7QN4eif5l33tv6mP+7OVQah7H14OaP9RocHUG97PXTmrsRqD/pkfrvxd+lJYf/QFPVSCK5GgyvBDWRj+07mbmmE7lRMd8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560874505; 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=VShoJdLWv/ZZ2+uyoskangoY4It1lndyikJDYMnQQ2U=; b=bhLxvb0Nc29m8gwYmnWtZ1uS+4pWPynUnwTC+YUev+f0qJ64gRUXH1a5yLP2KxHujTF5K7AQVC3e43DuXTg3L9BO0qNvPJ+T3+QxO5Mp9tixvZrUU6Z6ntxRvv7AkHG91GeP9+wFE2YR4G+011Mr4c6cQ+IK9sGhR6AMNPbdXYE= 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 1560874505879468.7167720165713; Tue, 18 Jun 2019 09:15:05 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 766BE3086229; Tue, 18 Jun 2019 16:14:49 +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 789737D65A; Tue, 18 Jun 2019 16:14:46 +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 9D32D1806B1C; Tue, 18 Jun 2019 16:14:40 +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 x5IGDPJW024139 for ; Tue, 18 Jun 2019 12:13:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id B7CE684EF; Tue, 18 Jun 2019 16:13:25 +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 8561360FAB for ; Tue, 18 Jun 2019 16:13:25 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:12:35 -0500 Message-Id: <20190618161316.1722-6-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 05/46] src/openvz: 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.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Tue, 18 Jun 2019 16:14:57 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/openvz/openvz_conf.h | 21 +++++++++------------ src/openvz/openvz_driver.h | 11 ++++------- src/openvz/openvz_util.h | 5 +---- 3 files changed, 14 insertions(+), 23 deletions(-) diff --git a/src/openvz/openvz_conf.h b/src/openvz/openvz_conf.h index 05ccd6f927..cd42d697ce 100644 --- a/src/openvz/openvz_conf.h +++ b/src/openvz/openvz_conf.h @@ -21,21 +21,20 @@ * . */ =20 -#ifndef LIBVIRT_OPENVZ_CONF_H -# define LIBVIRT_OPENVZ_CONF_H +#pragma once =20 -# include "internal.h" -# include "virdomainobjlist.h" -# include "virthread.h" +#include "internal.h" +#include "virdomainobjlist.h" +#include "virthread.h" =20 =20 /* OpenVZ commands - Replace with wrapper scripts later? */ -# define VZLIST "/usr/sbin/vzlist" -# define VZCTL "/usr/sbin/vzctl" -# define VZMIGRATE "/usr/sbin/vzmigrate" -# define VZ_CONF_FILE "/etc/vz/vz.conf" +#define VZLIST "/usr/sbin/vzlist" +#define VZCTL "/usr/sbin/vzctl" +#define VZMIGRATE "/usr/sbin/vzmigrate" +#define VZ_CONF_FILE "/etc/vz/vz.conf" =20 -# define VZCTL_BRIDGE_MIN_VERSION ((3 * 1000 * 1000) + (0 * 1000) + 22 + 1) +#define VZCTL_BRIDGE_MIN_VERSION ((3 * 1000 * 1000) + (0 * 1000) + 22 + 1) =20 struct openvz_driver { virMutex lock; @@ -64,5 +63,3 @@ int strtoI(const char *str); int openvzSetDefinedUUID(int vpsid, unsigned char *uuid); int openvzGetVEID(const char *name); int openvzReadNetworkConf(virDomainDefPtr def, int veid); - -#endif /* LIBVIRT_OPENVZ_CONF_H */ diff --git a/src/openvz/openvz_driver.h b/src/openvz/openvz_driver.h index dd2cfd900e..1570fd82ac 100644 --- a/src/openvz/openvz_driver.h +++ b/src/openvz/openvz_driver.h @@ -20,21 +20,18 @@ * . */ =20 -#ifndef LIBVIRT_OPENVZ_DRIVER_H -# define LIBVIRT_OPENVZ_DRIVER_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 -# define OPENVZ_MIGRATION_FLAGS \ +#define OPENVZ_MIGRATION_FLAGS \ (VIR_MIGRATE_LIVE) =20 /* All supported migration parameters and their types. */ -# define OPENVZ_MIGRATION_PARAMETERS \ +#define OPENVZ_MIGRATION_PARAMETERS \ VIR_MIGRATE_PARAM_URI, VIR_TYPED_PARAM_STRING, \ VIR_MIGRATE_PARAM_DEST_NAME, VIR_TYPED_PARAM_STRING, \ VIR_MIGRATE_PARAM_DEST_XML, VIR_TYPED_PARAM_STRING, \ NULL =20 int openvzRegister(void); - -#endif /* LIBVIRT_OPENVZ_DRIVER_H */ diff --git a/src/openvz/openvz_util.h b/src/openvz/openvz_util.h index bc3247119a..a1f046c5d2 100644 --- a/src/openvz/openvz_util.h +++ b/src/openvz/openvz_util.h @@ -19,10 +19,7 @@ * */ =20 -#ifndef LIBVIRT_OPENVZ_UTIL_H -# define LIBVIRT_OPENVZ_UTIL_H +#pragma once =20 long openvzKBPerPages(void); char *openvzVEGetStringParam(virDomainPtr dom, const char *param); - -#endif /* LIBVIRT_OPENVZ_UTIL_H */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560874514; cv=none; d=zoho.com; s=zohoarc; b=D9D/O6IqrkelYEPzJApFEttHx7papFByH+rHJhEqcLXa7bxSI6cC/VFuknpQr2QGEhQF92xwvjYW3RbrF3/VKMSNnKPsl7b/MPjsbPqFfkAyuO8/6W0xq4SsVBMkPYK5trG0203fAKPz8qc7N9lwVUXWg3bvvFdKmSuMA1Xowjo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560874514; 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=r4ydpwKLWQk7bQN194uj8DdMrV5x+Env38SEfLUoFQA=; b=E1Ex2p0OHc25fnQwnL57EK4UTNkP2Mr3EV1W46XTLNFOMo4s1HD8Nj6N7/hTOt8G886AaVrSCfotj0721Q26qKsErx329uYG7EZWR3NYIqGuKo4uxQ3bmNVku3g8yeT1mM91ry9Q3qHvG5HLr9wA26uqfF7zHtyg908VBVXoEIs= 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 1560874514861554.867901006727; Tue, 18 Jun 2019 09:15:14 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 2ACB97FDFE; Tue, 18 Jun 2019 16:15:07 +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 E14BB5C22C; Tue, 18 Jun 2019 16:15:06 +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 554671806B1E; Tue, 18 Jun 2019 16:15:03 +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 x5IGDQKT024149 for ; Tue, 18 Jun 2019 12:13:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id 129BA60FAB; Tue, 18 Jun 2019 16:13:26 +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 D5AC99F52 for ; Tue, 18 Jun 2019 16:13:25 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:12:36 -0500 Message-Id: <20190618161316.1722-7-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 06/46] src/phyp: 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.79 on 10.5.11.16 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:15:13 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/phyp/phyp_driver.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/phyp/phyp_driver.h b/src/phyp/phyp_driver.h index 52a5d2bd17..d7076e3697 100644 --- a/src/phyp/phyp_driver.h +++ b/src/phyp/phyp_driver.h @@ -19,9 +19,6 @@ * . */ =20 -#ifndef LIBVIRT_PHYP_DRIVER_H -# define LIBVIRT_PHYP_DRIVER_H +#pragma once =20 int phypRegister(void); - -#endif /* LIBVIRT_PHYP_DRIVER_H */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560876066; cv=none; d=zoho.com; s=zohoarc; b=g5Bedgul0wF/w3PSNe1ajvhNnWHpvBWRCAfjapDnV4GFuJhnlVuTxTNVVmjM9jgm43lXzvtXLVZCiMXG1CzgTnhMD5ZFBEhbsDDABISSjj9VY5CuvJpTJJ9nZ9oV3vEBAH7LH1aCwfeAzQeXRWY7uZHvBMZ9r/+YrtRd+ppLqqU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560876066; 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=Ca5rU1aCbbwa1jpddAvNvJ8RgJbDYV5uVHJz+linfFs=; b=H0Bbn6FNjn5UiPoftS7krktic/GGXKOHL+LJpWe8lS7hWooORs6q0VeAnQ1Zig8cP0MkynqGPuYdKC01t3gZk2TSmspi4LeJd2FpsRYX0lhgA4Rm895rLxPFBTZxhC0l2MHneI8j1ZVUjgUGl1zzNjt0fhStagRznYJRBFIUUTk= 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 1560876066880229.99260340239437; Tue, 18 Jun 2019 09:41:06 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 1CA3D356CA; Tue, 18 Jun 2019 16:41:00 +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 E0D4160922; Tue, 18 Jun 2019 16:40:58 +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 837FB1806B1B; Tue, 18 Jun 2019 16:40:57 +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 x5IGDQJY024156 for ; Tue, 18 Jun 2019 12:13:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7E5EB84EF; Tue, 18 Jun 2019 16:13:26 +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 3438E60FAB for ; Tue, 18 Jun 2019 16:13:26 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:12:37 -0500 Message-Id: <20190618161316.1722-8-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 07/46] src/qemu: 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.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 18 Jun 2019 16:41:05 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_agent.h | 8 ++- src/qemu/qemu_alias.h | 13 ++--- src/qemu/qemu_block.h | 17 +++--- src/qemu/qemu_blockjob.h | 9 ++-- src/qemu/qemu_capabilities.h | 23 ++++---- src/qemu/qemu_capspriv.h | 5 +- src/qemu/qemu_cgroup.h | 12 ++--- src/qemu/qemu_command.h | 35 ++++++------ src/qemu/qemu_conf.h | 78 +++++++++++++-------------- src/qemu/qemu_domain.h | 81 ++++++++++++++-------------- src/qemu/qemu_domain_address.h | 13 ++--- src/qemu/qemu_driver.h | 5 +- src/qemu/qemu_extdevice.h | 9 ++-- src/qemu/qemu_firmware.h | 13 ++--- src/qemu/qemu_hostdev.h | 9 ++-- src/qemu/qemu_hotplug.h | 11 ++-- src/qemu/qemu_hotplugpriv.h | 5 +- src/qemu/qemu_interface.h | 10 ++-- src/qemu/qemu_migration.h | 17 +++--- src/qemu/qemu_migration_cookie.h | 9 ++-- src/qemu/qemu_migration_params.h | 19 +++---- src/qemu/qemu_migration_paramspriv.h | 5 +- src/qemu/qemu_monitor.h | 27 +++++----- src/qemu/qemu_monitor_json.h | 15 +++--- src/qemu/qemu_monitor_priv.h | 7 +-- src/qemu/qemu_monitor_text.h | 9 ++-- src/qemu/qemu_parse_command.h | 9 ++-- src/qemu/qemu_process.h | 11 ++-- src/qemu/qemu_processpriv.h | 9 ++-- src/qemu/qemu_qapi.h | 12 ++--- src/qemu/qemu_security.h | 58 ++++++++++---------- src/qemu/qemu_tpm.h | 7 +-- 32 files changed, 238 insertions(+), 332 deletions(-) diff --git a/src/qemu/qemu_agent.h b/src/qemu/qemu_agent.h index 24457f84d7..6ae9fe54da 100644 --- a/src/qemu/qemu_agent.h +++ b/src/qemu/qemu_agent.h @@ -19,11 +19,10 @@ * . */ =20 -#ifndef LIBVIRT_QEMU_AGENT_H -# define LIBVIRT_QEMU_AGENT_H +#pragma once =20 -# include "internal.h" -# include "domain_conf.h" +#include "internal.h" +#include "domain_conf.h" =20 typedef struct _qemuAgent qemuAgent; typedef qemuAgent *qemuAgentPtr; @@ -121,4 +120,3 @@ int qemuAgentSetUserPassword(qemuAgentPtr mon, const char *user, const char *password, bool crypted); -#endif /* LIBVIRT_QEMU_AGENT_H */ diff --git a/src/qemu/qemu_alias.h b/src/qemu/qemu_alias.h index aaf81e89ad..aaac09a1d1 100644 --- a/src/qemu/qemu_alias.h +++ b/src/qemu/qemu_alias.h @@ -19,14 +19,13 @@ * . */ =20 -#ifndef LIBVIRT_QEMU_ALIAS_H -# define LIBVIRT_QEMU_ALIAS_H +#pragma once =20 -# include "domain_conf.h" +#include "domain_conf.h" =20 -# include "qemu_capabilities.h" -# include "qemu_domain.h" -# include "qemu_domain_address.h" +#include "qemu_capabilities.h" +#include "qemu_domain.h" +#include "qemu_domain_address.h" =20 int qemuAssignDeviceChrAlias(virDomainDefPtr def, virDomainChrDefPtr chr, @@ -96,5 +95,3 @@ char *qemuAliasChardevFromDevAlias(const char *devAlias) const char *qemuDomainGetManagedPRAlias(void); =20 char *qemuDomainGetUnmanagedPRAlias(const char *parentalias); - -#endif /* LIBVIRT_QEMU_ALIAS_H */ diff --git a/src/qemu/qemu_block.h b/src/qemu/qemu_block.h index eab8da8e2c..e41b9a1df2 100644 --- a/src/qemu/qemu_block.h +++ b/src/qemu/qemu_block.h @@ -16,17 +16,16 @@ * . */ =20 -#ifndef LIBVIRT_QEMU_BLOCK_H -# define LIBVIRT_QEMU_BLOCK_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 -# include "qemu_conf.h" -# include "qemu_domain.h" +#include "qemu_conf.h" +#include "qemu_domain.h" =20 -# include "virhash.h" -# include "virjson.h" -# include "viruri.h" +#include "virhash.h" +#include "virjson.h" +#include "viruri.h" =20 typedef struct qemuBlockNodeNameBackingChainData qemuBlockNodeNameBackingC= hainData; typedef qemuBlockNodeNameBackingChainData *qemuBlockNodeNameBackingChainDa= taPtr; @@ -127,5 +126,3 @@ qemuBlockSnapshotAddLegacy(virJSONValuePtr actions, virDomainDiskDefPtr disk, virStorageSourcePtr newsrc, bool reuse); - -#endif /* LIBVIRT_QEMU_BLOCK_H */ diff --git a/src/qemu/qemu_blockjob.h b/src/qemu/qemu_blockjob.h index 772cc5cba1..da529090ad 100644 --- a/src/qemu/qemu_blockjob.h +++ b/src/qemu/qemu_blockjob.h @@ -19,11 +19,10 @@ * . */ =20 -#ifndef LIBVIRT_QEMU_BLOCKJOB_H -# define LIBVIRT_QEMU_BLOCKJOB_H +#pragma once =20 -# include "internal.h" -# include "qemu_conf.h" +#include "internal.h" +#include "qemu_conf.h" =20 /** * This enum has to map all known block job states from enum virDomainBloc= kJobType @@ -113,5 +112,3 @@ void qemuBlockJobSyncEnd(virDomainObjPtr vm, qemuBlockJobDataPtr qemuBlockJobGetByDisk(virDomainDiskDefPtr disk) ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; - -#endif /* LIBVIRT_QEMU_BLOCKJOB_H */ diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 3032d4edcd..24f10d567e 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -19,17 +19,16 @@ * . */ =20 -#ifndef LIBVIRT_QEMU_CAPABILITIES_H -# define LIBVIRT_QEMU_CAPABILITIES_H - -# include "virobject.h" -# include "capabilities.h" -# include "vircommand.h" -# include "qemu_monitor.h" -# include "domain_capabilities.h" -# include "virfirmware.h" -# include "virfilecache.h" -# include "virenum.h" +#pragma once + +#include "virobject.h" +#include "capabilities.h" +#include "vircommand.h" +#include "qemu_monitor.h" +#include "domain_capabilities.h" +#include "virfirmware.h" +#include "virfilecache.h" +#include "virenum.h" =20 /* * Internal flags to keep track of qemu command line capabilities @@ -651,5 +650,3 @@ virQEMUCapsGetSEVCapabilities(virQEMUCapsPtr qemuCaps); =20 virArch virQEMUCapsArchFromString(const char *arch); const char *virQEMUCapsArchToString(virArch arch); - -#endif /* LIBVIRT_QEMU_CAPABILITIES_H */ diff --git a/src/qemu/qemu_capspriv.h b/src/qemu/qemu_capspriv.h index 3c129cbf6c..ea847494cf 100644 --- a/src/qemu/qemu_capspriv.h +++ b/src/qemu/qemu_capspriv.h @@ -23,8 +23,7 @@ # error "qemu_capspriv.h may only be included by qemu_capabilities.c or te= st suites" #endif /* LIBVIRT_QEMU_CAPSPRIV_H_ALLOW */ =20 -#ifndef LIBVIRT_QEMU_CAPSPRIV_H -# define LIBVIRT_QEMU_CAPSPRIV_H +#pragma once =20 virQEMUCapsPtr virQEMUCapsNewCopy(virQEMUCapsPtr qemuCaps); =20 @@ -105,5 +104,3 @@ virQEMUCapsSetMicrocodeVersion(virQEMUCapsPtr qemuCaps, =20 void virQEMUCapsStripMachineAliases(virQEMUCapsPtr qemuCaps); - -#endif /* LIBVIRT_QEMU_CAPSPRIV_H */ diff --git a/src/qemu/qemu_cgroup.h b/src/qemu/qemu_cgroup.h index 88ad4a38b6..91d0877947 100644 --- a/src/qemu/qemu_cgroup.h +++ b/src/qemu/qemu_cgroup.h @@ -19,13 +19,12 @@ * . */ =20 -#ifndef LIBVIRT_QEMU_CGROUP_H -# define LIBVIRT_QEMU_CGROUP_H +#pragma once =20 -# include "virusb.h" -# include "vircgroup.h" -# include "domain_conf.h" -# include "qemu_conf.h" +#include "virusb.h" +#include "vircgroup.h" +#include "domain_conf.h" +#include "qemu_conf.h" =20 int qemuSetupImageCgroup(virDomainObjPtr vm, virStorageSourcePtr src); @@ -82,4 +81,3 @@ int qemuCgroupEmulatorAllNodesAllow(virCgroupPtr cgroup, void qemuCgroupEmulatorAllNodesRestore(qemuCgroupEmulatorAllNodesDataPtr d= ata); =20 extern const char *const defaultDeviceACL[]; -#endif /* LIBVIRT_QEMU_CGROUP_H */ diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h index 9565a7a377..c885d61578 100644 --- a/src/qemu/qemu_command.h +++ b/src/qemu/qemu_command.h @@ -19,27 +19,26 @@ * . */ =20 -#ifndef LIBVIRT_QEMU_COMMAND_H -# define LIBVIRT_QEMU_COMMAND_H - -# include "domain_addr.h" -# include "domain_conf.h" -# include "vircommand.h" -# include "virenum.h" -# include "capabilities.h" -# include "qemu_block.h" -# include "qemu_conf.h" -# include "qemu_domain.h" -# include "qemu_domain_address.h" -# include "qemu_capabilities.h" -# include "logging/log_manager.h" +#pragma once + +#include "domain_addr.h" +#include "domain_conf.h" +#include "vircommand.h" +#include "virenum.h" +#include "capabilities.h" +#include "qemu_block.h" +#include "qemu_conf.h" +#include "qemu_domain.h" +#include "qemu_domain_address.h" +#include "qemu_capabilities.h" +#include "logging/log_manager.h" =20 /* Config type for XML import/export conversions */ -# define QEMU_CONFIG_FORMAT_ARGV "qemu-argv" +#define QEMU_CONFIG_FORMAT_ARGV "qemu-argv" =20 -# define QEMU_FSDEV_HOST_PREFIX "fsdev-" +#define QEMU_FSDEV_HOST_PREFIX "fsdev-" =20 -# define QEMU_BLOCK_IOTUNE_MAX 1000000000000000LL +#define QEMU_BLOCK_IOTUNE_MAX 1000000000000000LL =20 VIR_ENUM_DECL(qemuVideo); =20 @@ -227,5 +226,3 @@ qemuBuildTPMOpenBackendFDs(const char *tpmdev, int *cancelfd) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4); - -#endif /* LIBVIRT_QEMU_COMMAND_H */ diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h index 983e74a3cf..d9e24a2372 100644 --- a/src/qemu/qemu_conf.h +++ b/src/qemu/qemu_conf.h @@ -19,45 +19,44 @@ * . */ =20 -#ifndef LIBVIRT_QEMU_CONF_H -# define LIBVIRT_QEMU_CONF_H - -# include - -# include "virebtables.h" -# include "internal.h" -# include "capabilities.h" -# include "network_conf.h" -# include "domain_conf.h" -# include "snapshot_conf.h" -# include "domain_event.h" -# include "virthread.h" -# include "security/security_manager.h" -# include "virpci.h" -# include "virusb.h" -# include "virscsi.h" -# include "cpu_conf.h" -# include "driver.h" -# include "virportallocator.h" -# include "vircommand.h" -# include "virthreadpool.h" -# include "locking/lock_manager.h" -# include "qemu_capabilities.h" -# include "virclosecallbacks.h" -# include "virhostdev.h" -# include "virfile.h" -# include "virfilecache.h" -# include "virfirmware.h" - -# ifdef CPU_SETSIZE /* Linux */ -# define QEMUD_CPUMASK_LEN CPU_SETSIZE -# elif defined(_SC_NPROCESSORS_CONF) /* Cygwin */ -# define QEMUD_CPUMASK_LEN (sysconf(_SC_NPROCESSORS_CONF)) -# else -# error "Port me" -# endif - -# define QEMU_DRIVER_NAME "QEMU" +#pragma once + +#include + +#include "virebtables.h" +#include "internal.h" +#include "capabilities.h" +#include "network_conf.h" +#include "domain_conf.h" +#include "snapshot_conf.h" +#include "domain_event.h" +#include "virthread.h" +#include "security/security_manager.h" +#include "virpci.h" +#include "virusb.h" +#include "virscsi.h" +#include "cpu_conf.h" +#include "driver.h" +#include "virportallocator.h" +#include "vircommand.h" +#include "virthreadpool.h" +#include "locking/lock_manager.h" +#include "qemu_capabilities.h" +#include "virclosecallbacks.h" +#include "virhostdev.h" +#include "virfile.h" +#include "virfilecache.h" +#include "virfirmware.h" + +#ifdef CPU_SETSIZE /* Linux */ +# define QEMUD_CPUMASK_LEN CPU_SETSIZE +#elif defined(_SC_NPROCESSORS_CONF) /* Cygwin */ +# define QEMUD_CPUMASK_LEN (sysconf(_SC_NPROCESSORS_CONF)) +#else +# error "Port me" +#endif + +#define QEMU_DRIVER_NAME "QEMU" =20 typedef struct _virQEMUDriver virQEMUDriver; typedef virQEMUDriver *virQEMUDriverPtr; @@ -389,4 +388,3 @@ int qemuGetMemoryBackingPath(const virDomainDef *def, virQEMUDriverConfigPtr cfg, const char *alias, char **memPath); -#endif /* LIBVIRT_QEMU_CONF_H */ diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index f92f0dbc27..a731ae1910 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -19,47 +19,46 @@ * . */ =20 -#ifndef LIBVIRT_QEMU_DOMAIN_H -# define LIBVIRT_QEMU_DOMAIN_H - -# include "virthread.h" -# include "vircgroup.h" -# include "virperf.h" -# include "domain_addr.h" -# include "domain_conf.h" -# include "snapshot_conf.h" -# include "qemu_monitor.h" -# include "qemu_agent.h" -# include "qemu_blockjob.h" -# include "qemu_conf.h" -# include "qemu_capabilities.h" -# include "qemu_migration_params.h" -# include "virmdev.h" -# include "virchrdev.h" -# include "virobject.h" -# include "logging/log_manager.h" -# include "virdomainmomentobjlist.h" -# include "virenum.h" - -# define QEMU_DOMAIN_FORMAT_LIVE_FLAGS \ +#pragma once + +#include "virthread.h" +#include "vircgroup.h" +#include "virperf.h" +#include "domain_addr.h" +#include "domain_conf.h" +#include "snapshot_conf.h" +#include "qemu_monitor.h" +#include "qemu_agent.h" +#include "qemu_blockjob.h" +#include "qemu_conf.h" +#include "qemu_capabilities.h" +#include "qemu_migration_params.h" +#include "virmdev.h" +#include "virchrdev.h" +#include "virobject.h" +#include "logging/log_manager.h" +#include "virdomainmomentobjlist.h" +#include "virenum.h" + +#define QEMU_DOMAIN_FORMAT_LIVE_FLAGS \ (VIR_DOMAIN_XML_SECURE) =20 -# if ULONG_MAX =3D=3D 4294967295 +#if ULONG_MAX =3D=3D 4294967295 /* QEMU has a 64-bit limit, but we are limited by our historical choice of * representing bandwidth in a long instead of a 64-bit int. */ -# define QEMU_DOMAIN_MIG_BANDWIDTH_MAX ULONG_MAX -# else -# define QEMU_DOMAIN_MIG_BANDWIDTH_MAX (INT64_MAX / (1024 * 1024)) -# endif +# define QEMU_DOMAIN_MIG_BANDWIDTH_MAX ULONG_MAX +#else +# define QEMU_DOMAIN_MIG_BANDWIDTH_MAX (INT64_MAX / (1024 * 1024)) +#endif =20 -# define JOB_MASK(job) (job =3D=3D 0 ? 0 : 1 << (job - 1)) -# define QEMU_JOB_DEFAULT_MASK \ +#define JOB_MASK(job) (job =3D=3D 0 ? 0 : 1 << (job - 1)) +#define QEMU_JOB_DEFAULT_MASK \ (JOB_MASK(QEMU_JOB_QUERY) | \ JOB_MASK(QEMU_JOB_DESTROY) | \ JOB_MASK(QEMU_JOB_ABORT)) =20 /* Jobs which have to be tracked in domain state XML. */ -# define QEMU_DOMAIN_TRACK_JOBS \ +#define QEMU_DOMAIN_TRACK_JOBS \ (JOB_MASK(QEMU_JOB_DESTROY) | \ JOB_MASK(QEMU_JOB_ASYNC)) =20 @@ -205,7 +204,7 @@ struct _qemuDomainJobObj { typedef void (*qemuDomainCleanupCallback)(virQEMUDriverPtr driver, virDomainObjPtr vm); =20 -# define QEMU_DOMAIN_MASTER_KEY_LEN 32 /* 32 bytes for 256 bit random key= */ +#define QEMU_DOMAIN_MASTER_KEY_LEN 32 /* 32 bytes for 256 bit random key = */ =20 =20 /* helper data types for async device unplug */ @@ -249,8 +248,8 @@ struct _qemuDomainSecretPlain { size_t secretlen; }; =20 -# define QEMU_DOMAIN_AES_IV_LEN 16 /* 16 bytes for 128 bit random */ - /* initialization vector */ +#define QEMU_DOMAIN_AES_IV_LEN 16 /* 16 bytes for 128 bit random */ + /* initialization vector */ typedef struct _qemuDomainSecretAES qemuDomainSecretAES; typedef struct _qemuDomainSecretAES *qemuDomainSecretAESPtr; struct _qemuDomainSecretAES { @@ -383,10 +382,10 @@ struct _qemuDomainObjPrivate { bool memPrealloc; }; =20 -# define QEMU_DOMAIN_PRIVATE(vm) \ +#define QEMU_DOMAIN_PRIVATE(vm) \ ((qemuDomainObjPrivatePtr) (vm)->privateData) =20 -# define QEMU_DOMAIN_DISK_PRIVATE(disk) \ +#define QEMU_DOMAIN_DISK_PRIVATE(disk) \ ((qemuDomainDiskPrivatePtr) (disk)->privateData) =20 typedef struct _qemuDomainDiskPrivate qemuDomainDiskPrivate; @@ -410,7 +409,7 @@ struct _qemuDomainDiskPrivate { char *nodeCopyOnRead; /* nodename of the disk-wide copy-on-read blockd= ev layer */ }; =20 -# define QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src) \ +#define QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src) \ ((qemuDomainStorageSourcePrivatePtr) (src)->privateData) =20 typedef struct _qemuDomainStorageSourcePrivate qemuDomainStorageSourcePriv= ate; @@ -447,7 +446,7 @@ struct _qemuDomainVcpuPrivate { int vcpus; }; =20 -# define QEMU_DOMAIN_VCPU_PRIVATE(vcpu) \ +#define QEMU_DOMAIN_VCPU_PRIVATE(vcpu) \ ((qemuDomainVcpuPrivatePtr) (vcpu)->privateData) =20 =20 @@ -460,7 +459,7 @@ struct qemuDomainDiskInfo { char *nodename; }; =20 -# define QEMU_DOMAIN_CHR_SOURCE_PRIVATE(dev) \ +#define QEMU_DOMAIN_CHR_SOURCE_PRIVATE(dev) \ ((qemuDomainChrSourcePrivatePtr) (dev)->privateData) =20 typedef struct _qemuDomainChrSourcePrivate qemuDomainChrSourcePrivate; @@ -483,7 +482,7 @@ struct _qemuDomainVsockPrivate { }; =20 =20 -# define QEMU_DOMAIN_GRAPHICS_PRIVATE(dev) \ +#define QEMU_DOMAIN_GRAPHICS_PRIVATE(dev) \ ((qemuDomainGraphicsPrivatePtr) (dev)->privateData) =20 typedef struct _qemuDomainGraphicsPrivate qemuDomainGraphicsPrivate; @@ -1128,5 +1127,3 @@ qemuDomainNVRAMPathGenerate(virQEMUDriverConfigPtr cf= g, =20 virDomainEventSuspendedDetailType qemuDomainPausedReasonToSuspendedEvent(virDomainPausedReason reason); - -#endif /* LIBVIRT_QEMU_DOMAIN_H */ diff --git a/src/qemu/qemu_domain_address.h b/src/qemu/qemu_domain_address.h index 2c0e33320d..bf04e6bfdb 100644 --- a/src/qemu/qemu_domain_address.h +++ b/src/qemu/qemu_domain_address.h @@ -19,13 +19,12 @@ * . */ =20 -#ifndef LIBVIRT_QEMU_DOMAIN_ADDRESS_H -# define LIBVIRT_QEMU_DOMAIN_ADDRESS_H +#pragma once =20 -# include "domain_addr.h" -# include "domain_conf.h" -# include "qemu_conf.h" -# include "qemu_capabilities.h" +#include "domain_addr.h" +#include "domain_conf.h" +#include "qemu_conf.h" +#include "qemu_capabilities.h" =20 int qemuDomainGetSCSIControllerModel(const virDomainDef *def, const virDomainControllerDef *cont, @@ -64,5 +63,3 @@ int qemuDomainEnsureVirtioAddress(bool *releaseAddr, virDomainObjPtr vm, virDomainDeviceDefPtr dev, const char *devicename); - -#endif /* LIBVIRT_QEMU_DOMAIN_ADDRESS_H */ diff --git a/src/qemu/qemu_driver.h b/src/qemu/qemu_driver.h index e2efad6e52..149975350f 100644 --- a/src/qemu/qemu_driver.h +++ b/src/qemu/qemu_driver.h @@ -19,9 +19,6 @@ * . */ =20 -#ifndef LIBVIRT_QEMU_DRIVER_H -# define LIBVIRT_QEMU_DRIVER_H +#pragma once =20 int qemuRegister(void); - -#endif /* LIBVIRT_QEMU_DRIVER_H */ diff --git a/src/qemu/qemu_extdevice.h b/src/qemu/qemu_extdevice.h index af03c045ff..a72e05ce63 100644 --- a/src/qemu/qemu_extdevice.h +++ b/src/qemu/qemu_extdevice.h @@ -18,11 +18,10 @@ * . */ =20 -#ifndef LIBVIRT_QEMU_EXTDEVICE_H -# define LIBVIRT_QEMU_EXTDEVICE_H +#pragma once =20 -# include "qemu_conf.h" -# include "qemu_domain.h" +#include "qemu_conf.h" +#include "qemu_domain.h" =20 int qemuExtDeviceLogCommand(qemuDomainLogContextPtr logCtxt, virCommandPtr cmd, @@ -54,5 +53,3 @@ bool qemuExtDevicesHasDevice(virDomainDefPtr def); int qemuExtDevicesSetupCgroup(virQEMUDriverPtr driver, virDomainDefPtr def, virCgroupPtr cgroup); - -#endif /* LIBVIRT_QEMU_EXTDEVICE_H */ diff --git a/src/qemu/qemu_firmware.h b/src/qemu/qemu_firmware.h index 7a63d6367c..6a3b6061f4 100644 --- a/src/qemu/qemu_firmware.h +++ b/src/qemu/qemu_firmware.h @@ -18,13 +18,12 @@ * . */ =20 -#ifndef LIBVIRT_QEMU_FIRMWARE_H -# define LIBVIRT_QEMU_FIRMWARE_H +#pragma once =20 -# include "domain_conf.h" -# include "qemu_conf.h" -# include "virautoclean.h" -# include "virarch.h" +#include "domain_conf.h" +#include "qemu_conf.h" +#include "virautoclean.h" +#include "virarch.h" =20 typedef struct _qemuFirmware qemuFirmware; typedef qemuFirmware *qemuFirmwarePtr; @@ -57,5 +56,3 @@ qemuFirmwareGetSupported(const char *machine, bool *secure); =20 verify(VIR_DOMAIN_OS_DEF_FIRMWARE_LAST <=3D 64); - -#endif /* LIBVIRT_QEMU_FIRMWARE_H */ diff --git a/src/qemu/qemu_hostdev.h b/src/qemu/qemu_hostdev.h index 41f254ab81..f6d76c1c2a 100644 --- a/src/qemu/qemu_hostdev.h +++ b/src/qemu/qemu_hostdev.h @@ -19,11 +19,10 @@ * . */ =20 -#ifndef LIBVIRT_QEMU_HOSTDEV_H -# define LIBVIRT_QEMU_HOSTDEV_H +#pragma once =20 -# include "qemu_conf.h" -# include "domain_conf.h" +#include "qemu_conf.h" +#include "domain_conf.h" =20 bool qemuHostdevHostSupportsPassthroughLegacy(void); bool qemuHostdevHostSupportsPassthroughVFIO(void); @@ -90,5 +89,3 @@ void qemuHostdevReAttachMediatedDevices(virQEMUDriverPtr = driver, int nhostdevs); void qemuHostdevReAttachDomainDevices(virQEMUDriverPtr driver, virDomainDefPtr def); - -#endif /* LIBVIRT_QEMU_HOSTDEV_H */ diff --git a/src/qemu/qemu_hotplug.h b/src/qemu/qemu_hotplug.h index 78aa4e991b..896e6c7b98 100644 --- a/src/qemu/qemu_hotplug.h +++ b/src/qemu/qemu_hotplug.h @@ -19,12 +19,11 @@ * . */ =20 -#ifndef LIBVIRT_QEMU_HOTPLUG_H -# define LIBVIRT_QEMU_HOTPLUG_H +#pragma once =20 -# include "qemu_conf.h" -# include "qemu_domain.h" -# include "domain_conf.h" +#include "qemu_conf.h" +#include "qemu_domain.h" +#include "domain_conf.h" =20 int qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver, virDomainObjPtr vm, @@ -151,5 +150,3 @@ int qemuDomainSetVcpuInternal(virQEMUDriverPtr driver, virDomainDefPtr persistentDef, virBitmapPtr vcpus, bool state); - -#endif /* LIBVIRT_QEMU_HOTPLUG_H */ diff --git a/src/qemu/qemu_hotplugpriv.h b/src/qemu/qemu_hotplugpriv.h index e4b37d78c0..a5c443ba85 100644 --- a/src/qemu/qemu_hotplugpriv.h +++ b/src/qemu/qemu_hotplugpriv.h @@ -23,13 +23,10 @@ # error "qemu_hotplugpriv.h may only be included by qemu_hotplug.c or test= suites" #endif /* LIBVIRT_QEMU_HOTPLUGPRIV_H_ALLOW */ =20 -#ifndef LIBVIRT_QEMU_HOTPLUGPRIV_H -# define LIBVIRT_QEMU_HOTPLUGPRIV_H +#pragma once =20 /* * This header file should never be used outside unit tests. */ =20 extern unsigned long long qemuDomainRemoveDeviceWaitTime; - -#endif /* LIBVIRT_QEMU_HOTPLUGPRIV_H */ diff --git a/src/qemu/qemu_interface.h b/src/qemu/qemu_interface.h index f3ec540eda..5a2f87e532 100644 --- a/src/qemu/qemu_interface.h +++ b/src/qemu/qemu_interface.h @@ -19,12 +19,11 @@ * . */ =20 -#ifndef LIBVIRT_QEMU_INTERFACE_H -# define LIBVIRT_QEMU_INTERFACE_H +#pragma once =20 -# include "domain_conf.h" -# include "qemu_conf.h" -# include "qemu_domain.h" +#include "domain_conf.h" +#include "qemu_conf.h" +#include "qemu_domain.h" =20 int qemuInterfaceStartDevice(virDomainNetDefPtr net); int qemuInterfaceStartDevices(virDomainDefPtr def); @@ -55,4 +54,3 @@ int qemuInterfaceOpenVhostNet(virDomainDefPtr def, virDomainNetDefPtr net, int *vhostfd, size_t *vhostfdSize); -#endif /* LIBVIRT_QEMU_INTERFACE_H */ diff --git a/src/qemu/qemu_migration.h b/src/qemu/qemu_migration.h index 828caf268d..bea7b1e688 100644 --- a/src/qemu/qemu_migration.h +++ b/src/qemu/qemu_migration.h @@ -19,13 +19,12 @@ * */ =20 -#ifndef LIBVIRT_QEMU_MIGRATION_H -# define LIBVIRT_QEMU_MIGRATION_H +#pragma once =20 -# include "qemu_conf.h" -# include "qemu_domain.h" -# include "qemu_migration_params.h" -# include "virenum.h" +#include "qemu_conf.h" +#include "qemu_domain.h" +#include "qemu_migration_params.h" +#include "virenum.h" =20 /* * General function naming conventions: @@ -41,7 +40,7 @@ */ =20 /* All supported qemu migration flags. */ -# define QEMU_MIGRATION_FLAGS \ +#define QEMU_MIGRATION_FLAGS \ (VIR_MIGRATE_LIVE | \ VIR_MIGRATE_PEER2PEER | \ VIR_MIGRATE_TUNNELLED | \ @@ -63,7 +62,7 @@ 0) =20 /* All supported migration parameters and their types. */ -# define QEMU_MIGRATION_PARAMETERS \ +#define QEMU_MIGRATION_PARAMETERS \ VIR_MIGRATE_PARAM_URI, VIR_TYPED_PARAM_STRING, \ VIR_MIGRATE_PARAM_DEST_NAME, VIR_TYPED_PARAM_STRING, \ VIR_MIGRATE_PARAM_DEST_XML, VIR_TYPED_PARAM_STRING, \ @@ -254,5 +253,3 @@ qemuMigrationSrcFetchMirrorStats(virQEMUDriverPtr drive= r, virDomainObjPtr vm, qemuDomainAsyncJob asyncJob, qemuDomainJobInfoPtr jobInfo); - -#endif /* LIBVIRT_QEMU_MIGRATION_H */ diff --git a/src/qemu/qemu_migration_cookie.h b/src/qemu/qemu_migration_coo= kie.h index 0c80b17e5e..20e1ed60ca 100644 --- a/src/qemu/qemu_migration_cookie.h +++ b/src/qemu/qemu_migration_cookie.h @@ -16,11 +16,10 @@ * . */ =20 -#ifndef LIBVIRT_QEMU_MIGRATION_COOKIE_H -# define LIBVIRT_QEMU_MIGRATION_COOKIE_H +#pragma once =20 -# include "qemu_migration_params.h" -# include "virenum.h" +#include "qemu_migration_params.h" +#include "virenum.h" =20 typedef enum { QEMU_MIGRATION_COOKIE_FLAG_GRAPHICS, @@ -177,5 +176,3 @@ qemuMigrationCookieAddPersistent(qemuMigrationCookiePtr= mig, =20 virDomainDefPtr qemuMigrationCookieGetPersistent(qemuMigrationCookiePtr mig); - -#endif /* LIBVIRT_QEMU_MIGRATION_COOKIE_H */ diff --git a/src/qemu/qemu_migration_params.h b/src/qemu/qemu_migration_par= ams.h index b7bc71edaf..6f5080e6a7 100644 --- a/src/qemu/qemu_migration_params.h +++ b/src/qemu/qemu_migration_params.h @@ -19,17 +19,16 @@ * */ =20 -#ifndef LIBVIRT_QEMU_MIGRATION_PARAMS_H -# define LIBVIRT_QEMU_MIGRATION_PARAMS_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 -# include "virbuffer.h" -# include "virxml.h" -# include "qemu_monitor.h" -# include "qemu_conf.h" -# include "virautoclean.h" -# include "virenum.h" +#include "virbuffer.h" +#include "virxml.h" +#include "qemu_monitor.h" +#include "qemu_conf.h" +#include "virautoclean.h" +#include "virenum.h" =20 typedef enum { QEMU_MIGRATION_CAP_XBZRLE, @@ -161,5 +160,3 @@ qemuMigrationCapsCheck(virQEMUDriverPtr driver, bool qemuMigrationCapsGet(virDomainObjPtr vm, qemuMigrationCapability cap); - -#endif /* LIBVIRT_QEMU_MIGRATION_PARAMS_H */ diff --git a/src/qemu/qemu_migration_paramspriv.h b/src/qemu/qemu_migration= _paramspriv.h index b1e017e786..ca72400c7e 100644 --- a/src/qemu/qemu_migration_paramspriv.h +++ b/src/qemu/qemu_migration_paramspriv.h @@ -23,8 +23,7 @@ # error "qemu_migration_paramspriv.h may only be included by qemu_migratio= n_params.c or test suites" #endif /* LIBVIRT_QEMU_MIGRATION_PARAMSPRIV_H_ALLOW */ =20 -#ifndef LIBVIRT_QEMU_MIGRATION_PARAMSPRIV_H -# define LIBVIRT_QEMU_MIGRATION_PARAMSPRIV_H +#pragma once =20 virJSONValuePtr qemuMigrationParamsToJSON(qemuMigrationParamsPtr migParams); @@ -35,5 +34,3 @@ qemuMigrationParamsFromJSON(virJSONValuePtr params); virJSONValuePtr qemuMigrationCapsToJSON(virBitmapPtr caps, virBitmapPtr states); - -#endif /* LIBVIRT_QEMU_MIGRATION_PARAMSPRIV_H */ diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index a19d6069c6..8def4c7311 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -19,20 +19,19 @@ * . */ =20 -#ifndef LIBVIRT_QEMU_MONITOR_H -# define LIBVIRT_QEMU_MONITOR_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 -# include "domain_conf.h" -# include "virbitmap.h" -# include "virhash.h" -# include "virjson.h" -# include "virnetdev.h" -# include "device_conf.h" -# include "cpu/cpu.h" -# include "util/virgic.h" -# include "virenum.h" +#include "domain_conf.h" +#include "virbitmap.h" +#include "virhash.h" +#include "virjson.h" +#include "virnetdev.h" +#include "device_conf.h" +#include "cpu/cpu.h" +#include "util/virgic.h" +#include "virenum.h" =20 typedef struct _qemuMonitor qemuMonitor; typedef qemuMonitor *qemuMonitorPtr; @@ -388,7 +387,7 @@ int qemuMonitorHMPCommandWithFd(qemuMonitorPtr mon, const char *cmd, int scm_fd, char **reply); -# define qemuMonitorHMPCommand(mon, cmd, reply) \ +#define qemuMonitorHMPCommand(mon, cmd, reply) \ qemuMonitorHMPCommandWithFd(mon, cmd, -1, reply) =20 int qemuMonitorEmitEvent(qemuMonitorPtr mon, const char *event, @@ -1252,5 +1251,3 @@ struct _qemuMonitorCurrentMachineInfo { =20 int qemuMonitorGetCurrentMachineInfo(qemuMonitorPtr mon, qemuMonitorCurrentMachineInfoPtr info= ); - -#endif /* LIBVIRT_QEMU_MONITOR_H */ diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index 2a881fbddd..78fe97ab18 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -19,15 +19,14 @@ * . */ =20 -#ifndef LIBVIRT_QEMU_MONITOR_JSON_H -# define LIBVIRT_QEMU_MONITOR_JSON_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 -# include "qemu_monitor.h" -# include "virbitmap.h" -# include "cpu/cpu.h" -# include "util/virgic.h" +#include "qemu_monitor.h" +#include "virbitmap.h" +#include "cpu/cpu.h" +#include "util/virgic.h" =20 int qemuMonitorJSONTransactionAdd(virJSONValuePtr actions, const char *cmdname, @@ -600,5 +599,3 @@ int qemuMonitorJSONMergeBitmaps(qemuMonitorPtr mon, int qemuMonitorJSONDeleteBitmap(qemuMonitorPtr mon, const char *node, const char *bitmap); - -#endif /* LIBVIRT_QEMU_MONITOR_JSON_H */ diff --git a/src/qemu/qemu_monitor_priv.h b/src/qemu/qemu_monitor_priv.h index 2e3ca72ec9..8ab97a4ce7 100644 --- a/src/qemu/qemu_monitor_priv.h +++ b/src/qemu/qemu_monitor_priv.h @@ -20,12 +20,9 @@ # error "qemu_monitor_priv.h may only be included by qemu_monitor.c or tes= t suites" #endif /* LIBVIRT_QEMU_MONITOR_PRIV_H_ALLOW */ =20 -#ifndef LIBVIRT_QEMU_MONITOR_PRIV_H -# define LIBVIRT_QEMU_MONITOR_PRIV_H +#pragma once =20 -# include "qemu_monitor.h" +#include "qemu_monitor.h" =20 void qemuMonitorResetCommandID(qemuMonitorPtr mon); - -#endif /* LIBVIRT_QEMU_MONITOR_PRIV_H */ diff --git a/src/qemu/qemu_monitor_text.h b/src/qemu/qemu_monitor_text.h index b1ad2dab52..524bd1d5cb 100644 --- a/src/qemu/qemu_monitor_text.h +++ b/src/qemu/qemu_monitor_text.h @@ -19,12 +19,11 @@ * . */ =20 -#ifndef LIBVIRT_QEMU_MONITOR_TEXT_H -# define LIBVIRT_QEMU_MONITOR_TEXT_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 -# include "qemu_monitor.h" +#include "qemu_monitor.h" =20 int qemuMonitorTextSetCPU(qemuMonitorPtr mon, int cpu, bool online); =20 @@ -37,5 +36,3 @@ int qemuMonitorTextDriveDel(qemuMonitorPtr mon, int qemuMonitorTextCreateSnapshot(qemuMonitorPtr mon, const char *name); int qemuMonitorTextLoadSnapshot(qemuMonitorPtr mon, const char *name); int qemuMonitorTextDeleteSnapshot(qemuMonitorPtr mon, const char *name); - -#endif /* LIBVIRT_QEMU_MONITOR_TEXT_H */ diff --git a/src/qemu/qemu_parse_command.h b/src/qemu/qemu_parse_command.h index 5eeb344c60..3fe8206896 100644 --- a/src/qemu/qemu_parse_command.h +++ b/src/qemu/qemu_parse_command.h @@ -19,12 +19,11 @@ * . */ =20 -#ifndef LIBVIRT_QEMU_PARSE_COMMAND_H -# define LIBVIRT_QEMU_PARSE_COMMAND_H +#pragma once =20 -# include "virfilecache.h" +#include "virfilecache.h" =20 -# define QEMU_QXL_VGAMEM_DEFAULT 16 * 1024 +#define QEMU_QXL_VGAMEM_DEFAULT 16 * 1024 =20 /* * NB: def->name can be NULL upon return and the caller @@ -56,5 +55,3 @@ qemuParseKeywords(const char *str, char ***retvalues, int *retnkeywords, int allowEmptyValue); - -#endif /* LIBVIRT_QEMU_PARSE_COMMAND_H */ diff --git a/src/qemu/qemu_process.h b/src/qemu/qemu_process.h index d20bd5306e..4840d897f8 100644 --- a/src/qemu/qemu_process.h +++ b/src/qemu/qemu_process.h @@ -19,12 +19,11 @@ * */ =20 -#ifndef LIBVIRT_QEMU_PROCESS_H -# define LIBVIRT_QEMU_PROCESS_H +#pragma once =20 -# include "qemu_conf.h" -# include "qemu_domain.h" -# include "virstoragefile.h" +#include "qemu_conf.h" +#include "qemu_domain.h" +#include "virstoragefile.h" =20 int qemuProcessPrepareMonitorChr(virDomainChrSourceDefPtr monConfig, const char *domainDir); @@ -242,5 +241,3 @@ qemuProcessQMPPtr qemuProcessQMPNew(const char *binary, void qemuProcessQMPFree(qemuProcessQMPPtr proc); =20 int qemuProcessQMPStart(qemuProcessQMPPtr proc); - -#endif /* LIBVIRT_QEMU_PROCESS_H */ diff --git a/src/qemu/qemu_processpriv.h b/src/qemu/qemu_processpriv.h index 237d7bad58..84d6bc8420 100644 --- a/src/qemu/qemu_processpriv.h +++ b/src/qemu/qemu_processpriv.h @@ -23,11 +23,10 @@ # error "qemu_process_priv.h may only be included by qemu_process.c or tes= t suites" #endif /* LIBVIRT_QEMU_PROCESSPRIV_H_ALLOW */ =20 -#ifndef LIBVIRT_QEMU_PROCESSPRIV_H -# define LIBVIRT_QEMU_PROCESSPRIV_H +#pragma once =20 -# include "domain_conf.h" -# include "qemu_monitor.h" +#include "domain_conf.h" +#include "qemu_monitor.h" =20 /* * This header file should never be used outside unit tests. @@ -39,5 +38,3 @@ int qemuProcessHandleDeviceDeleted(qemuMonitorPtr mon, void *opaque); =20 int qemuProcessQMPInitMonitor(qemuMonitorPtr mon); - -#endif /* LIBVIRT_QEMU_PROCESSPRIV_H */ diff --git a/src/qemu/qemu_qapi.h b/src/qemu/qemu_qapi.h index c95978de91..33af025424 100644 --- a/src/qemu/qemu_qapi.h +++ b/src/qemu/qemu_qapi.h @@ -16,13 +16,12 @@ * . */ =20 -#ifndef LIBVIRT_QEMU_QAPI_H -# define LIBVIRT_QEMU_QAPI_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 -# include "virhash.h" -# include "virjson.h" +#include "virhash.h" +#include "virjson.h" =20 int virQEMUQAPISchemaPathGet(const char *query, @@ -35,6 +34,3 @@ virQEMUQAPISchemaPathExists(const char *query, =20 virHashTablePtr virQEMUQAPISchemaConvert(virJSONValuePtr schemareply); - - -#endif /* LIBVIRT_QEMU_QAPI_H */ diff --git a/src/qemu/qemu_security.h b/src/qemu/qemu_security.h index 546a66f284..aa7ee2fb76 100644 --- a/src/qemu/qemu_security.h +++ b/src/qemu/qemu_security.h @@ -18,13 +18,11 @@ * . */ =20 -#ifndef LIBVIRT_QEMU_SECURITY_H -# define LIBVIRT_QEMU_SECURITY_H +#pragma once =20 - -# include "qemu_conf.h" -# include "domain_conf.h" -# include "security/security_manager.h" +#include "qemu_conf.h" +#include "domain_conf.h" +#include "security/security_manager.h" =20 int qemuSecuritySetAllLabel(virQEMUDriverPtr driver, virDomainObjPtr vm, @@ -101,28 +99,26 @@ int qemuSecurityRestoreSavedStateLabel(virQEMUDriverPt= r driver, /* Please note that for these APIs there is no wrapper yet. Do NOT blindly= add * new APIs here. If an API can touch a file add a proper wrapper instead. */ -# define qemuSecurityCheckAllLabel virSecurityManagerCheckAllLabel -# define qemuSecurityClearSocketLabel virSecurityManagerClearSocketLabel -# define qemuSecurityGenLabel virSecurityManagerGenLabel -# define qemuSecurityGetBaseLabel virSecurityManagerGetBaseLabel -# define qemuSecurityGetDOI virSecurityManagerGetDOI -# define qemuSecurityGetModel virSecurityManagerGetModel -# define qemuSecurityGetMountOptions virSecurityManagerGetMountOptions -# define qemuSecurityGetNested virSecurityManagerGetNested -# define qemuSecurityGetProcessLabel virSecurityManagerGetProcessLabel -# define qemuSecurityNew virSecurityManagerNew -# define qemuSecurityNewDAC virSecurityManagerNewDAC -# define qemuSecurityNewStack virSecurityManagerNewStack -# define qemuSecurityPostFork virSecurityManagerPostFork -# define qemuSecurityPreFork virSecurityManagerPreFork -# define qemuSecurityReleaseLabel virSecurityManagerReleaseLabel -# define qemuSecurityReserveLabel virSecurityManagerReserveLabel -# define qemuSecuritySetChildProcessLabel virSecurityManagerSetChildProces= sLabel -# define qemuSecuritySetDaemonSocketLabel virSecurityManagerSetDaemonSocke= tLabel -# define qemuSecuritySetImageFDLabel virSecurityManagerSetImageFDLabel -# define qemuSecuritySetSocketLabel virSecurityManagerSetSocketLabel -# define qemuSecuritySetTapFDLabel virSecurityManagerSetTapFDLabel -# define qemuSecurityStackAddNested virSecurityManagerStackAddNested -# define qemuSecurityVerify virSecurityManagerVerify - -#endif /* LIBVIRT_QEMU_SECURITY_H */ +#define qemuSecurityCheckAllLabel virSecurityManagerCheckAllLabel +#define qemuSecurityClearSocketLabel virSecurityManagerClearSocketLabel +#define qemuSecurityGenLabel virSecurityManagerGenLabel +#define qemuSecurityGetBaseLabel virSecurityManagerGetBaseLabel +#define qemuSecurityGetDOI virSecurityManagerGetDOI +#define qemuSecurityGetModel virSecurityManagerGetModel +#define qemuSecurityGetMountOptions virSecurityManagerGetMountOptions +#define qemuSecurityGetNested virSecurityManagerGetNested +#define qemuSecurityGetProcessLabel virSecurityManagerGetProcessLabel +#define qemuSecurityNew virSecurityManagerNew +#define qemuSecurityNewDAC virSecurityManagerNewDAC +#define qemuSecurityNewStack virSecurityManagerNewStack +#define qemuSecurityPostFork virSecurityManagerPostFork +#define qemuSecurityPreFork virSecurityManagerPreFork +#define qemuSecurityReleaseLabel virSecurityManagerReleaseLabel +#define qemuSecurityReserveLabel virSecurityManagerReserveLabel +#define qemuSecuritySetChildProcessLabel virSecurityManagerSetChildProcess= Label +#define qemuSecuritySetDaemonSocketLabel virSecurityManagerSetDaemonSocket= Label +#define qemuSecuritySetImageFDLabel virSecurityManagerSetImageFDLabel +#define qemuSecuritySetSocketLabel virSecurityManagerSetSocketLabel +#define qemuSecuritySetTapFDLabel virSecurityManagerSetTapFDLabel +#define qemuSecurityStackAddNested virSecurityManagerStackAddNested +#define qemuSecurityVerify virSecurityManagerVerify diff --git a/src/qemu/qemu_tpm.h b/src/qemu/qemu_tpm.h index bffcad5db0..74c9924d68 100644 --- a/src/qemu/qemu_tpm.h +++ b/src/qemu/qemu_tpm.h @@ -18,10 +18,9 @@ * . */ =20 -#ifndef LIBVIRT_QEMU_TPM_H -# define LIBVIRT_QEMU_TPM_H +#pragma once =20 -# include "vircommand.h" +#include "vircommand.h" =20 int qemuExtTPMInitPaths(virQEMUDriverPtr driver, virDomainDefPtr def) @@ -51,5 +50,3 @@ int qemuExtTPMSetupCgroup(virQEMUDriverPtr driver, virCgroupPtr cgroup) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_RETURN_CHECK; - -#endif /* LIBVIRT_QEMU_TPM_H */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560874529; cv=none; d=zoho.com; s=zohoarc; b=ht9GIWkSWIcGLZ2jP5T8jYUpfY583ArNe3cU9prMqfdRHtili7mJ/nXcR7VpqZcKoibS4pCA79ms09dIKdzW0n/XWffQd8+J74VXpq70K0f0/alQmtLtnavEXN/xf5UIo5CYNcqJBrCMTSrIf9UEUaEPLYkfVeE3GR0iWj30nWk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560874529; 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=UdOH8S2ZKZ9ob+aUr/IdExt6gwvgkGPo0jCLueehhSQ=; b=ENwMZJR78dJXU09wl0NrmXo88kd/YqOTIrXk9ljJflWaqKERSR9SIQap9swqHMPLS+A5pKykyGozYeXwhkXktaUaHAbG0vgUKwnC8PitFyZnMbg3AcgTmF7o4QCnkRqq7ykXCmgDd8h08s6RnNF2b3tJ0SEPOE59C3bOdppnt7I= 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 1560874529046255.78622201289977; Tue, 18 Jun 2019 09:15:29 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6AB1C30C1CBE; Tue, 18 Jun 2019 16:15:21 +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 3C88584EF; Tue, 18 Jun 2019 16:15:20 +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 D8BB2206D1; Tue, 18 Jun 2019 16:15:17 +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 x5IGDQZk024161 for ; Tue, 18 Jun 2019 12:13:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id CFFA860FAB; Tue, 18 Jun 2019 16:13:26 +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 9DFB984EF for ; Tue, 18 Jun 2019 16:13:26 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:12:38 -0500 Message-Id: <20190618161316.1722-9-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 08/46] src/remote: 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.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Tue, 18 Jun 2019 16:15:28 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/remote/remote_daemon.h | 35 +++++++++++++--------------- src/remote/remote_daemon_config.h | 7 ++---- src/remote/remote_daemon_dispatch.h | 11 ++++----- src/remote/remote_daemon_stream.h | 7 ++---- src/remote/remote_driver.h | 36 +++++++++++++---------------- 5 files changed, 40 insertions(+), 56 deletions(-) diff --git a/src/remote/remote_daemon.h b/src/remote/remote_daemon.h index 50e912f828..a403d2593a 100644 --- a/src/remote/remote_daemon.h +++ b/src/remote/remote_daemon.h @@ -19,22 +19,21 @@ * . */ =20 -#ifndef LIBVIRT_REMOTE_DAEMON_H -# define LIBVIRT_REMOTE_DAEMON_H +#pragma once =20 -# define VIR_ENUM_SENTINELS +#define VIR_ENUM_SENTINELS =20 -# include -# include -# include "remote_protocol.h" -# include "lxc_protocol.h" -# include "qemu_protocol.h" -# include "virthread.h" +#include +#include +#include "remote_protocol.h" +#include "lxc_protocol.h" +#include "qemu_protocol.h" +#include "virthread.h" =20 -# if WITH_SASL -# include "virnetsaslcontext.h" -# endif -# include "virnetserverprogram.h" +#if WITH_SASL +# include "virnetsaslcontext.h" +#endif +#include "virnetserverprogram.h" =20 typedef struct daemonClientStream daemonClientStream; typedef daemonClientStream *daemonClientStreamPtr; @@ -62,9 +61,9 @@ struct daemonClientPrivate { size_t nsecretEventCallbacks; bool closeRegistered; =20 -# if WITH_SASL +#if WITH_SASL virNetSASLSessionPtr sasl; -# endif +#endif =20 /* This is only valid if a remote open call has been made on this * connection, otherwise it will be NULL. Also if remote close is @@ -82,10 +81,8 @@ struct daemonClientPrivate { }; =20 =20 -# if WITH_SASL +#if WITH_SASL extern virNetSASLContextPtr saslCtxt; -# endif +#endif extern virNetServerProgramPtr remoteProgram; extern virNetServerProgramPtr qemuProgram; - -#endif /* LIBVIRT_REMOTE_DAEMON_H */ diff --git a/src/remote/remote_daemon_config.h b/src/remote/remote_daemon_c= onfig.h index 56d130bdce..533fc7bbd3 100644 --- a/src/remote/remote_daemon_config.h +++ b/src/remote/remote_daemon_config.h @@ -19,10 +19,9 @@ * . */ =20 -#ifndef LIBVIRT_REMOTE_DAEMON_CONFIG_H -# define LIBVIRT_REMOTE_DAEMON_CONFIG_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 struct daemonConfig { char *host_uuid; @@ -103,5 +102,3 @@ int daemonConfigLoadFile(struct daemonConfig *data, int daemonConfigLoadData(struct daemonConfig *data, const char *filename, const char *filedata); - -#endif /* LIBVIRT_REMOTE_DAEMON_CONFIG_H */ diff --git a/src/remote/remote_daemon_dispatch.h b/src/remote/remote_daemon= _dispatch.h index cafe109a21..1f70b9e4e9 100644 --- a/src/remote/remote_daemon_dispatch.h +++ b/src/remote/remote_daemon_dispatch.h @@ -18,12 +18,11 @@ * . */ =20 -#ifndef LIBVIRT_REMOTE_DAEMON_DISPATCH_H -# define LIBVIRT_REMOTE_DAEMON_DISPATCH_H +#pragma once =20 -# include "remote_protocol.h" -# include "rpc/virnetserverprogram.h" -# include "rpc/virnetserverclient.h" +#include "remote_protocol.h" +#include "rpc/virnetserverprogram.h" +#include "rpc/virnetserverclient.h" =20 =20 extern virNetServerProgramProc remoteProcs[]; @@ -38,5 +37,3 @@ extern size_t qemuNProcs; void remoteClientFree(void *data); void *remoteClientNew(virNetServerClientPtr client, void *opaque); - -#endif /* LIBVIRT_REMOTE_DAEMON_DISPATCH_H */ diff --git a/src/remote/remote_daemon_stream.h b/src/remote/remote_daemon_s= tream.h index 46e3df5c5e..a9bed10292 100644 --- a/src/remote/remote_daemon_stream.h +++ b/src/remote/remote_daemon_stream.h @@ -18,10 +18,9 @@ * . */ =20 -#ifndef LIBVIRT_REMOTE_DAEMON_STREAM_H -# define LIBVIRT_REMOTE_DAEMON_STREAM_H +#pragma once =20 -# include "remote_daemon.h" +#include "remote_daemon.h" =20 daemonClientStream * daemonCreateClientStream(virNetServerClientPtr client, @@ -43,5 +42,3 @@ daemonRemoveClientStream(virNetServerClientPtr client, =20 void daemonRemoveAllClientStreams(daemonClientStream *stream); - -#endif /* LIBVIRT_REMOTE_DAEMON_STREAM_H */ diff --git a/src/remote/remote_driver.h b/src/remote/remote_driver.h index 5d6580e855..8c7da6b000 100644 --- a/src/remote/remote_driver.h +++ b/src/remote/remote_driver.h @@ -19,31 +19,27 @@ * . */ =20 -#ifndef LIBVIRT_REMOTE_DRIVER_H -# define LIBVIRT_REMOTE_DRIVER_H +#pragma once =20 -# include "internal.h" -# include "configmake.h" +#include "internal.h" +#include "configmake.h" =20 int remoteRegister (void); =20 unsigned long remoteVersion(void); =20 -# define LIBVIRTD_LISTEN_ADDR NULL -# define LIBVIRTD_TLS_PORT "16514" -# define LIBVIRTD_TCP_PORT "16509" -# define LIBVIRTD_PRIV_UNIX_SOCKET LOCALSTATEDIR "/run/libvirt/libvirt-soc= k" -# define LIBVIRTD_PRIV_UNIX_SOCKET_RO LOCALSTATEDIR "/run/libvirt/libvirt-= sock-ro" -# define LIBVIRTD_USER_UNIX_SOCKET "libvirt-sock" -# define LIBVIRTD_CONFIGURATION_FILE SYSCONFDIR "/libvirt/libvirtd.conf" +#define LIBVIRTD_LISTEN_ADDR NULL +#define LIBVIRTD_TLS_PORT "16514" +#define LIBVIRTD_TCP_PORT "16509" +#define LIBVIRTD_PRIV_UNIX_SOCKET LOCALSTATEDIR "/run/libvirt/libvirt-sock" +#define LIBVIRTD_PRIV_UNIX_SOCKET_RO LOCALSTATEDIR "/run/libvirt/libvirt-s= ock-ro" +#define LIBVIRTD_USER_UNIX_SOCKET "libvirt-sock" +#define LIBVIRTD_CONFIGURATION_FILE SYSCONFDIR "/libvirt/libvirtd.conf" =20 /* Defaults for PKI directory. */ -# define LIBVIRT_PKI_DIR SYSCONFDIR "/pki" -# define LIBVIRT_CACERT LIBVIRT_PKI_DIR "/CA/cacert.pem" -# define LIBVIRT_CLIENTKEY LIBVIRT_PKI_DIR "/libvirt/private/clientkey.pem" -# define LIBVIRT_CLIENTCERT LIBVIRT_PKI_DIR "/libvirt/clientcert.pem" -# define LIBVIRT_SERVERKEY LIBVIRT_PKI_DIR "/libvirt/private/serverkey.pem" -# define LIBVIRT_SERVERCERT LIBVIRT_PKI_DIR "/libvirt/servercert.pem" - - -#endif /* LIBVIRT_REMOTE_DRIVER_H */ +#define LIBVIRT_PKI_DIR SYSCONFDIR "/pki" +#define LIBVIRT_CACERT LIBVIRT_PKI_DIR "/CA/cacert.pem" +#define LIBVIRT_CLIENTKEY LIBVIRT_PKI_DIR "/libvirt/private/clientkey.pem" +#define LIBVIRT_CLIENTCERT LIBVIRT_PKI_DIR "/libvirt/clientcert.pem" +#define LIBVIRT_SERVERKEY LIBVIRT_PKI_DIR "/libvirt/private/serverkey.pem" +#define LIBVIRT_SERVERCERT LIBVIRT_PKI_DIR "/libvirt/servercert.pem" --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560876086; cv=none; d=zoho.com; s=zohoarc; b=Gq0iAUBndV7m03qlYDPXs8tYCTl3ElsOjqpOHFP2dag8EDTliPicddg9lvvWj6jO77MCFvCH0MobDV+K34nfgnZZto+rkXgBmzwLJDTIwePUWzwzNdK+6ASjr21O+NJhVsGF4ny0KTj6fV6c422W6og8CR094OLgrArDa/BiNz0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560876086; 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=RB9ui8Ec6OgHTWdmlnj1IJFQUyzpyUUdt0olFL7KIM8=; b=XDDhW4KVl0TJv+auqXrjh+beQHR9J+S1YpWdyj6PQnASqoIjq57jDrRD4w6jToHQ3LU+4Z4sT4e24zj/N5xef5lHG5ZrkMzTfJkDgWkYSFcpgPq/jTS/DEvNpTezhTO5XKMBQEdDpd92xRbqg0oPuDlOfHOpzn5Q3LCXO72VHJk= 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 1560876086588701.3305500270648; Tue, 18 Jun 2019 09:41:26 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id AB75081121; Tue, 18 Jun 2019 16:41:19 +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 83D325C1B5; Tue, 18 Jun 2019 16:41:18 +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 464F9206D5; Tue, 18 Jun 2019 16:41:17 +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 x5IGDRKx024166 for ; Tue, 18 Jun 2019 12:13:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2E59360FAB; Tue, 18 Jun 2019 16:13:27 +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 EF1B184EF for ; Tue, 18 Jun 2019 16:13:26 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:12:39 -0500 Message-Id: <20190618161316.1722-10-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 09/46] src/rpc: 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.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 18 Jun 2019 16:41:25 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/rpc/virkeepalive.h | 9 +++----- src/rpc/virnetclient.h | 41 ++++++++++++++++------------------- src/rpc/virnetclientprogram.h | 15 +++++-------- src/rpc/virnetclientstream.h | 9 +++----- src/rpc/virnetdaemon.h | 21 ++++++++---------- src/rpc/virnetlibsshsession.h | 9 +++----- src/rpc/virnetmessage.h | 7 ++---- src/rpc/virnetsaslcontext.h | 11 ++++------ src/rpc/virnetserver.h | 17 ++++++--------- src/rpc/virnetserverclient.h | 19 +++++++--------- src/rpc/virnetservermdns.h | 7 ++---- src/rpc/virnetserverprogram.h | 11 ++++------ src/rpc/virnetserverservice.h | 9 +++----- src/rpc/virnetsocket.h | 38 +++++++++++++++----------------- src/rpc/virnetsshsession.h | 9 +++----- src/rpc/virnettlscontext.h | 9 +++----- 16 files changed, 95 insertions(+), 146 deletions(-) diff --git a/src/rpc/virkeepalive.h b/src/rpc/virkeepalive.h index 6b9524b6ba..41d65d08d0 100644 --- a/src/rpc/virkeepalive.h +++ b/src/rpc/virkeepalive.h @@ -18,11 +18,10 @@ * . */ =20 -#ifndef LIBVIRT_VIRKEEPALIVE_H -# define LIBVIRT_VIRKEEPALIVE_H +#pragma once =20 -# include "virnetmessage.h" -# include "virobject.h" +#include "virnetmessage.h" +#include "virobject.h" =20 typedef int (*virKeepAliveSendFunc)(void *client, virNetMessagePtr msg); typedef void (*virKeepAliveDeadFunc)(void *client); @@ -52,5 +51,3 @@ bool virKeepAliveTrigger(virKeepAlivePtr ka, bool virKeepAliveCheckMessage(virKeepAlivePtr ka, virNetMessagePtr msg, virNetMessagePtr *response); - -#endif /* LIBVIRT_VIRKEEPALIVE_H */ diff --git a/src/rpc/virnetclient.h b/src/rpc/virnetclient.h index 40c7df9f5d..07b399c1a9 100644 --- a/src/rpc/virnetclient.h +++ b/src/rpc/virnetclient.h @@ -18,20 +18,19 @@ * . */ =20 -#ifndef LIBVIRT_VIRNETCLIENT_H -# define LIBVIRT_VIRNETCLIENT_H - -# ifdef WITH_GNUTLS -# include "virnettlscontext.h" -# endif -# include "virnetmessage.h" -# ifdef WITH_SASL -# include "virnetsaslcontext.h" -# endif -# include "virnetclientprogram.h" -# include "virnetclientstream.h" -# include "virobject.h" -# include "viruri.h" +#pragma once + +#ifdef WITH_GNUTLS +# include "virnettlscontext.h" +#endif +#include "virnetmessage.h" +#ifdef WITH_SASL +# include "virnetsaslcontext.h" +#endif +#include "virnetclientprogram.h" +#include "virnetclientstream.h" +#include "virobject.h" +#include "viruri.h" =20 =20 virNetClientPtr virNetClientNewUNIX(const char *path, @@ -116,15 +115,15 @@ int virNetClientSendStream(virNetClientPtr client, virNetMessagePtr msg, virNetClientStreamPtr st); =20 -# ifdef WITH_SASL +#ifdef WITH_SASL void virNetClientSetSASLSession(virNetClientPtr client, virNetSASLSessionPtr sasl); -# endif +#endif =20 -# ifdef WITH_GNUTLS +#ifdef WITH_GNUTLS int virNetClientSetTLSSession(virNetClientPtr client, virNetTLSContextPtr tls); -# endif +#endif =20 bool virNetClientIsEncrypted(virNetClientPtr client); bool virNetClientIsOpen(virNetClientPtr client); @@ -132,9 +131,9 @@ bool virNetClientIsOpen(virNetClientPtr client); const char *virNetClientLocalAddrStringSASL(virNetClientPtr client); const char *virNetClientRemoteAddrStringSASL(virNetClientPtr client); =20 -# ifdef WITH_GNUTLS +#ifdef WITH_GNUTLS int virNetClientGetTLSKeySize(virNetClientPtr client); -# endif +#endif =20 void virNetClientClose(virNetClientPtr client); =20 @@ -144,5 +143,3 @@ int virNetClientKeepAliveStart(virNetClientPtr client, unsigned int count); =20 void virNetClientKeepAliveStop(virNetClientPtr client); - -#endif /* LIBVIRT_VIRNETCLIENT_H */ diff --git a/src/rpc/virnetclientprogram.h b/src/rpc/virnetclientprogram.h index 36d331cbf0..1ac0f30023 100644 --- a/src/rpc/virnetclientprogram.h +++ b/src/rpc/virnetclientprogram.h @@ -18,14 +18,13 @@ * . */ =20 -#ifndef LIBVIRT_VIRNETCLIENTPROGRAM_H -# define LIBVIRT_VIRNETCLIENTPROGRAM_H +#pragma once =20 -# include -# include +#include +#include =20 -# include "virnetmessage.h" -# include "virobject.h" +#include "virnetmessage.h" +#include "virobject.h" =20 typedef struct _virNetClient virNetClient; typedef virNetClient *virNetClientPtr; @@ -78,7 +77,3 @@ int virNetClientProgramCall(virNetClientProgramPtr prog, int **infds, xdrproc_t args_filter, void *args, xdrproc_t ret_filter, void *ret); - - - -#endif /* LIBVIRT_VIRNETCLIENTPROGRAM_H */ diff --git a/src/rpc/virnetclientstream.h b/src/rpc/virnetclientstream.h index 33a2af357f..166adb0b22 100644 --- a/src/rpc/virnetclientstream.h +++ b/src/rpc/virnetclientstream.h @@ -18,11 +18,10 @@ * . */ =20 -#ifndef LIBVIRT_VIRNETCLIENTSTREAM_H -# define LIBVIRT_VIRNETCLIENTSTREAM_H +#pragma once =20 -# include "virnetclientprogram.h" -# include "virobject.h" +#include "virnetclientprogram.h" +#include "virobject.h" =20 typedef struct _virNetClientStream virNetClientStream; typedef virNetClientStream *virNetClientStreamPtr; @@ -92,5 +91,3 @@ int virNetClientStreamEventRemoveCallback(virNetClientStr= eamPtr st); =20 bool virNetClientStreamEOF(virNetClientStreamPtr st) ATTRIBUTE_NONNULL(1); - -#endif /* LIBVIRT_VIRNETCLIENTSTREAM_H */ diff --git a/src/rpc/virnetdaemon.h b/src/rpc/virnetdaemon.h index 2ad85f265b..b7511ffd27 100644 --- a/src/rpc/virnetdaemon.h +++ b/src/rpc/virnetdaemon.h @@ -18,18 +18,17 @@ * . */ =20 -#ifndef LIBVIRT_VIRNETDAEMON_H -# define LIBVIRT_VIRNETDAEMON_H +#pragma once =20 -# include +#include =20 -# include "virnettlscontext.h" -# include "virobject.h" -# include "virjson.h" -# include "virnetserverprogram.h" -# include "virnetserverclient.h" -# include "virnetserverservice.h" -# include "virnetserver.h" +#include "virnettlscontext.h" +#include "virobject.h" +#include "virjson.h" +#include "virnetserverprogram.h" +#include "virnetserverclient.h" +#include "virnetserverservice.h" +#include "virnetserver.h" =20 virNetDaemonPtr virNetDaemonNew(void); =20 @@ -81,5 +80,3 @@ virNetServerPtr virNetDaemonGetServer(virNetDaemonPtr dmn, ssize_t virNetDaemonGetServers(virNetDaemonPtr dmn, virNetServerPtr **serv= ers); bool virNetDaemonHasServer(virNetDaemonPtr dmn, const char *serverName); - -#endif /* LIBVIRT_VIRNETDAEMON_H */ diff --git a/src/rpc/virnetlibsshsession.h b/src/rpc/virnetlibsshsession.h index bb89267835..231c2591b2 100644 --- a/src/rpc/virnetlibsshsession.h +++ b/src/rpc/virnetlibsshsession.h @@ -18,11 +18,10 @@ * . */ =20 -#ifndef LIBVIRT_VIRNETLIBSSHSESSION_H -# define LIBVIRT_VIRNETLIBSSHSESSION_H +#pragma once =20 -# include "internal.h" -# include "viruri.h" +#include "internal.h" +#include "viruri.h" =20 typedef struct _virNetLibsshSession virNetLibsshSession; typedef virNetLibsshSession *virNetLibsshSessionPtr; @@ -72,5 +71,3 @@ ssize_t virNetLibsshChannelWrite(virNetLibsshSessionPtr s= ess, size_t len); =20 bool virNetLibsshSessionHasCachedData(virNetLibsshSessionPtr sess); - -#endif /* LIBVIRT_VIRNETLIBSSHSESSION_H */ diff --git a/src/rpc/virnetmessage.h b/src/rpc/virnetmessage.h index c787eecb7d..748421a9fd 100644 --- a/src/rpc/virnetmessage.h +++ b/src/rpc/virnetmessage.h @@ -18,10 +18,9 @@ * . */ =20 -#ifndef LIBVIRT_VIRNETMESSAGE_H -# define LIBVIRT_VIRNETMESSAGE_H +#pragma once =20 -# include "virnetprotocol.h" +#include "virnetprotocol.h" =20 typedef struct virNetMessageHeader *virNetMessageHeaderPtr; typedef struct virNetMessageError *virNetMessageErrorPtr; @@ -100,5 +99,3 @@ int virNetMessageDupFD(virNetMessagePtr msg, =20 int virNetMessageAddFD(virNetMessagePtr msg, int fd); - -#endif /* LIBVIRT_VIRNETMESSAGE_H */ diff --git a/src/rpc/virnetsaslcontext.h b/src/rpc/virnetsaslcontext.h index 6d8f16ecd0..4d1845e643 100644 --- a/src/rpc/virnetsaslcontext.h +++ b/src/rpc/virnetsaslcontext.h @@ -18,13 +18,12 @@ * . */ =20 -#ifndef LIBVIRT_VIRNETSASLCONTEXT_H -# define LIBVIRT_VIRNETSASLCONTEXT_H +#pragma once =20 -# include "internal.h" -# include +#include "internal.h" +#include =20 -# include "virobject.h" +#include "virobject.h" =20 typedef struct _virNetSASLContext virNetSASLContext; typedef virNetSASLContext *virNetSASLContextPtr; @@ -109,5 +108,3 @@ ssize_t virNetSASLSessionDecode(virNetSASLSessionPtr sa= sl, size_t inputLen, const char **output, size_t *outputlen); - -#endif /* LIBVIRT_VIRNETSASLCONTEXT_H */ diff --git a/src/rpc/virnetserver.h b/src/rpc/virnetserver.h index 92a856fb03..e46a717c15 100644 --- a/src/rpc/virnetserver.h +++ b/src/rpc/virnetserver.h @@ -19,15 +19,14 @@ * . */ =20 -#ifndef LIBVIRT_VIRNETSERVER_H -# define LIBVIRT_VIRNETSERVER_H +#pragma once =20 -# include "virnettlscontext.h" -# include "virnetserverprogram.h" -# include "virnetserverclient.h" -# include "virnetserverservice.h" -# include "virobject.h" -# include "virjson.h" +#include "virnettlscontext.h" +#include "virnetserverprogram.h" +#include "virnetserverclient.h" +#include "virnetserverservice.h" +#include "virobject.h" +#include "virjson.h" =20 =20 virNetServerPtr virNetServerNew(const char *name, @@ -112,5 +111,3 @@ size_t virNetServerGetCurrentUnauthClients(virNetServer= Ptr srv); int virNetServerSetClientLimits(virNetServerPtr srv, long long int maxClients, long long int maxClientsUnauth); - -#endif /* LIBVIRT_VIRNETSERVER_H */ diff --git a/src/rpc/virnetserverclient.h b/src/rpc/virnetserverclient.h index 2d6fa7ec56..1b01bedbcb 100644 --- a/src/rpc/virnetserverclient.h +++ b/src/rpc/virnetserverclient.h @@ -19,14 +19,13 @@ * . */ =20 -#ifndef LIBVIRT_VIRNETSERVERCLIENT_H -# define LIBVIRT_VIRNETSERVERCLIENT_H +#pragma once =20 -# include "viridentity.h" -# include "virnetsocket.h" -# include "virnetmessage.h" -# include "virobject.h" -# include "virjson.h" +#include "viridentity.h" +#include "virnetsocket.h" +#include "virnetmessage.h" +#include "virobject.h" +#include "virjson.h" =20 typedef struct _virNetServer virNetServer; typedef virNetServer *virNetServerPtr; @@ -103,12 +102,12 @@ bool virNetServerClientHasTLSSession(virNetServerClie= ntPtr client); virNetTLSSessionPtr virNetServerClientGetTLSSession(virNetServerClientPtr = client); int virNetServerClientGetTLSKeySize(virNetServerClientPtr client); =20 -# ifdef WITH_SASL +#ifdef WITH_SASL bool virNetServerClientHasSASLSession(virNetServerClientPtr client); void virNetServerClientSetSASLSession(virNetServerClientPtr client, virNetSASLSessionPtr sasl); virNetSASLSessionPtr virNetServerClientGetSASLSession(virNetServerClientPt= r client); -# endif +#endif =20 int virNetServerClientGetFD(virNetServerClientPtr client); =20 @@ -169,5 +168,3 @@ int virNetServerClientGetInfo(virNetServerClientPtr cli= ent, virIdentityPtr *identity); =20 void virNetServerClientSetQuietEOF(virNetServerClientPtr client); - -#endif /* LIBVIRT_VIRNETSERVERCLIENT_H */ diff --git a/src/rpc/virnetservermdns.h b/src/rpc/virnetservermdns.h index 64511a65c8..5f8e4da581 100644 --- a/src/rpc/virnetservermdns.h +++ b/src/rpc/virnetservermdns.h @@ -21,10 +21,9 @@ * . */ =20 -#ifndef LIBVIRT_VIRNETSERVERMDNS_H -# define LIBVIRT_VIRNETSERVERMDNS_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 typedef struct _virNetServerMDNS virNetServerMDNS; typedef virNetServerMDNS *virNetServerMDNSPtr; @@ -103,5 +102,3 @@ void virNetServerMDNSRemoveEntry(virNetServerMDNSGroupP= tr group, void virNetServerMDNSFree(virNetServerMDNSPtr ptr); void virNetServerMDNSGroupFree(virNetServerMDNSGroupPtr ptr); void virNetServerMDNSEntryFree(virNetServerMDNSEntryPtr ptr); - -#endif /* LIBVIRT_VIRNETSERVERMDNS_H */ diff --git a/src/rpc/virnetserverprogram.h b/src/rpc/virnetserverprogram.h index b37fc40c9b..851bbf0183 100644 --- a/src/rpc/virnetserverprogram.h +++ b/src/rpc/virnetserverprogram.h @@ -19,12 +19,11 @@ * . */ =20 -#ifndef LIBVIRT_VIRNETSERVERPROGRAM_H -# define LIBVIRT_VIRNETSERVERPROGRAM_H +#pragma once =20 -# include "virnetmessage.h" -# include "virnetserverclient.h" -# include "virobject.h" +#include "virnetmessage.h" +#include "virnetserverclient.h" +#include "virobject.h" =20 typedef struct _virNetDaemon virNetDaemon; typedef virNetDaemon *virNetDaemonPtr; @@ -106,5 +105,3 @@ int virNetServerProgramSendStreamHole(virNetServerProgr= amPtr prog, unsigned int serial, long long length, unsigned int flags); - -#endif /* LIBVIRT_VIRNETSERVERPROGRAM_H */ diff --git a/src/rpc/virnetserverservice.h b/src/rpc/virnetserverservice.h index 5c73bdeab1..5dd22bd929 100644 --- a/src/rpc/virnetserverservice.h +++ b/src/rpc/virnetserverservice.h @@ -19,11 +19,10 @@ * . */ =20 -#ifndef LIBVIRT_VIRNETSERVERSERVICE_H -# define LIBVIRT_VIRNETSERVERSERVICE_H +#pragma once =20 -# include "virnetserverprogram.h" -# include "virobject.h" +#include "virnetserverprogram.h" +#include "virobject.h" =20 typedef enum { VIR_NET_SERVER_SERVICE_AUTH_NONE =3D 0, @@ -87,5 +86,3 @@ void virNetServerServiceToggle(virNetServerServicePtr svc, bool enabled); =20 void virNetServerServiceClose(virNetServerServicePtr svc); - -#endif /* LIBVIRT_VIRNETSERVERSERVICE_H */ diff --git a/src/rpc/virnetsocket.h b/src/rpc/virnetsocket.h index 334036aafc..343c8f43e0 100644 --- a/src/rpc/virnetsocket.h +++ b/src/rpc/virnetsocket.h @@ -19,20 +19,19 @@ * . */ =20 -#ifndef LIBVIRT_VIRNETSOCKET_H -# define LIBVIRT_VIRNETSOCKET_H - -# include "virsocketaddr.h" -# include "vircommand.h" -# ifdef WITH_GNUTLS -# include "virnettlscontext.h" -# endif -# include "virobject.h" -# ifdef WITH_SASL -# include "virnetsaslcontext.h" -# endif -# include "virjson.h" -# include "viruri.h" +#pragma once + +#include "virsocketaddr.h" +#include "vircommand.h" +#ifdef WITH_GNUTLS +# include "virnettlscontext.h" +#endif +#include "virobject.h" +#ifdef WITH_SASL +# include "virnetsaslcontext.h" +#endif +#include "virjson.h" +#include "viruri.h" =20 typedef struct _virNetSocket virNetSocket; typedef virNetSocket *virNetSocketPtr; @@ -151,15 +150,15 @@ ssize_t virNetSocketWrite(virNetSocketPtr sock, const= char *buf, size_t len); int virNetSocketSendFD(virNetSocketPtr sock, int fd); int virNetSocketRecvFD(virNetSocketPtr sock, int *fd); =20 -# ifdef WITH_GNUTLS +#ifdef WITH_GNUTLS void virNetSocketSetTLSSession(virNetSocketPtr sock, virNetTLSSessionPtr sess); -# endif +#endif =20 -# ifdef WITH_SASL +#ifdef WITH_SASL void virNetSocketSetSASLSession(virNetSocketPtr sock, virNetSASLSessionPtr sess); -# endif +#endif bool virNetSocketHasCachedData(virNetSocketPtr sock); bool virNetSocketHasPendingData(virNetSocketPtr sock); =20 @@ -183,6 +182,3 @@ void virNetSocketUpdateIOCallback(virNetSocketPtr sock, void virNetSocketRemoveIOCallback(virNetSocketPtr sock); =20 void virNetSocketClose(virNetSocketPtr sock); - - -#endif /* LIBVIRT_VIRNETSOCKET_H */ diff --git a/src/rpc/virnetsshsession.h b/src/rpc/virnetsshsession.h index 840054c51a..0101489302 100644 --- a/src/rpc/virnetsshsession.h +++ b/src/rpc/virnetsshsession.h @@ -18,11 +18,10 @@ * . */ =20 -#ifndef LIBVIRT_VIRNETSSHSESSION_H -# define LIBVIRT_VIRNETSSHSESSION_H +#pragma once =20 -# include "internal.h" -# include "viruri.h" +#include "internal.h" +#include "viruri.h" =20 typedef struct _virNetSSHSession virNetSSHSession; typedef virNetSSHSession *virNetSSHSessionPtr; @@ -84,5 +83,3 @@ ssize_t virNetSSHChannelWrite(virNetSSHSessionPtr sess, size_t len); =20 bool virNetSSHSessionHasCachedData(virNetSSHSessionPtr sess); - -#endif /* LIBVIRT_VIRNETSSHSESSION_H */ diff --git a/src/rpc/virnettlscontext.h b/src/rpc/virnettlscontext.h index 82ecd8267d..f3273bc26a 100644 --- a/src/rpc/virnettlscontext.h +++ b/src/rpc/virnettlscontext.h @@ -18,11 +18,10 @@ * . */ =20 -#ifndef LIBVIRT_VIRNETTLSCONTEXT_H -# define LIBVIRT_VIRNETTLSCONTEXT_H +#pragma once =20 -# include "internal.h" -# include "virobject.h" +#include "internal.h" +#include "virobject.h" =20 typedef struct _virNetTLSContext virNetTLSContext; typedef virNetTLSContext *virNetTLSContextPtr; @@ -99,5 +98,3 @@ virNetTLSSessionGetHandshakeStatus(virNetTLSSessionPtr se= ss); int virNetTLSSessionGetKeySize(virNetTLSSessionPtr sess); =20 const char *virNetTLSSessionGetX509DName(virNetTLSSessionPtr sess); - -#endif /* LIBVIRT_VIRNETTLSCONTEXT_H */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560874514; cv=none; d=zoho.com; s=zohoarc; b=jlmmp4b/0hjUl2C4ryF9qs3+OqUUyUs2oJM4DeYV7fGD4MVzigDotEu+fyzdswKQfcVr30n5qAtJFP/684923A+J9L6Dh2PSUvjso3itcHPhhn4CurJbJpALYAT0YweiIr9o9FLlTGlRLq5+3W3eZHu6JmAueraXYccx42N7PRI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560874514; 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=K5jFziKumuF76au/Kj8ZGAH9FqFscgV82VCrQV61rgw=; b=E4111RHGqsWl8RaKN31RKZCxw5SK3tmPVSjmCxoL89GenjYwzx7al+wAyw50cFdpzGDhLbUvS8qXS0mcCTOHMcfwRiTVmqHRR5hORSL7ByQIaXEUVzuxlDtolOU2l42zpOemGICpfqf4puseErP+efAeRSbdm1JBwX5Z5OGlW9U= 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 1560874514319752.32245752502; Tue, 18 Jun 2019 09:15:14 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 52E783E2B0; Tue, 18 Jun 2019 16:15:07 +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 0F2B21001E84; Tue, 18 Jun 2019 16:15:06 +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 728F61806B1D; Tue, 18 Jun 2019 16:15:02 +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 x5IGDR7W024174 for ; Tue, 18 Jun 2019 12:13:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7EC0784EF; Tue, 18 Jun 2019 16:13:27 +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 4CD7360FAB for ; Tue, 18 Jun 2019 16:13:27 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:12:40 -0500 Message-Id: <20190618161316.1722-11-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 10/46] src/secret: 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.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 18 Jun 2019 16:15:13 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/secret/secret_driver.h | 5 +---- src/secret/secret_util.h | 8 +++----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/secret/secret_driver.h b/src/secret/secret_driver.h index b7e46ee045..3dcf420792 100644 --- a/src/secret/secret_driver.h +++ b/src/secret/secret_driver.h @@ -18,9 +18,6 @@ * . */ =20 -#ifndef LIBVIRT_SECRET_DRIVER_H -# define LIBVIRT_SECRET_DRIVER_H +#pragma once =20 int secretRegister(void); - -#endif /* LIBVIRT_SECRET_DRIVER_H */ diff --git a/src/secret/secret_util.h b/src/secret/secret_util.h index 7219707390..4fe8f98aa5 100644 --- a/src/secret/secret_util.h +++ b/src/secret/secret_util.h @@ -19,11 +19,10 @@ * */ =20 -#ifndef LIBVIRT_SECRET_UTIL_H -# define LIBVIRT_SECRET_UTIL_H +#pragma once =20 -# include "internal.h" -# include "virsecret.h" +#include "internal.h" +#include "virsecret.h" =20 int virSecretGetSecretString(virConnectPtr conn, virSecretLookupTypeDefPtr seclookupdef, @@ -32,4 +31,3 @@ int virSecretGetSecretString(virConnectPtr conn, size_t *ret_secret_size) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5) ATTRIBUTE_RETURN_CHECK; -#endif /* LIBVIRT_SECRET_UTIL_H */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560874533; cv=none; d=zoho.com; s=zohoarc; b=B2xc9qxv9zRoEyAzwD18zWTT22syfX/nBTfyInUrJmsnzlV+QmiHrhRo6WizoqP5mXWUG/Fn2YjrI23uIAgamNGfgDWuqsibvREBHy9oXU8BMYxUBm35z471Mrg6pVGrEcnFC6fdxIZ8x+qzTt0RYOFQ9lFMckoE85R3YRIHOfY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560874533; 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=qY6ToiO6XzmcvNsl+txpId14qCtu1j7W42KpzX3CR00=; b=mNYrGHy8JRys1ObaZ0yEBB51MyDQA7rzHDZtaSBKxiy3yIQmA7ynO/uSL2VMvP7tj+ep1LZJUa5YUn9rO95+fUUSQtzqKqCHs6ZtrJGkGcfcns8ME7U0TX5ZwlE6d+nohQJiswtCvzCoh6FUz3x2z3VF/Ty8fLFD0WRWZw3v7Vs= 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 1560874533562176.12441008959377; Tue, 18 Jun 2019 09:15:33 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ECE2230024A4; Tue, 18 Jun 2019 16:15:31 +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 C205E1001DDA; Tue, 18 Jun 2019 16:15: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 854891806B1D; Tue, 18 Jun 2019 16:15:29 +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 x5IGDRPM024179 for ; Tue, 18 Jun 2019 12:13:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id D037660FAB; Tue, 18 Jun 2019 16:13:27 +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 9DC6E5C2E4 for ; Tue, 18 Jun 2019 16:13:27 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:12:41 -0500 Message-Id: <20190618161316.1722-12-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 11/46] src/security: 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.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Tue, 18 Jun 2019 16:15:32 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/security/security_apparmor.h | 13 +++++-------- src/security/security_dac.h | 7 ++----- src/security/security_driver.h | 11 ++++------- src/security/security_manager.h | 13 +++++-------- src/security/security_nop.h | 7 ++----- src/security/security_selinux.h | 5 +---- src/security/security_stack.h | 7 ++----- src/security/security_util.h | 5 +---- 8 files changed, 22 insertions(+), 46 deletions(-) diff --git a/src/security/security_apparmor.h b/src/security/security_appar= mor.h index 730f72ff98..7b54eefd8d 100644 --- a/src/security/security_apparmor.h +++ b/src/security/security_apparmor.h @@ -16,15 +16,12 @@ * . */ =20 -#ifndef LIBVIRT_SECURITY_APPARMOR_H -# define LIBVIRT_SECURITY_APPARMOR_H +#pragma once =20 -# include "security_driver.h" +#include "security_driver.h" =20 extern virSecurityDriver virAppArmorSecurityDriver; =20 -# define AA_PREFIX "libvirt-" -# define PROFILE_NAME_SIZE 8 + VIR_UUID_STRING_BUFLEN /* AA_PREFIX + uuid= */ -# define MAX_FILE_LEN (1024*1024*10) /* 10MB limit for sanity check= */ - -#endif /* LIBVIRT_SECURITY_APPARMOR_H */ +#define AA_PREFIX "libvirt-" +#define PROFILE_NAME_SIZE 8 + VIR_UUID_STRING_BUFLEN /* AA_PREFIX + uuid = */ +#define MAX_FILE_LEN (1024*1024*10) /* 10MB limit for sanity check = */ diff --git a/src/security/security_dac.h b/src/security/security_dac.h index 318ca06d75..444e5dcf89 100644 --- a/src/security/security_dac.h +++ b/src/security/security_dac.h @@ -18,10 +18,9 @@ * POSIX DAC security driver */ =20 -#ifndef LIBVIRT_SECURITY_DAC_H -# define LIBVIRT_SECURITY_DAC_H +#pragma once =20 -# include "security_driver.h" +#include "security_driver.h" =20 extern virSecurityDriver virSecurityDriverDAC; =20 @@ -37,5 +36,3 @@ void virSecurityDACSetMountNamespace(virSecurityManagerPt= r mgr, =20 void virSecurityDACSetChownCallback(virSecurityManagerPtr mgr, virSecurityManagerDACChownCallback cho= wnCallback); - -#endif /* LIBVIRT_SECURITY_DAC_H */ diff --git a/src/security/security_driver.h b/src/security/security_driver.h index 36cf9da037..9d0ab4e14a 100644 --- a/src/security/security_driver.h +++ b/src/security/security_driver.h @@ -16,13 +16,12 @@ * . */ =20 -#ifndef LIBVIRT_SECURITY_DRIVER_H -# define LIBVIRT_SECURITY_DRIVER_H +#pragma once =20 -# include "internal.h" -# include "domain_conf.h" +#include "internal.h" +#include "domain_conf.h" =20 -# include "security_manager.h" +#include "security_manager.h" =20 /* * Return values for security driver probing: the driver will determine @@ -216,5 +215,3 @@ struct _virSecurityDriver { =20 virSecurityDriverPtr virSecurityDriverLookup(const char *name, const char *virtDriver); - -#endif /* LIBVIRT_SECURITY_DRIVER_H */ diff --git a/src/security/security_manager.h b/src/security/security_manage= r.h index 7e174a33ee..88ed9919a2 100644 --- a/src/security/security_manager.h +++ b/src/security/security_manager.h @@ -18,12 +18,11 @@ * . */ =20 -#ifndef LIBVIRT_SECURITY_MANAGER_H -# define LIBVIRT_SECURITY_MANAGER_H +#pragma once =20 -# include "domain_conf.h" -# include "vircommand.h" -# include "virstoragefile.h" +#include "domain_conf.h" +#include "vircommand.h" +#include "virstoragefile.h" =20 typedef struct _virSecurityManager virSecurityManager; typedef virSecurityManager *virSecurityManagerPtr; @@ -36,7 +35,7 @@ typedef enum { VIR_SECURITY_MANAGER_MOUNT_NAMESPACE =3D 1 << 5, } virSecurityManagerNewFlags; =20 -# define VIR_SECURITY_MANAGER_NEW_MASK \ +#define VIR_SECURITY_MANAGER_NEW_MASK \ (VIR_SECURITY_MANAGER_DEFAULT_CONFINED | \ VIR_SECURITY_MANAGER_REQUIRE_CONFINED | \ VIR_SECURITY_MANAGER_PRIVILEGED) @@ -207,5 +206,3 @@ virSecurityManagerMetadataLock(virSecurityManagerPtr mg= r, void virSecurityManagerMetadataUnlock(virSecurityManagerPtr mgr, virSecurityManagerMetadataLockStatePtr *s= tate); - -#endif /* LIBVIRT_SECURITY_MANAGER_H */ diff --git a/src/security/security_nop.h b/src/security/security_nop.h index 31e46420b1..94ced9802c 100644 --- a/src/security/security_nop.h +++ b/src/security/security_nop.h @@ -17,11 +17,8 @@ * */ =20 -#ifndef LIBVIRT_SECURITY_NOP_H -# define LIBVIRT_SECURITY_NOP_H +#pragma once =20 -# include "security_driver.h" +#include "security_driver.h" =20 extern virSecurityDriver virSecurityDriverNop; - -#endif /* LIBVIRT_SECURITY_NOP_H */ diff --git a/src/security/security_selinux.h b/src/security/security_selinu= x.h index dfd2b73baa..eb992bd53b 100644 --- a/src/security/security_selinux.h +++ b/src/security/security_selinux.h @@ -16,9 +16,6 @@ * . */ =20 -#ifndef LIBVIRT_SECURITY_SELINUX_H -# define LIBVIRT_SECURITY_SELINUX_H +#pragma once =20 extern virSecurityDriver virSecurityDriverSELinux; - -#endif /* LIBVIRT_SECURITY_SELINUX_H */ diff --git a/src/security/security_stack.h b/src/security/security_stack.h index 8c264d967a..e35f149bed 100644 --- a/src/security/security_stack.h +++ b/src/security/security_stack.h @@ -18,10 +18,9 @@ * Stacked security driver */ =20 -#ifndef LIBVIRT_SECURITY_STACK_H -# define LIBVIRT_SECURITY_STACK_H +#pragma once =20 -# include "security_driver.h" +#include "security_driver.h" =20 extern virSecurityDriver virSecurityDriverStack; =20 @@ -34,5 +33,3 @@ virSecurityStackGetPrimary(virSecurityManagerPtr mgr); =20 virSecurityManagerPtr* virSecurityStackGetNested(virSecurityManagerPtr mgr); - -#endif /* LIBVIRT_SECURITY_STACK_H */ diff --git a/src/security/security_util.h b/src/security/security_util.h index bc977ed65d..aacac5c64c 100644 --- a/src/security/security_util.h +++ b/src/security/security_util.h @@ -16,8 +16,7 @@ * . */ =20 -#ifndef LIBVIRT_SECURITY_UTIL_H -# define LIBVIRT_SECURITY_UTIL_H +#pragma once =20 int virSecurityGetRememberedLabel(const char *name, @@ -28,5 +27,3 @@ int virSecuritySetRememberedLabel(const char *name, const char *path, const char *label); - -#endif /* LIBVIRT_SECURITY_UTIL_H */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560876088; cv=none; d=zoho.com; s=zohoarc; b=H6QoE0+TlPRyvmt6jAEwksaOuf+sYUv/2AF9q0aZna6qYAUp5CrMEVpGVILwqtdTe7b0G9JRWxZsdlFqvb4gGM1Y43REJkA2GiBRDimY80UXeZUf846cCu8H7swpgPUG9lBA+w3o0EJgdOFHvSg0HBwygxsdJSC7K74TCmzgX8w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560876088; 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=ei9ZBdTs2gCGq+bJgzUdpQ+WS0MEPeU6vblkjUaxsbU=; b=khzsLZHrSWwnP+GZTM+ee9tYyA5BGHfJjFn6L6qhRmZuUU+dKFSva9aqp7bh5PbDoqex/NONHzgVAmpuTC9yFe/quo0tCZD7+0INGkz8rt3fQnnCCZtZoLe7vIxl2XtJeAjPTbOt3w3n+xgSNHHa6DdveD8qk9//rT6VH3YXN40= 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 1560876088911835.280265347271; Tue, 18 Jun 2019 09:41:28 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 2802AA14DE; Tue, 18 Jun 2019 16:41:25 +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 0364B5C221; Tue, 18 Jun 2019 16:41:24 +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 BDCCC206D6; Tue, 18 Jun 2019 16:41:22 +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 x5IGDSud024189 for ; Tue, 18 Jun 2019 12:13:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2C5EB84EF; Tue, 18 Jun 2019 16:13:28 +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 EECF860FAB for ; Tue, 18 Jun 2019 16:13:27 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:12:42 -0500 Message-Id: <20190618161316.1722-13-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 12/46] src/storage: 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.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 18 Jun 2019 16:41:27 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/storage/storage_backend.h | 13 ++++----- src/storage/storage_backend_disk.h | 5 +--- src/storage/storage_backend_fs.h | 5 +--- src/storage/storage_backend_gluster.h | 5 +--- src/storage/storage_backend_iscsi.h | 5 +--- src/storage/storage_backend_iscsi_direct.h | 5 +--- src/storage/storage_backend_logical.h | 5 +--- src/storage/storage_backend_mpath.h | 5 +--- src/storage/storage_backend_rbd.h | 5 +--- src/storage/storage_backend_scsi.h | 5 +--- src/storage/storage_backend_sheepdog.h | 5 +--- src/storage/storage_backend_sheepdog_priv.h | 7 ++--- src/storage/storage_backend_vstorage.h | 5 +--- src/storage/storage_backend_zfs.h | 5 +--- src/storage/storage_driver.h | 11 +++----- src/storage/storage_file_fs.h | 5 +--- src/storage/storage_file_gluster.h | 5 +--- src/storage/storage_util.h | 31 ++++++++++----------- 18 files changed, 39 insertions(+), 93 deletions(-) diff --git a/src/storage/storage_backend.h b/src/storage/storage_backend.h index c670c66287..86763a9e30 100644 --- a/src/storage/storage_backend.h +++ b/src/storage/storage_backend.h @@ -16,14 +16,13 @@ * . */ =20 -#ifndef LIBVIRT_STORAGE_BACKEND_H -# define LIBVIRT_STORAGE_BACKEND_H +#pragma once =20 -# include +#include =20 -# include "internal.h" -# include "virstorageobj.h" -# include "storage_driver.h" +#include "internal.h" +#include "virstorageobj.h" +#include "storage_driver.h" =20 typedef char * (*virStorageBackendFindPoolSources)(const char *srcSpec, unsigned int flags); @@ -128,5 +127,3 @@ int virStorageBackendRegister(virStorageBackendPtr back= end); =20 virCapsPtr virStorageBackendGetCapabilities(void); - -#endif /* LIBVIRT_STORAGE_BACKEND_H */ diff --git a/src/storage/storage_backend_disk.h b/src/storage/storage_backe= nd_disk.h index 71c3bcaa2b..caa6dfba43 100644 --- a/src/storage/storage_backend_disk.h +++ b/src/storage/storage_backend_disk.h @@ -19,9 +19,6 @@ * . */ =20 -#ifndef LIBVIRT_STORAGE_BACKEND_DISK_H -# define LIBVIRT_STORAGE_BACKEND_DISK_H +#pragma once =20 int virStorageBackendDiskRegister(void); - -#endif /* LIBVIRT_STORAGE_BACKEND_DISK_H */ diff --git a/src/storage/storage_backend_fs.h b/src/storage/storage_backend= _fs.h index 638c16a01e..41cfa1edb0 100644 --- a/src/storage/storage_backend_fs.h +++ b/src/storage/storage_backend_fs.h @@ -19,9 +19,6 @@ * . */ =20 -#ifndef LIBVIRT_STORAGE_BACKEND_FS_H -# define LIBVIRT_STORAGE_BACKEND_FS_H +#pragma once =20 int virStorageBackendFsRegister(void); - -#endif /* LIBVIRT_STORAGE_BACKEND_FS_H */ diff --git a/src/storage/storage_backend_gluster.h b/src/storage/storage_ba= ckend_gluster.h index 586d6e94dd..348f118fb3 100644 --- a/src/storage/storage_backend_gluster.h +++ b/src/storage/storage_backend_gluster.h @@ -19,9 +19,6 @@ * */ =20 -#ifndef LIBVIRT_STORAGE_BACKEND_GLUSTER_H -# define LIBVIRT_STORAGE_BACKEND_GLUSTER_H +#pragma once =20 int virStorageBackendGlusterRegister(void); - -#endif /* LIBVIRT_STORAGE_BACKEND_GLUSTER_H */ diff --git a/src/storage/storage_backend_iscsi.h b/src/storage/storage_back= end_iscsi.h index 4b04d1b81d..4a5b23864e 100644 --- a/src/storage/storage_backend_iscsi.h +++ b/src/storage/storage_backend_iscsi.h @@ -19,9 +19,6 @@ * . */ =20 -#ifndef LIBVIRT_STORAGE_BACKEND_ISCSI_H -# define LIBVIRT_STORAGE_BACKEND_ISCSI_H +#pragma once =20 int virStorageBackendISCSIRegister(void); - -#endif /* LIBVIRT_STORAGE_BACKEND_ISCSI_H */ diff --git a/src/storage/storage_backend_iscsi_direct.h b/src/storage/stora= ge_backend_iscsi_direct.h index 07c8acad9d..b9c025aff7 100644 --- a/src/storage/storage_backend_iscsi_direct.h +++ b/src/storage/storage_backend_iscsi_direct.h @@ -14,9 +14,6 @@ * . */ =20 -#ifndef LIBVIRT_STORAGE_BACKEND_ISCSI_DIRECT_H -# define LIBVIRT_STORAGE_BACKEND_ISCSI_DIRECT_H +#pragma once =20 int virStorageBackendISCSIDirectRegister(void); - -#endif /* LIBVIRT_STORAGE_BACKEND_ISCSI_DIRECT_H */ diff --git a/src/storage/storage_backend_logical.h b/src/storage/storage_ba= ckend_logical.h index 79374c6ca3..60c8a44f23 100644 --- a/src/storage/storage_backend_logical.h +++ b/src/storage/storage_backend_logical.h @@ -19,9 +19,6 @@ * . */ =20 -#ifndef LIBVIRT_STORAGE_BACKEND_LOGICAL_H -# define LIBVIRT_STORAGE_BACKEND_LOGICAL_H +#pragma once =20 int virStorageBackendLogicalRegister(void); - -#endif /* LIBVIRT_STORAGE_BACKEND_LOGICAL_H */ diff --git a/src/storage/storage_backend_mpath.h b/src/storage/storage_back= end_mpath.h index 39afa99964..a797db6dcd 100644 --- a/src/storage/storage_backend_mpath.h +++ b/src/storage/storage_backend_mpath.h @@ -19,9 +19,6 @@ * . */ =20 -#ifndef LIBVIRT_STORAGE_BACKEND_MPATH_H -# define LIBVIRT_STORAGE_BACKEND_MPATH_H +#pragma once =20 int virStorageBackendMpathRegister(void); - -#endif /* LIBVIRT_STORAGE_BACKEND_MPATH_H */ diff --git a/src/storage/storage_backend_rbd.h b/src/storage/storage_backen= d_rbd.h index 1b53d3c65c..e1cfaa0e95 100644 --- a/src/storage/storage_backend_rbd.h +++ b/src/storage/storage_backend_rbd.h @@ -18,9 +18,6 @@ * . */ =20 -#ifndef LIBVIRT_STORAGE_BACKEND_RBD_H -# define LIBVIRT_STORAGE_BACKEND_RBD_H +#pragma once =20 int virStorageBackendRBDRegister(void); - -#endif /* LIBVIRT_STORAGE_BACKEND_RBD_H */ diff --git a/src/storage/storage_backend_scsi.h b/src/storage/storage_backe= nd_scsi.h index 7daa2221db..6c05c15ffc 100644 --- a/src/storage/storage_backend_scsi.h +++ b/src/storage/storage_backend_scsi.h @@ -19,9 +19,6 @@ * . */ =20 -#ifndef LIBVIRT_STORAGE_BACKEND_SCSI_H -# define LIBVIRT_STORAGE_BACKEND_SCSI_H +#pragma once =20 int virStorageBackendSCSIRegister(void); - -#endif /* LIBVIRT_STORAGE_BACKEND_SCSI_H */ diff --git a/src/storage/storage_backend_sheepdog.h b/src/storage/storage_b= ackend_sheepdog.h index e09ad14d1e..e1fde6373b 100644 --- a/src/storage/storage_backend_sheepdog.h +++ b/src/storage/storage_backend_sheepdog.h @@ -20,9 +20,6 @@ * . */ =20 -#ifndef LIBVIRT_STORAGE_BACKEND_SHEEPDOG_H -# define LIBVIRT_STORAGE_BACKEND_SHEEPDOG_H +#pragma once =20 int virStorageBackendSheepdogRegister(void); - -#endif /* LIBVIRT_STORAGE_BACKEND_SHEEPDOG_H */ diff --git a/src/storage/storage_backend_sheepdog_priv.h b/src/storage/stor= age_backend_sheepdog_priv.h index 9f28835934..07a35d1d70 100644 --- a/src/storage/storage_backend_sheepdog_priv.h +++ b/src/storage/storage_backend_sheepdog_priv.h @@ -20,14 +20,11 @@ # error "storage_backend_sheepdog_priv.h may only be included by storage_b= ackend_sheepdog.c or test suites" #endif /* LIBVIRT_STORAGE_BACKEND_SHEEPDOG_PRIV_H_ALLOW */ =20 -#ifndef LIBVIRT_STORAGE_BACKEND_SHEEPDOG_PRIV_H -# define LIBVIRT_STORAGE_BACKEND_SHEEPDOG_PRIV_H +#pragma once =20 -# include "conf/storage_conf.h" +#include "conf/storage_conf.h" =20 int virStorageBackendSheepdogParseNodeInfo(virStoragePoolDefPtr pool, char *output); int virStorageBackendSheepdogParseVdiList(virStorageVolDefPtr vol, char *output); - -#endif /* LIBVIRT_STORAGE_BACKEND_SHEEPDOG_PRIV_H */ diff --git a/src/storage/storage_backend_vstorage.h b/src/storage/storage_b= ackend_vstorage.h index e6f5f821fa..387867f48b 100644 --- a/src/storage/storage_backend_vstorage.h +++ b/src/storage/storage_backend_vstorage.h @@ -18,9 +18,6 @@ * */ =20 -#ifndef LIBVIRT_STORAGE_BACKEND_VSTORAGE_H -# define LIBVIRT_STORAGE_BACKEND_VSTORAGE_H +#pragma once =20 int virStorageBackendVstorageRegister(void); - -#endif /* LIBVIRT_STORAGE_BACKEND_VSTORAGE_H */ diff --git a/src/storage/storage_backend_zfs.h b/src/storage/storage_backen= d_zfs.h index 98388c5fca..28cd680922 100644 --- a/src/storage/storage_backend_zfs.h +++ b/src/storage/storage_backend_zfs.h @@ -19,9 +19,6 @@ * */ =20 -#ifndef LIBVIRT_STORAGE_BACKEND_ZFS_H -# define LIBVIRT_STORAGE_BACKEND_ZFS_H +#pragma once =20 int virStorageBackendZFSRegister(void); - -#endif /* LIBVIRT_STORAGE_BACKEND_ZFS_H */ diff --git a/src/storage/storage_driver.h b/src/storage/storage_driver.h index 75632adee5..64b3d8bbf8 100644 --- a/src/storage/storage_driver.h +++ b/src/storage/storage_driver.h @@ -19,13 +19,12 @@ * . */ =20 -#ifndef LIBVIRT_STORAGE_DRIVER_H -# define LIBVIRT_STORAGE_DRIVER_H +#pragma once =20 -# include +#include =20 -# include "domain_conf.h" -# include "virstorageobj.h" +#include "domain_conf.h" +#include "virstorageobj.h" =20 virStoragePoolObjPtr virStoragePoolObjFindPoolByUUID(const unsigned char *= uuid) ATTRIBUTE_NONNULL(1); @@ -41,5 +40,3 @@ char *virStoragePoolObjBuildTempFilePath(virStoragePoolOb= jPtr obj, =20 int storageRegister(void); int storageRegisterAll(void); - -#endif /* LIBVIRT_STORAGE_DRIVER_H */ diff --git a/src/storage/storage_file_fs.h b/src/storage/storage_file_fs.h index c51c875bc2..86a625232d 100644 --- a/src/storage/storage_file_fs.h +++ b/src/storage/storage_file_fs.h @@ -18,9 +18,6 @@ * . */ =20 -#ifndef LIBVIRT_STORAGE_FILE_FS_H -# define LIBVIRT_STORAGE_FILE_FS_H +#pragma once =20 int virStorageFileFsRegister(void); - -#endif /* LIBVIRT_STORAGE_FILE_FS_H */ diff --git a/src/storage/storage_file_gluster.h b/src/storage/storage_file_= gluster.h index 3e46cd1c1e..1feaf3a8b9 100644 --- a/src/storage/storage_file_gluster.h +++ b/src/storage/storage_file_gluster.h @@ -19,9 +19,6 @@ * */ =20 -#ifndef LIBVIRT_STORAGE_FILE_GLUSTER_H -# define LIBVIRT_STORAGE_FILE_GLUSTER_H +#pragma once =20 int virStorageFileGlusterRegister(void); - -#endif /* LIBVIRT_STORAGE_FILE_GLUSTER_H */ diff --git a/src/storage/storage_util.h b/src/storage/storage_util.h index 8b44b54a3b..6df5928d9b 100644 --- a/src/storage/storage_util.h +++ b/src/storage/storage_util.h @@ -16,15 +16,14 @@ * . */ =20 -#ifndef LIBVIRT_STORAGE_UTIL_H -# define LIBVIRT_STORAGE_UTIL_H +#pragma once =20 -# include +#include =20 -# include "internal.h" -# include "vircommand.h" -# include "storage_driver.h" -# include "storage_backend.h" +#include "internal.h" +#include "vircommand.h" +#include "storage_driver.h" +#include "storage_backend.h" =20 /* Storage Pool Namespace options to share w/ storage_backend_fs.c and * the virStorageBackendFileSystemMountCmd method */ @@ -138,21 +137,21 @@ enum { VIR_STORAGE_VOL_READ_NOERROR =3D 1 << 0, /* ignore *read errors */ }; =20 -# define VIR_STORAGE_VOL_OPEN_DEFAULT (VIR_STORAGE_VOL_OPEN_REG |\ - VIR_STORAGE_VOL_OPEN_BLOCK) +#define VIR_STORAGE_VOL_OPEN_DEFAULT (VIR_STORAGE_VOL_OPEN_REG |\ + VIR_STORAGE_VOL_OPEN_BLOCK) =20 -# define VIR_STORAGE_VOL_FS_OPEN_FLAGS (VIR_STORAGE_VOL_OPEN_DEFAULT | \ - VIR_STORAGE_VOL_OPEN_DIR) -# define VIR_STORAGE_VOL_FS_PROBE_FLAGS (VIR_STORAGE_VOL_FS_OPEN_FLAGS |= \ - VIR_STORAGE_VOL_OPEN_NOERROR) +#define VIR_STORAGE_VOL_FS_OPEN_FLAGS (VIR_STORAGE_VOL_OPEN_DEFAULT | \ + VIR_STORAGE_VOL_OPEN_DIR) +#define VIR_STORAGE_VOL_FS_PROBE_FLAGS (VIR_STORAGE_VOL_FS_OPEN_FLAGS | \ + VIR_STORAGE_VOL_OPEN_NOERROR) =20 int virStorageBackendVolOpen(const char *path, struct stat *sb, unsigned int flags) ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); =20 -# define VIR_STORAGE_DEFAULT_POOL_PERM_MODE 0711 -# define VIR_STORAGE_DEFAULT_VOL_PERM_MODE 0600 +#define VIR_STORAGE_DEFAULT_POOL_PERM_MODE 0711 +#define VIR_STORAGE_DEFAULT_VOL_PERM_MODE 0600 =20 int virStorageBackendUpdateVolInfo(virStorageVolDefPtr vol, bool withBlockVolFormat, @@ -203,5 +202,3 @@ virCommandPtr virStorageBackendLogicalChangeCmd(const char *cmdstr, virStoragePoolDefPtr def, bool on); - -#endif /* LIBVIRT_STORAGE_UTIL_H */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560876093; cv=none; d=zoho.com; s=zohoarc; b=eC8RSrIgCBlvcNqf0tmsc5bfgW6Is4Qe5/BKf0N7FieSzjxTrZYCzjUcCJC+rVWHRB6XJa0OGCKIBNWfKup+6D80C5Pdc7QBjjm0LS+u0NHCHcq3FWS3cPNPBp+ClTVywbDvJiB2wU0TMbeILaxJz5qHdf/5J9HFtd6BXNOi2Co= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560876093; 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=PDe9aBkDlTNFtgAqG6m3WNtP6xS0569WJcO1lOAxSkE=; b=G3+Xwm8NOrizq7zovIo77KkbwtmfKjo0fOZJ/hf53L1Pqv5Uo3WFvvTt0LcPwwezPC0RvvlsY6AO4UULD1vDAgpYiMWYUpROkWB+yK0InaB1PqLYBnmQ6gqwHvL/oSZ5wLCJPDOjDIOgjtWDEaXOyXbar+gfKgrigz0YVatohTg= 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 1560876093580804.7008951241303; Tue, 18 Jun 2019 09:41:33 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 11CF83082B6B; Tue, 18 Jun 2019 16:41:32 +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 D7C945C2E6; Tue, 18 Jun 2019 16:41: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 95C4A206D7; Tue, 18 Jun 2019 16:41:29 +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 x5IGDSta024199 for ; Tue, 18 Jun 2019 12:13:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7E5F360FAB; Tue, 18 Jun 2019 16:13:28 +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 4BA1284EF for ; Tue, 18 Jun 2019 16:13:28 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:12:43 -0500 Message-Id: <20190618161316.1722-14-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 13/46] src/test: 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.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Tue, 18 Jun 2019 16:41:32 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/test/test_driver.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/test/test_driver.h b/src/test/test_driver.h index ff7803da7f..8c8a462db7 100644 --- a/src/test/test_driver.h +++ b/src/test/test_driver.h @@ -19,11 +19,8 @@ * . */ =20 -#ifndef LIBVIRT_TEST_DRIVER_H -# define LIBVIRT_TEST_DRIVER_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 int testRegister(void); - -#endif /* LIBVIRT_TEST_DRIVER_H */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560876099; cv=none; d=zoho.com; s=zohoarc; b=PnpqxHBSFlOMqRZoEnz4Yu4hJbg7fqrXVw3KSwIEOJweZMYsQdwGxiot20Jrvm5n4pDrK7MYkLIebhdqXsRh/JJqTttETr9uM65mIbreQGwTKd6+ypZVx7yVXAzMXGN2wdfEL0roMA8AWiPZMi95Ux4s1S7yHEVSCcexlWgAHWI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560876099; 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=1KflVIAAvZ+nmaERdPYbBA03rwVD/DyjI7SadaonXho=; b=Df3ElQrU4Bb+Gv6BMFemTqqFUfSMJRTS9vyBh7rztmZ8WS74vEi85q9UXQ28oB14wz8cXOqqfdWfbCrWVbSgPm2pK7Bemnt5RvHfpmANQrXgaU0G4pCjiShx28wuP1SfnmQnIU+NGijd7o+z81hVCOyVWz+OULZ8+BnL69vfRtw= 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 1560876099671120.48474064482798; Tue, 18 Jun 2019 09:41:39 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 05A68307D978; Tue, 18 Jun 2019 16:41:38 +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 CC0491001DD1; Tue, 18 Jun 2019 16:41:37 +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 885B41806B18; Tue, 18 Jun 2019 16:41:36 +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 x5IGDSKe024204 for ; Tue, 18 Jun 2019 12:13:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id CDD0584EF; Tue, 18 Jun 2019 16:13:28 +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 9C47260FAB for ; Tue, 18 Jun 2019 16:13:28 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:12:44 -0500 Message-Id: <20190618161316.1722-15-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 14/46] util: thread: 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.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Tue, 18 Jun 2019 16:41:38 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/util/virthread.h | 19 ++++++++----------- src/util/virthreadjob.h | 6 +----- src/util/virthreadpool.h | 9 +++------ 3 files changed, 12 insertions(+), 22 deletions(-) diff --git a/src/util/virthread.h b/src/util/virthread.h index 218d1fcd3f..7870340c47 100644 --- a/src/util/virthread.h +++ b/src/util/virthread.h @@ -19,13 +19,12 @@ * */ =20 -#ifndef LIBVIRT_VIRTHREAD_H -# define LIBVIRT_VIRTHREAD_H +#pragma once =20 -# include "internal.h" -# include "virerror.h" +#include "internal.h" +#include "virerror.h" =20 -# include +#include =20 typedef struct virMutex virMutex; typedef virMutex *virMutexPtr; @@ -71,12 +70,12 @@ struct virOnceControl { }; =20 =20 -# define VIR_MUTEX_INITIALIZER \ +#define VIR_MUTEX_INITIALIZER \ { \ .lock =3D PTHREAD_MUTEX_INITIALIZER \ } =20 -# define VIR_ONCE_CONTROL_INITIALIZER \ +#define VIR_ONCE_CONTROL_INITIALIZER \ { \ .once =3D PTHREAD_ONCE_INIT \ } @@ -88,7 +87,7 @@ void virThreadOnExit(void); =20 typedef void (*virThreadFunc)(void *opaque); =20 -# define virThreadCreate(thread, joinable, func, opaque) \ +#define virThreadCreate(thread, joinable, func, opaque) \ virThreadCreateFull(thread, joinable, func, #func, false, opaque) =20 int virThreadCreateFull(virThreadPtr thread, @@ -190,7 +189,7 @@ int virThreadLocalSet(virThreadLocalPtr l, void*) ATTRI= BUTE_RETURN_CHECK; * Which will ensure that 'virMyObjectOnceInit' is * guaranteed to be invoked exactly once. */ -# define VIR_ONCE_GLOBAL_INIT(classname) \ +#define VIR_ONCE_GLOBAL_INIT(classname) \ static virOnceControl classname ## OnceControl =3D VIR_ONCE_CONTROL_IN= ITIALIZER; \ static virErrorPtr classname ## OnceError; \ \ @@ -213,5 +212,3 @@ int virThreadLocalSet(virThreadLocalPtr l, void*) ATTRI= BUTE_RETURN_CHECK; return 0; \ } \ struct classname ## EatSemicolon - -#endif /* LIBVIRT_VIRTHREAD_H */ diff --git a/src/util/virthreadjob.h b/src/util/virthreadjob.h index 697a932625..aac23c7780 100644 --- a/src/util/virthreadjob.h +++ b/src/util/virthreadjob.h @@ -18,14 +18,10 @@ * . */ =20 -#ifndef LIBVIRT_VIRTHREADJOB_H -# define LIBVIRT_VIRTHREADJOB_H - +#pragma once =20 const char *virThreadJobGet(void); =20 void virThreadJobSetWorker(const char *caller); void virThreadJobSet(const char *caller); void virThreadJobClear(int rv); - -#endif /* LIBVIRT_VIRTHREADJOB_H */ diff --git a/src/util/virthreadpool.h b/src/util/virthreadpool.h index 461682b01a..7dfb511c0a 100644 --- a/src/util/virthreadpool.h +++ b/src/util/virthreadpool.h @@ -19,17 +19,16 @@ * . */ =20 -#ifndef LIBVIRT_VIRTHREADPOOL_H -# define LIBVIRT_VIRTHREADPOOL_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 typedef struct _virThreadPool virThreadPool; typedef virThreadPool *virThreadPoolPtr; =20 typedef void (*virThreadPoolJobFunc)(void *jobdata, void *opaque); =20 -# define virThreadPoolNew(min, max, prio, func, opaque) \ +#define virThreadPoolNew(min, max, prio, func, opaque) \ virThreadPoolNewFull(min, max, prio, func, #func, opaque) =20 virThreadPoolPtr virThreadPoolNewFull(size_t minWorkers, @@ -57,5 +56,3 @@ int virThreadPoolSetParameters(virThreadPoolPtr pool, long long int minWorkers, long long int maxWorkers, long long int prioWorkers); - -#endif /* LIBVIRT_VIRTHREADPOOL_H */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560874546; cv=none; d=zoho.com; s=zohoarc; b=Zq3D+XD1XiYBVz8qvM8wIrlIiB/JFoPngeHy2N+mQciJ4jBnalvaD/U8MB4KKSpPAjPTBXrf4sCTGsA+vh7QrTTpqU+YSuyFQSjXQdfr7efRfmetmhkwJY9sQZfez3Vgx/S1vCa2jMpG+zCx1vBLfNfP3f3zmyRshXxMxU4p/Yg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560874546; 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=Lc/2Me4I9N/mCY/CLQ9JB3VE7GArWF0l8UWlFtA0vHc=; b=liEVVrcBM+/kC2SGD1AzkUlBKaKY3Xi8crALiRH8nXoOiykQE2oo1oZdHxInkxIoIAaxDV2ZTs1ir9JMlTwPK/wm9dWC5V1RV9bDlJNNWOYPMyEO9ZuPBmcsWMKJG1ccPuNh6m7U86/yhdq+Sq4ZiRAerM0UKctb1CLBoDhydFY= 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 1560874546006309.4938091272164; Tue, 18 Jun 2019 09:15:46 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 63190C02938A; Tue, 18 Jun 2019 16:15:39 +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 3A9D360FAB; Tue, 18 Jun 2019 16:15:38 +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 E911D206D6; Tue, 18 Jun 2019 16:15:37 +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 x5IGDTI1024214 for ; Tue, 18 Jun 2019 12:13:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2A18460FAB; Tue, 18 Jun 2019 16:13:29 +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 ECF2E84EF for ; Tue, 18 Jun 2019 16:13:28 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:12:45 -0500 Message-Id: <20190618161316.1722-16-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 15/46] util: alloc: use #pragma once 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.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 18 Jun 2019 16:15:44 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/util/viralloc.h | 101 +++++++++++++++++++++----------------------- 1 file changed, 49 insertions(+), 52 deletions(-) diff --git a/src/util/viralloc.h b/src/util/viralloc.h index 92c71d9a1a..2b82096fde 100644 --- a/src/util/viralloc.h +++ b/src/util/viralloc.h @@ -20,10 +20,9 @@ * */ =20 -#ifndef LIBVIRT_VIRALLOC_H -# define LIBVIRT_VIRALLOC_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 /* Return 1 if an array of N objects, each of size S, cannot exist due to size arithmetic overflow. S must be positive and N must be @@ -37,10 +36,10 @@ sizeof(ptrdiff_t) <=3D sizeof(size_t), so do not bother to test for exactly-SIZE_MAX allocations on such hosts; this avoids a test and branch when S is known to be 1. */ -# ifndef xalloc_oversized -# define xalloc_oversized(n, s) \ +#ifndef xalloc_oversized +# define xalloc_oversized(n, s) \ ((size_t) (sizeof(ptrdiff_t) <=3D sizeof(size_t) ? -1 : -2) / (s) < (n= )) -# endif +#endif =20 =20 =20 @@ -94,8 +93,8 @@ void virDisposeString(char **strptr) * * Returns -1 on failure (with OOM error reported), 0 on success */ -# define VIR_ALLOC(ptr) virAlloc(&(ptr), sizeof(*(ptr)), true, VIR_FROM_TH= IS, \ - __FILE__, __FUNCTION__, __LINE__) +#define VIR_ALLOC(ptr) virAlloc(&(ptr), sizeof(*(ptr)), true, VIR_FROM_THI= S, \ + __FILE__, __FUNCTION__, __LINE__) =20 /** * VIR_ALLOC_QUIET: @@ -109,7 +108,7 @@ void virDisposeString(char **strptr) * * Returns -1 on failure, 0 on success */ -# define VIR_ALLOC_QUIET(ptr) virAlloc(&(ptr), sizeof(*(ptr)), false, 0, N= ULL, NULL, 0) +#define VIR_ALLOC_QUIET(ptr) virAlloc(&(ptr), sizeof(*(ptr)), false, 0, NU= LL, NULL, 0) =20 /** * VIR_ALLOC_N: @@ -124,8 +123,8 @@ void virDisposeString(char **strptr) * * Returns -1 on failure (with OOM error reported), 0 on success */ -# define VIR_ALLOC_N(ptr, count) virAllocN(&(ptr), sizeof(*(ptr)), (count)= , true, \ - VIR_FROM_THIS, __FILE__, __FUNC= TION__, __LINE__) +#define VIR_ALLOC_N(ptr, count) virAllocN(&(ptr), sizeof(*(ptr)), (count),= true, \ + VIR_FROM_THIS, __FILE__, __FUNCT= ION__, __LINE__) =20 /** * VIR_ALLOC_N_QUIET: @@ -140,8 +139,8 @@ void virDisposeString(char **strptr) * * Returns -1 on failure, 0 on success */ -# define VIR_ALLOC_N_QUIET(ptr, count) virAllocN(&(ptr), sizeof(*(ptr)), (= count), \ - false, 0, NULL, NULL, 0) +#define VIR_ALLOC_N_QUIET(ptr, count) virAllocN(&(ptr), sizeof(*(ptr)), (c= ount), \ + false, 0, NULL, NULL, 0) =20 /** * VIR_REALLOC_N: @@ -156,9 +155,9 @@ void virDisposeString(char **strptr) * * Returns -1 on failure (with OOM error reported), 0 on success */ -# define VIR_REALLOC_N(ptr, count) virReallocN(&(ptr), sizeof(*(ptr)), (co= unt), \ - true, VIR_FROM_THIS, __FILE= __, \ - __FUNCTION__, __LINE__) +#define VIR_REALLOC_N(ptr, count) virReallocN(&(ptr), sizeof(*(ptr)), (cou= nt), \ + true, VIR_FROM_THIS, __FILE_= _, \ + __FUNCTION__, __LINE__) =20 /** * VIR_REALLOC_N_QUIET: @@ -173,8 +172,8 @@ void virDisposeString(char **strptr) * * Returns -1 on failure, 0 on success */ -# define VIR_REALLOC_N_QUIET(ptr, count) virReallocN(&(ptr), sizeof(*(ptr)= ), (count), \ - false, 0, NULL, NULL,= 0) +#define VIR_REALLOC_N_QUIET(ptr, count) virReallocN(&(ptr), sizeof(*(ptr))= , (count), \ + false, 0, NULL, NULL, = 0) =20 /** * VIR_EXPAND_N: @@ -191,7 +190,7 @@ void virDisposeString(char **strptr) * * Returns -1 on failure (with OOM error reported), 0 on success */ -# define VIR_EXPAND_N(ptr, count, add) \ +#define VIR_EXPAND_N(ptr, count, add) \ virExpandN(&(ptr), sizeof(*(ptr)), &(count), add, true, VIR_FROM_THIS,= \ __FILE__, __FUNCTION__, __LINE__) =20 @@ -210,7 +209,7 @@ void virDisposeString(char **strptr) * * Returns -1 on failure, 0 on success */ -# define VIR_EXPAND_N_QUIET(ptr, count, add) \ +#define VIR_EXPAND_N_QUIET(ptr, count, add) \ virExpandN(&(ptr), sizeof(*(ptr)), &(count), add, false, 0, NULL, NULL= , 0) =20 /** @@ -235,7 +234,7 @@ void virDisposeString(char **strptr) * * Returns -1 on failure (with OOM error reported), 0 on success */ -# define VIR_RESIZE_N(ptr, alloc, count, add) \ +#define VIR_RESIZE_N(ptr, alloc, count, add) \ virResizeN(&(ptr), sizeof(*(ptr)), &(alloc), count, add, true, \ VIR_FROM_THIS, __FILE__, __FUNCTION__, __LINE__) =20 @@ -261,7 +260,7 @@ void virDisposeString(char **strptr) * * Returns -1 on failure, 0 on success */ -# define VIR_RESIZE_N_QUIET(ptr, alloc, count, add) \ +#define VIR_RESIZE_N_QUIET(ptr, alloc, count, add) \ virResizeN(&(ptr), sizeof(*(ptr)), &(alloc), count, add, \ false, 0, NULL, NULL, 0) =20 @@ -280,7 +279,7 @@ void virDisposeString(char **strptr) * * No return value. */ -# define VIR_SHRINK_N(ptr, count, remove) \ +#define VIR_SHRINK_N(ptr, count, remove) \ virShrinkN(&(ptr), sizeof(*(ptr)), &(count), remove) =20 /** @@ -319,7 +318,7 @@ void virDisposeString(char **strptr) * or evaluate to "1", and in the meantime check that we've actually * added the correct &'s and/or *'s to the arguments. (Whew!) */ -# define VIR_TYPEMATCH(a, b) \ +#define VIR_TYPEMATCH(a, b) \ sizeof(char[2 * (sizeof(*(a) =3D *(b)) =3D=3D sizeof(*(b))) - 1]) =20 /** @@ -358,37 +357,37 @@ void virDisposeString(char **strptr) * * Returns -1 on failure (with OOM error reported), 0 on success */ -# define VIR_INSERT_ELEMENT(ptr, at, count, newelem) \ +#define VIR_INSERT_ELEMENT(ptr, at, count, newelem) \ virInsertElementsN(&(ptr), sizeof(*(ptr)), at, &(count), \ VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), true, f= alse, \ true, VIR_FROM_THIS, __FILE__, __FUNCTION__, __LINE= __) -# define VIR_INSERT_ELEMENT_COPY(ptr, at, count, newelem) \ +#define VIR_INSERT_ELEMENT_COPY(ptr, at, count, newelem) \ virInsertElementsN(&(ptr), sizeof(*(ptr)), at, &(count), \ VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), false, = false, \ true, VIR_FROM_THIS, __FILE__, __FUNCTION__, __LINE= __) -# define VIR_INSERT_ELEMENT_INPLACE(ptr, at, count, newelem) \ +#define VIR_INSERT_ELEMENT_INPLACE(ptr, at, count, newelem) \ virInsertElementsN(&(ptr), sizeof(*(ptr)), at, &(count), \ VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), true, t= rue, \ true, VIR_FROM_THIS, __FILE__, __FUNCTION__, __LINE= __) -# define VIR_INSERT_ELEMENT_COPY_INPLACE(ptr, at, count, newelem) \ +#define VIR_INSERT_ELEMENT_COPY_INPLACE(ptr, at, count, newelem) \ virInsertElementsN(&(ptr), sizeof(*(ptr)), at, &(count), \ VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), false, = true, \ true, VIR_FROM_THIS, __FILE__, __FUNCTION__, __LINE= __) =20 /* Quiet version of macros above */ -# define VIR_INSERT_ELEMENT_QUIET(ptr, at, count, newelem) \ +#define VIR_INSERT_ELEMENT_QUIET(ptr, at, count, newelem) \ virInsertElementsN(&(ptr), sizeof(*(ptr)), at, &(count), \ VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), true, f= alse, \ false, 0, NULL, NULL, 0) -# define VIR_INSERT_ELEMENT_COPY_QUIET(ptr, at, count, newelem) \ +#define VIR_INSERT_ELEMENT_COPY_QUIET(ptr, at, count, newelem) \ virInsertElementsN(&(ptr), sizeof(*(ptr)), at, &(count), \ VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), false, = false, \ false, 0, NULL, NULL, 0) -# define VIR_INSERT_ELEMENT_INPLACE_QUIET(ptr, at, count, newelem) \ +#define VIR_INSERT_ELEMENT_INPLACE_QUIET(ptr, at, count, newelem) \ virInsertElementsN(&(ptr), sizeof(*(ptr)), at, &(count), \ VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), true, t= rue, \ false, 0, NULL, NULL, 0) -# define VIR_INSERT_ELEMENT_COPY_INPLACE_QUIET(ptr, at, count, newelem) \ +#define VIR_INSERT_ELEMENT_COPY_INPLACE_QUIET(ptr, at, count, newelem) \ virInsertElementsN(&(ptr), sizeof(*(ptr)), at, &(count), \ VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), false, = true, \ false, 0, NULL, NULL, 0) @@ -428,21 +427,21 @@ void virDisposeString(char **strptr) * * Returns -1 on failure (with OOM error reported), 0 on success */ -# define VIR_APPEND_ELEMENT(ptr, count, newelem) \ +#define VIR_APPEND_ELEMENT(ptr, count, newelem) \ virInsertElementsN(&(ptr), sizeof(*(ptr)), -1, &(count), \ VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), true, f= alse, \ true, VIR_FROM_THIS, __FILE__, __FUNCTION__, __LINE= __) -# define VIR_APPEND_ELEMENT_COPY(ptr, count, newelem) \ +#define VIR_APPEND_ELEMENT_COPY(ptr, count, newelem) \ virInsertElementsN(&(ptr), sizeof(*(ptr)), -1, &(count), \ VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), false, = false, \ true, VIR_FROM_THIS, __FILE__, __FUNCTION__, __LINE= __) -# define VIR_APPEND_ELEMENT_INPLACE(ptr, count, newelem) \ +#define VIR_APPEND_ELEMENT_INPLACE(ptr, count, newelem) \ ignore_value(virInsertElementsN(&(ptr), sizeof(*(ptr)), -1, &(count), \ VIR_TYPEMATCH(ptr, &(newelem)), \ &(newelem), true, true, false, \ VIR_FROM_THIS, __FILE__, \ __FUNCTION__, __LINE__)) -# define VIR_APPEND_ELEMENT_COPY_INPLACE(ptr, count, newelem) \ +#define VIR_APPEND_ELEMENT_COPY_INPLACE(ptr, count, newelem) \ ignore_value(virInsertElementsN(&(ptr), sizeof(*(ptr)), -1, &(count), \ VIR_TYPEMATCH(ptr, &(newelem)), \ &(newelem), false, true, false, \ @@ -450,11 +449,11 @@ void virDisposeString(char **strptr) __FUNCTION__, __LINE__)) =20 /* Quiet version of macros above */ -# define VIR_APPEND_ELEMENT_QUIET(ptr, count, newelem) \ +#define VIR_APPEND_ELEMENT_QUIET(ptr, count, newelem) \ virInsertElementsN(&(ptr), sizeof(*(ptr)), -1, &(count), \ VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), true, f= alse, \ false, 0, NULL, NULL, 0) -# define VIR_APPEND_ELEMENT_COPY_QUIET(ptr, count, newelem) \ +#define VIR_APPEND_ELEMENT_COPY_QUIET(ptr, count, newelem) \ virInsertElementsN(&(ptr), sizeof(*(ptr)), -1, &(count), \ VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), false, = false, \ false, 0, NULL, NULL, 0) @@ -477,9 +476,9 @@ void virDisposeString(char **strptr) * * Returns -1 on failure, 0 on success */ -# define VIR_DELETE_ELEMENT(ptr, at, count) \ +#define VIR_DELETE_ELEMENT(ptr, at, count) \ virDeleteElementsN(&(ptr), sizeof(*(ptr)), at, &(count), 1, false) -# define VIR_DELETE_ELEMENT_INPLACE(ptr, at, count) \ +#define VIR_DELETE_ELEMENT_INPLACE(ptr, at, count) \ virDeleteElementsN(&(ptr), sizeof(*(ptr)), at, &(count), 1, true) =20 /** @@ -492,7 +491,7 @@ void virDisposeString(char **strptr) * arithmetic overflow in the allocation size. The check is * essentially the same as that in gnulib's xalloc_oversized. */ -# define VIR_ALLOC_VAR_OVERSIZED(M, N, S) ((((size_t)-1) - (M)) / (S) < (N= )) +#define VIR_ALLOC_VAR_OVERSIZED(M, N, S) ((((size_t)-1) - (M)) / (S) < (N)) =20 /** * VIR_ALLOC_VAR: @@ -513,7 +512,7 @@ void virDisposeString(char **strptr) * * Returns -1 on failure (with OOM error reported), 0 on success */ -# define VIR_ALLOC_VAR(ptr, type, count) \ +#define VIR_ALLOC_VAR(ptr, type, count) \ virAllocVar(&(ptr), sizeof(*(ptr)), sizeof(type), (count), true, \ VIR_FROM_THIS, __FILE__, __FUNCTION__, __LINE__) =20 @@ -536,7 +535,7 @@ void virDisposeString(char **strptr) * * Returns -1 on failure, 0 on success */ -# define VIR_ALLOC_VAR_QUIET(ptr, type, count) \ +#define VIR_ALLOC_VAR_QUIET(ptr, type, count) \ virAllocVar(&(ptr), sizeof(*(ptr)), sizeof(type), (count), false, 0, N= ULL, NULL, 0) =20 /** @@ -552,7 +551,7 @@ void virDisposeString(char **strptr) * integer type, all while evaluating ptr only once. This gives us * extra compiler safety when compiling under gcc. */ -# define VIR_FREE(ptr) virFree(1 ? (void *) &(ptr) : (ptr)) +#define VIR_FREE(ptr) virFree(1 ? (void *) &(ptr) : (ptr)) =20 =20 /** @@ -565,7 +564,7 @@ void virDisposeString(char **strptr) * * This macro is safe to use on arguments with side effects. */ -# define VIR_DISPOSE_N(ptr, count) virDispose(1 ? (void *) &(ptr) : (ptr),= 0, \ +#define VIR_DISPOSE_N(ptr, count) virDispose(1 ? (void *) &(ptr) : (ptr), = 0, \ sizeof(*(ptr)), &(count)) =20 =20 @@ -577,7 +576,7 @@ void virDisposeString(char **strptr) * * This macro is not safe to be used on arguments with side effects. */ -# define VIR_DISPOSE_STRING(ptr) virDisposeString(&(ptr)) +#define VIR_DISPOSE_STRING(ptr) virDisposeString(&(ptr)) =20 /** * VIR_AUTODISPOSE_STR: @@ -586,7 +585,7 @@ void virDisposeString(char **strptr) * the string variable declared with it by calling virDisposeString * when the variable goes out of scope. */ -# define VIR_AUTODISPOSE_STR \ +#define VIR_AUTODISPOSE_STR \ __attribute__((cleanup(virDisposeString))) char * =20 /** @@ -597,8 +596,8 @@ void virDisposeString(char **strptr) * * This macro is safe to be used on arguments with side effects. */ -# define VIR_DISPOSE(ptr) virDispose(1 ? (void *) &(ptr) : (ptr), 1, \ - sizeof(*(ptr)), NULL) +#define VIR_DISPOSE(ptr) virDispose(1 ? (void *) &(ptr) : (ptr), 1, \ + sizeof(*(ptr)), NULL) =20 =20 void virAllocTestInit(void); @@ -614,6 +613,4 @@ void virAllocTestHook(void (*func)(int, void*), void *d= ata); * the variable declared with it by calling virFree * when the variable goes out of scope. */ -# define VIR_AUTOFREE(type) __attribute__((cleanup(virFree))) type - -#endif /* LIBVIRT_VIRALLOC_H */ +#define VIR_AUTOFREE(type) __attribute__((cleanup(virFree))) type --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560874530; cv=none; d=zoho.com; s=zohoarc; b=CAT134dZPkXqQBm+6dRDAC7qAW1fPc/q8RBXGOqCVTTDlvXbesN8nzb5jjmnSG824w7LN4RnMZpGH5jtdl45ygIAGeFKHC6BuJds/t7BM6qQEN9i3zsR0ymOdMQFge0+pQ/r5B98TsF5+byFpNQd89eeOXJhGkOWpv0dKOvU8Uk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560874530; 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=khok+HKsQYva3P3sU8eDfdUsjdT3CK5bonULfuw4SQ0=; b=XahAj35dBruT8OLbLx4UgRBg95xH8/nUfGgL36053AG6Ey/X+Q+NFWnyNwS/GI+g9UgjbEK8KtDg3l0aQs0WhagMsa0fgccq/qkVstFKeZuNYbBG5cUp1wd1TrRVIwSRcfgrdOWynjH4IM9+sh0PZOqk/PZm2QrW9TpKDDZmDiI= 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 1560874530571671.2718533070126; Tue, 18 Jun 2019 09:15:30 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id C81538552E; Tue, 18 Jun 2019 16:15:18 +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 96F0C7D925; Tue, 18 Jun 2019 16:15:16 +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 4264E1806B1F; Tue, 18 Jun 2019 16:15:16 +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 x5IGDTKj024222 for ; Tue, 18 Jun 2019 12:13:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7AE9084EF; Tue, 18 Jun 2019 16:13:29 +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 4986B60FAB for ; Tue, 18 Jun 2019 16:13:29 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:12:46 -0500 Message-Id: <20190618161316.1722-17-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 16/46] util: atomic: use #pragma once 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.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 18 Jun 2019 16:15:29 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/util/viratomic.h | 91 +++++++++++++++++++++----------------------- 1 file changed, 44 insertions(+), 47 deletions(-) diff --git a/src/util/viratomic.h b/src/util/viratomic.h index 0b2b3df081..35800dafcd 100644 --- a/src/util/viratomic.h +++ b/src/util/viratomic.h @@ -23,16 +23,15 @@ * */ =20 -#ifndef LIBVIRT_VIRATOMIC_H -# define LIBVIRT_VIRATOMIC_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 -# ifdef VIR_ATOMIC_OPS_GCC -# define VIR_STATIC /* Nothing; we just never define the functions */ -# else -# define VIR_STATIC static -# endif +#ifdef VIR_ATOMIC_OPS_GCC +# define VIR_STATIC /* Nothing; we just never define the functions */ +#else +# define VIR_STATIC static +#endif =20 /** * virAtomicIntGet: @@ -152,62 +151,62 @@ VIR_STATIC unsigned int virAtomicIntXor(volatile unsi= gned int *atomic, unsigned int val) ATTRIBUTE_NONNULL(1); =20 -# undef VIR_STATIC +#undef VIR_STATIC =20 -# ifdef VIR_ATOMIC_OPS_GCC +#ifdef VIR_ATOMIC_OPS_GCC =20 -# define virAtomicIntGet(atomic) \ +# define virAtomicIntGet(atomic) \ (__extension__ ({ \ (void)verify_true(sizeof(*(atomic)) =3D=3D sizeof(int)); \ (void)(0 ? *(atomic) ^ *(atomic) : 0); \ __sync_synchronize(); \ (int)*(atomic); \ })) -# define virAtomicIntSet(atomic, newval) \ +# define virAtomicIntSet(atomic, newval) \ (__extension__ ({ \ (void)verify_true(sizeof(*(atomic)) =3D=3D sizeof(int)); \ (void)(0 ? *(atomic) ^ (newval) : 0); \ *(atomic) =3D (newval); \ __sync_synchronize(); \ })) -# define virAtomicIntInc(atomic) \ +# define virAtomicIntInc(atomic) \ (__extension__ ({ \ (void)verify_true(sizeof(*(atomic)) =3D=3D sizeof(int)); \ (void)(0 ? *(atomic) ^ *(atomic) : 0); \ __sync_add_and_fetch((atomic), 1); \ })) -# define virAtomicIntDecAndTest(atomic) \ +# define virAtomicIntDecAndTest(atomic) \ (__extension__ ({ \ (void)verify_true(sizeof(*(atomic)) =3D=3D sizeof(int)); \ (void)(0 ? *(atomic) ^ *(atomic) : 0); \ __sync_fetch_and_sub((atomic), 1) =3D=3D 1; \ })) -# define virAtomicIntCompareExchange(atomic, oldval, newval) \ +# define virAtomicIntCompareExchange(atomic, oldval, newval) \ (__extension__ ({ \ (void)verify_true(sizeof(*(atomic)) =3D=3D sizeof(int)); \ (void)(0 ? *(atomic) ^ (newval) ^ (oldval) : 0); \ (bool)__sync_bool_compare_and_swap((atomic), \ (oldval), (newval)); \ })) -# define virAtomicIntAdd(atomic, val) \ +# define virAtomicIntAdd(atomic, val) \ (__extension__ ({ \ (void)verify_true(sizeof(*(atomic)) =3D=3D sizeof(int)); \ (void)(0 ? *(atomic) ^ (val) : 0); \ (int) __sync_fetch_and_add((atomic), (val)); \ })) -# define virAtomicIntAnd(atomic, val) \ +# define virAtomicIntAnd(atomic, val) \ (__extension__ ({ \ (void)verify_true(sizeof(*(atomic)) =3D=3D sizeof(int)); \ (void) (0 ? *(atomic) ^ (val) : 0); \ (unsigned int) __sync_fetch_and_and((atomic), (val)); \ })) -# define virAtomicIntOr(atomic, val) \ +# define virAtomicIntOr(atomic, val) \ (__extension__ ({ \ (void)verify_true(sizeof(*(atomic)) =3D=3D sizeof(int)); \ (void) (0 ? *(atomic) ^ (val) : 0); \ (unsigned int) __sync_fetch_and_or((atomic), (val)); \ })) -# define virAtomicIntXor(atomic, val) \ +# define virAtomicIntXor(atomic, val) \ (__extension__ ({ \ (void)verify_true(sizeof(*(atomic)) =3D=3D sizeof(int)); \ (void) (0 ? *(atomic) ^ (val) : 0); \ @@ -215,18 +214,18 @@ VIR_STATIC unsigned int virAtomicIntXor(volatile unsi= gned int *atomic, })) =20 =20 -# else +#else =20 -# ifdef VIR_ATOMIC_OPS_WIN32 +# ifdef VIR_ATOMIC_OPS_WIN32 =20 -# include -# include -# include -# if !defined(_M_AMD64) && !defined (_M_IA64) && !defined(_M_X64) -# define InterlockedAnd _InterlockedAnd -# define InterlockedOr _InterlockedOr -# define InterlockedXor _InterlockedXor -# endif +# include +# include +# include +# if !defined(_M_AMD64) && !defined (_M_IA64) && !defined(_M_X64) +# define InterlockedAnd _InterlockedAnd +# define InterlockedOr _InterlockedOr +# define InterlockedXor _InterlockedXor +# endif =20 /* * http://msdn.microsoft.com/en-us/library/ms684122(v=3Dvs.85).aspx @@ -295,9 +294,9 @@ virAtomicIntXor(volatile unsigned int *atomic, } =20 =20 -# else -# ifdef VIR_ATOMIC_OPS_PTHREAD -# include +# else +# ifdef VIR_ATOMIC_OPS_PTHREAD +# include =20 extern pthread_mutex_t virAtomicLock; =20 @@ -420,35 +419,33 @@ virAtomicIntXor(volatile unsigned int *atomic, } =20 =20 -# else -# error "No atomic integer impl for this platform" -# endif +# else +# error "No atomic integer impl for this platform" # endif +# endif =20 /* The int/unsigned int casts here ensure that you can * pass either an int or unsigned int to all atomic op * functions, in the same way that we can with GCC * atomic op helpers. */ -# define virAtomicIntGet(atomic) \ +# define virAtomicIntGet(atomic) \ virAtomicIntGet((int *)atomic) -# define virAtomicIntSet(atomic, val) \ +# define virAtomicIntSet(atomic, val) \ virAtomicIntSet((int *)atomic, val) -# define virAtomicIntInc(atomic) \ +# define virAtomicIntInc(atomic) \ virAtomicIntInc((int *)atomic) -# define virAtomicIntDecAndTest(atomic) \ +# define virAtomicIntDecAndTest(atomic) \ virAtomicIntDecAndTest((int *)atomic) -# define virAtomicIntCompareExchange(atomic, oldval, newval) \ +# define virAtomicIntCompareExchange(atomic, oldval, newval) \ virAtomicIntCompareExchange((int *)atomic, oldval, newval) -# define virAtomicIntAdd(atomic, val) \ +# define virAtomicIntAdd(atomic, val) \ virAtomicIntAdd((int *)atomic, val) -# define virAtomicIntAnd(atomic, val) \ +# define virAtomicIntAnd(atomic, val) \ virAtomicIntAnd((unsigned int *)atomic, val) -# define virAtomicIntOr(atomic, val) \ +# define virAtomicIntOr(atomic, val) \ virAtomicIntOr((unsigned int *)atomic, val) -# define virAtomicIntXor(atomic, val) \ +# define virAtomicIntXor(atomic, val) \ virAtomicIntXor((unsigned int *)atomic, val) =20 -# endif - -#endif /* LIBVIRT_VIRATOMIC_H */ +#endif --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560874554; cv=none; d=zoho.com; s=zohoarc; b=jg4Xehd6XIRgTEkp+w0S2Fk6u8fT1xPUYJK32nCSCkQ9yhvwzOw+K7HdMaA5kZv1rpu9Is1CA8Lm64iSOmwlr74lXTdlOgcjg1CyezP06a0yC5LrauNDnCtPoEgP6fUZBpNtQ7S39zNqhDtqVb2xDvDEk+tY/4ZTsU/hkNynWq4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560874554; 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=wXj+6Y4MNqWxLNXH3p+/Six49wRC8P+pLB4Gw2uB0xQ=; b=RYx5QKIs6eyYTlpOZeawGR/Qn1WPIjnZUXLSZiz7m1vyUURdx5aRx8Op1pJc5t4ZN8lI+Wk5lmjASpT/dFxQ/kTZRKhcgNenVIqqVMx4CY+EK67JXOYCbhW7uEkvTyJRDTpdAsJCBw7lnYfB+ljbUELJ13kPfV9m8h1bcBi+A7E= 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 1560874554440859.1923332283277; Tue, 18 Jun 2019 09:15:54 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 07EB8C04FFF1; Tue, 18 Jun 2019 16:15:46 +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 B64D17D925; Tue, 18 Jun 2019 16:15: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 767B9206DA; Tue, 18 Jun 2019 16:15:44 +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 x5IGDTrB024229 for ; Tue, 18 Jun 2019 12:13:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id CB01D60FAB; Tue, 18 Jun 2019 16:13:29 +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 99D4C84EF for ; Tue, 18 Jun 2019 16:13:29 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:12:47 -0500 Message-Id: <20190618161316.1722-18-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 17/46] util: storage: 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.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 18 Jun 2019 16:15:48 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/util/virstorageencryption.h | 17 +++++++---------- src/util/virstoragefile.h | 31 ++++++++++++++----------------- src/util/virstoragefilebackend.h | 9 +++------ 3 files changed, 24 insertions(+), 33 deletions(-) diff --git a/src/util/virstorageencryption.h b/src/util/virstorageencryptio= n.h index 68d879a63e..3e5485d88b 100644 --- a/src/util/virstorageencryption.h +++ b/src/util/virstorageencryption.h @@ -18,16 +18,15 @@ * . */ =20 -#ifndef LIBVIRT_VIRSTORAGEENCRYPTION_H -# define LIBVIRT_VIRSTORAGEENCRYPTION_H +#pragma once =20 -# include "internal.h" -# include "virbuffer.h" -# include "virsecret.h" -# include "virutil.h" -# include "virenum.h" +#include "internal.h" +#include "virbuffer.h" +#include "virsecret.h" +#include "virutil.h" +#include "virenum.h" =20 -# include +#include =20 typedef enum { VIR_STORAGE_ENCRYPTION_SECRET_TYPE_PASSPHRASE =3D 0, @@ -93,5 +92,3 @@ enum { }; =20 int virStorageGenerateQcowPassphrase(unsigned char *dest); - -#endif /* LIBVIRT_VIRSTORAGEENCRYPTION_H */ diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h index 763030eefa..38ba901858 100644 --- a/src/util/virstoragefile.h +++ b/src/util/virstoragefile.h @@ -19,19 +19,18 @@ * . */ =20 -#ifndef LIBVIRT_VIRSTORAGEFILE_H -# define LIBVIRT_VIRSTORAGEFILE_H +#pragma once =20 -# include +#include =20 -# include "virbitmap.h" -# include "virobject.h" -# include "virseclabel.h" -# include "virstorageencryption.h" -# include "virutil.h" -# include "virsecret.h" -# include "virautoclean.h" -# include "virenum.h" +#include "virbitmap.h" +#include "virobject.h" +#include "virseclabel.h" +#include "virstorageencryption.h" +#include "virutil.h" +#include "virsecret.h" +#include "virautoclean.h" +#include "virenum.h" =20 /* Minimum header size required to probe all known formats with * virStorageFileProbeFormat, or obtain metadata from a known format. @@ -39,7 +38,7 @@ * 32769). Some formats can be probed with fewer bytes. Although * some formats theoretically permit metadata that can rely on offsets * beyond this size, in practice that doesn't matter. */ -# define VIR_STORAGE_MAX_HEADER 0x8200 +#define VIR_STORAGE_MAX_HEADER 0x8200 =20 =20 /* Types of disk backends (host resource). Comparable to the public @@ -341,9 +340,9 @@ struct _virStorageSource { }; =20 =20 -# ifndef DEV_BSIZE -# define DEV_BSIZE 512 -# endif +#ifndef DEV_BSIZE +# define DEV_BSIZE 512 +#endif =20 int virStorageFileProbeFormat(const char *path, uid_t uid, gid_t gid); =20 @@ -548,5 +547,3 @@ void virStorageFileReportBrokenChain(int errcode, virStorageSourcePtr parent); =20 VIR_DEFINE_AUTOPTR_FUNC(virStorageAuthDef, virStorageAuthDefFree); - -#endif /* LIBVIRT_VIRSTORAGEFILE_H */ diff --git a/src/util/virstoragefilebackend.h b/src/util/virstoragefileback= end.h index c93bc4033a..c7af77bf8f 100644 --- a/src/util/virstoragefilebackend.h +++ b/src/util/virstoragefilebackend.h @@ -18,12 +18,11 @@ * . */ =20 -#ifndef LIBVIRT_VIRSTORAGEFILEBACKEND_H -# define LIBVIRT_VIRSTORAGEFILEBACKEND_H +#pragma once =20 -# include +#include =20 -# include "virstoragefile.h" +#include "virstoragefile.h" =20 /* ------- virStorageFile backends ------------ */ typedef struct _virStorageFileBackend virStorageFileBackend; @@ -99,5 +98,3 @@ struct _virStorageFileBackend { }; =20 int virStorageFileBackendRegister(virStorageFileBackendPtr backend); - -#endif /* LIBVIRT_VIRSTORAGEFILEBACKEND_H */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560876104; cv=none; d=zoho.com; s=zohoarc; b=MQwYxS0fGUAvOcTLbgarjIEwVMmxXzt8IVLytMNbP6SENTxPWE3KsQ/T2o9tVeJxpHCLcYMDHE2IpeRgyFjGcjCXm3ytOia1V+m8UA4FeLEkVPSd6iTVbnnhrne7YihRrVxDqEk1eoBpK/OICocbqwclp8MxDEp3S40uq4ryHkU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560876104; 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=xCVHSqf40v2Q1rMt5FOrIfGrY/6xHIb0g1nnl79DRBw=; b=gFpgDeuISWD0JnNNE96EXkevU69yOlIpQBoWebeCNPbOozqwW3eS/SwTLK2E8dbMj0NdE+WXNxjlfxLoae1jPzftWi+7mnoKC5IRfIjwwpwYDK2t2htqJM30AslzcfgrpZlwxsdjqhrO3X9oX3ad1AurK9Yl/GMRsiNWOszztgg= 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 1560876104083557.8760206444005; Tue, 18 Jun 2019 09:41:44 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 758A519CF7B; Tue, 18 Jun 2019 16:41:42 +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 42484601A5; Tue, 18 Jun 2019 16:41:42 +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 E40EA206D9; Tue, 18 Jun 2019 16:41:41 +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 x5IGDUDa024239 for ; Tue, 18 Jun 2019 12:13:30 -0400 Received: by smtp.corp.redhat.com (Postfix) id 29A8184EF; Tue, 18 Jun 2019 16:13:30 +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 EC6FF60FAB for ; Tue, 18 Jun 2019 16:13:29 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:12:48 -0500 Message-Id: <20190618161316.1722-19-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 18/46] util: netdev: 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.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 18 Jun 2019 16:41:43 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/util/virnetdev.h | 33 +++++++++++++++----------------- src/util/virnetdevbandwidth.h | 8 +++----- src/util/virnetdevbridge.h | 8 +++----- src/util/virnetdevip.h | 9 +++------ src/util/virnetdevmacvlan.h | 22 ++++++++++----------- src/util/virnetdevmidonet.h | 9 +++------ src/util/virnetdevopenvswitch.h | 13 +++++-------- src/util/virnetdevtap.h | 19 ++++++++---------- src/util/virnetdevveth.h | 7 ++----- src/util/virnetdevvlan.h | 11 ++++------- src/util/virnetdevvportprofile.h | 18 +++++++---------- 11 files changed, 63 insertions(+), 94 deletions(-) diff --git a/src/util/virnetdev.h b/src/util/virnetdev.h index 7ca22de9a5..563b218227 100644 --- a/src/util/virnetdev.h +++ b/src/util/virnetdev.h @@ -16,29 +16,28 @@ * . */ =20 -#ifndef LIBVIRT_VIRNETDEV_H -# define LIBVIRT_VIRNETDEV_H +#pragma once =20 -# include +#include =20 -# include "virbitmap.h" -# include "virsocketaddr.h" -# include "virmacaddr.h" -# include "virpci.h" -# include "virnetdevvlan.h" -# include "virautoclean.h" -# include "virenum.h" +#include "virbitmap.h" +#include "virsocketaddr.h" +#include "virmacaddr.h" +#include "virpci.h" +#include "virnetdevvlan.h" +#include "virautoclean.h" +#include "virenum.h" =20 -# ifdef HAVE_STRUCT_IFREQ +#ifdef HAVE_STRUCT_IFREQ typedef struct ifreq virIfreq; -# else +#else typedef void virIfreq; -# endif +#endif =20 /* Used for prefix of ifname of any tap device name generated * dynamically by libvirt, cannot be used for a persistent network name. */ -# define VIR_NET_GENERATED_TAP_PREFIX "vnet" +#define VIR_NET_GENERATED_TAP_PREFIX "vnet" =20 typedef enum { VIR_NETDEV_RX_FILTER_MODE_NONE =3D 0, @@ -301,8 +300,8 @@ int virNetDevSetRcvAllMulti(const char *ifname, bool re= ceive) int virNetDevGetRcvAllMulti(const char *ifname, bool *receive) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; =20 -# define SYSFS_NET_DIR "/sys/class/net/" -# define SYSFS_INFINIBAND_DIR "/sys/class/infiniband/" +#define SYSFS_NET_DIR "/sys/class/net/" +#define SYSFS_INFINIBAND_DIR "/sys/class/infiniband/" int virNetDevSysfsFile(char **pf_sysfs_device_link, const char *ifname, const char *file) @@ -313,5 +312,3 @@ int virNetDevRunEthernetScript(const char *ifname, cons= t char *script) ATTRIBUTE_NOINLINE; =20 VIR_DEFINE_AUTOPTR_FUNC(virNetDevRxFilter, virNetDevRxFilterFree); - -#endif /* LIBVIRT_VIRNETDEV_H */ diff --git a/src/util/virnetdevbandwidth.h b/src/util/virnetdevbandwidth.h index d243d7262a..75da1f7ba6 100644 --- a/src/util/virnetdevbandwidth.h +++ b/src/util/virnetdevbandwidth.h @@ -16,11 +16,10 @@ * . */ =20 -#ifndef LIBVIRT_VIRNETDEVBANDWIDTH_H -# define LIBVIRT_VIRNETDEVBANDWIDTH_H +#pragma once =20 -# include "internal.h" -# include "virmacaddr.h" +#include "internal.h" +#include "virmacaddr.h" =20 typedef struct _virNetDevBandwidthRate virNetDevBandwidthRate; typedef virNetDevBandwidthRate *virNetDevBandwidthRatePtr; @@ -74,4 +73,3 @@ int virNetDevBandwidthUpdateFilter(const char *ifname, unsigned int id) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; -#endif /* LIBVIRT_VIRNETDEVBANDWIDTH_H */ diff --git a/src/util/virnetdevbridge.h b/src/util/virnetdevbridge.h index f8cc70e7f0..8df5e51c2e 100644 --- a/src/util/virnetdevbridge.h +++ b/src/util/virnetdevbridge.h @@ -16,11 +16,10 @@ * . */ =20 -#ifndef LIBVIRT_VIRNETDEVBRIDGE_H -# define LIBVIRT_VIRNETDEVBRIDGE_H +#pragma once =20 -# include "internal.h" -# include "virmacaddr.h" +#include "internal.h" +#include "virmacaddr.h" =20 int virNetDevBridgeCreate(const char *brname) ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; @@ -89,4 +88,3 @@ int virNetDevBridgeFDBAdd(const virMacAddr *mac, const ch= ar *ifname, int virNetDevBridgeFDBDel(const virMacAddr *mac, const char *ifname, unsigned int flags) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; -#endif /* LIBVIRT_VIRNETDEVBRIDGE_H */ diff --git a/src/util/virnetdevip.h b/src/util/virnetdevip.h index d885d09a00..9fa5f446b0 100644 --- a/src/util/virnetdevip.h +++ b/src/util/virnetdevip.h @@ -16,11 +16,10 @@ * . */ =20 -#ifndef LIBVIRT_VIRNETDEVIP_H -# define LIBVIRT_VIRNETDEVIP_H +#pragma once =20 -# include "virsocketaddr.h" -# include "virautoclean.h" +#include "virsocketaddr.h" +#include "virautoclean.h" =20 typedef struct _virNetDevIPAddr virNetDevIPAddr; typedef virNetDevIPAddr *virNetDevIPAddrPtr; @@ -97,5 +96,3 @@ int virNetDevIPInfoAddToDev(const char *ifname, =20 VIR_DEFINE_AUTOPTR_FUNC(virNetDevIPAddr, virNetDevIPAddrFree); VIR_DEFINE_AUTOPTR_FUNC(virNetDevIPRoute, virNetDevIPRouteFree); - -#endif /* LIBVIRT_VIRNETDEVIP_H */ diff --git a/src/util/virnetdevmacvlan.h b/src/util/virnetdevmacvlan.h index a33ea8f29e..d1b479ed9f 100644 --- a/src/util/virnetdevmacvlan.h +++ b/src/util/virnetdevmacvlan.h @@ -17,16 +17,15 @@ * . */ =20 -#ifndef LIBVIRT_VIRNETDEVMACVLAN_H -# define LIBVIRT_VIRNETDEVMACVLAN_H +#pragma once =20 -# include "internal.h" -# include "virmacaddr.h" -# include "virsocketaddr.h" -# include "virnetdevbandwidth.h" -# include "virnetdevvportprofile.h" -# include "virnetdevvlan.h" -# include "virenum.h" +#include "internal.h" +#include "virmacaddr.h" +#include "virsocketaddr.h" +#include "virnetdevbandwidth.h" +#include "virnetdevvportprofile.h" +#include "virnetdevvlan.h" +#include "virenum.h" =20 /* the mode type for macvtap devices */ typedef enum { @@ -52,8 +51,8 @@ typedef enum { /* libvirt will start macvtap/macvlan interface names with one of * these prefixes when it auto-generates the name */ -# define VIR_NET_GENERATED_MACVTAP_PREFIX "macvtap" -# define VIR_NET_GENERATED_MACVLAN_PREFIX "macvlan" +#define VIR_NET_GENERATED_MACVTAP_PREFIX "macvtap" +#define VIR_NET_GENERATED_MACVLAN_PREFIX "macvlan" =20 int virNetDevMacVLanReserveName(const char *name, bool quietfail); int virNetDevMacVLanReleaseName(const char *name); @@ -112,4 +111,3 @@ int virNetDevMacVLanVPortProfileRegisterCallback(const = char *ifname, virNetDevVPortProfileOp v= mOp) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK; -#endif /* LIBVIRT_VIRNETDEVMACVLAN_H */ diff --git a/src/util/virnetdevmidonet.h b/src/util/virnetdevmidonet.h index dde72c0653..aa7fe49103 100644 --- a/src/util/virnetdevmidonet.h +++ b/src/util/virnetdevmidonet.h @@ -16,11 +16,10 @@ * . */ =20 -#ifndef LIBVIRT_VIRNETDEVMIDONET_H -# define LIBVIRT_VIRNETDEVMIDONET_H +#pragma once =20 -# include "internal.h" -# include "virnetdevvportprofile.h" +#include "internal.h" +#include "virnetdevvportprofile.h" =20 =20 int virNetDevMidonetBindPort(const char *ifname, @@ -29,5 +28,3 @@ int virNetDevMidonetBindPort(const char *ifname, =20 int virNetDevMidonetUnbindPort(virNetDevVPortProfilePtr virtualport) ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; - -#endif /* LIBVIRT_VIRNETDEVMIDONET_H */ diff --git a/src/util/virnetdevopenvswitch.h b/src/util/virnetdevopenvswitc= h.h index c9428f9e3e..07496fb07d 100644 --- a/src/util/virnetdevopenvswitch.h +++ b/src/util/virnetdevopenvswitch.h @@ -18,14 +18,13 @@ * . */ =20 -#ifndef LIBVIRT_VIRNETDEVOPENVSWITCH_H -# define LIBVIRT_VIRNETDEVOPENVSWITCH_H +#pragma once =20 -# include "internal.h" -# include "virnetdevvportprofile.h" -# include "virnetdevvlan.h" +#include "internal.h" +#include "virnetdevvportprofile.h" +#include "virnetdevvlan.h" =20 -# define VIR_NETDEV_OVS_DEFAULT_TIMEOUT 5 +#define VIR_NETDEV_OVS_DEFAULT_TIMEOUT 5 =20 void virNetDevOpenvswitchSetTimeout(unsigned int timeout); =20 @@ -64,5 +63,3 @@ int virNetDevOpenvswitchGetVhostuserIfname(const char *pa= th, int virNetDevOpenvswitchUpdateVlan(const char *ifname, virNetDevVlanPtr virtVlan) ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; - -#endif /* LIBVIRT_VIRNETDEVOPENVSWITCH_H */ diff --git a/src/util/virnetdevtap.h b/src/util/virnetdevtap.h index 2b3893cd37..ec5789959a 100644 --- a/src/util/virnetdevtap.h +++ b/src/util/virnetdevtap.h @@ -16,19 +16,18 @@ * . */ =20 -#ifndef LIBVIRT_VIRNETDEVTAP_H -# define LIBVIRT_VIRNETDEVTAP_H +#pragma once =20 -# include "internal.h" -# include "virnetdev.h" -# include "virnetdevvportprofile.h" -# include "virnetdevvlan.h" +#include "internal.h" +#include "virnetdev.h" +#include "virnetdevvportprofile.h" +#include "virnetdevvlan.h" =20 -# ifdef __FreeBSD__ +#ifdef __FreeBSD__ /* This should be defined on OSes that don't automatically * cleanup released devices */ -# define VIR_NETDEV_TAP_REQUIRE_MANUAL_CLEANUP 1 -# endif +# define VIR_NETDEV_TAP_REQUIRE_MANUAL_CLEANUP 1 +#endif =20 int virNetDevTapCreate(char **ifname, const char *tunpath, @@ -103,5 +102,3 @@ int virNetDevTapInterfaceStats(const char *ifname, virDomainInterfaceStatsPtr stats, bool swapped) ATTRIBUTE_RETURN_CHECK; - -#endif /* LIBVIRT_VIRNETDEVTAP_H */ diff --git a/src/util/virnetdevveth.h b/src/util/virnetdevveth.h index b00eb2b3a2..4380b7cfe1 100644 --- a/src/util/virnetdevveth.h +++ b/src/util/virnetdevveth.h @@ -17,15 +17,12 @@ * . */ =20 -#ifndef LIBVIRT_VIRNETDEVVETH_H -# define LIBVIRT_VIRNETDEVVETH_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 /* Function declarations */ int virNetDevVethCreate(char **veth1, char **veth2) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; int virNetDevVethDelete(const char *veth) ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; - -#endif /* LIBVIRT_VIRNETDEVVETH_H */ diff --git a/src/util/virnetdevvlan.h b/src/util/virnetdevvlan.h index d986300d2a..87d361a1cf 100644 --- a/src/util/virnetdevvlan.h +++ b/src/util/virnetdevvlan.h @@ -16,13 +16,12 @@ * . */ =20 -#ifndef LIBVIRT_VIRNETDEVVLAN_H -# define LIBVIRT_VIRNETDEVVLAN_H +#pragma once =20 -# include +#include =20 -# include "virautoclean.h" -# include "virenum.h" +#include "virautoclean.h" +#include "virenum.h" =20 typedef enum { VIR_NATIVE_VLAN_MODE_DEFAULT =3D 0, @@ -50,5 +49,3 @@ int virNetDevVlanEqual(const virNetDevVlan *a, const virN= etDevVlan *b); int virNetDevVlanCopy(virNetDevVlanPtr dst, const virNetDevVlan *src); =20 VIR_DEFINE_AUTOPTR_FUNC(virNetDevVlan, virNetDevVlanFree); - -#endif /* LIBVIRT_VIRNETDEVVLAN_H */ diff --git a/src/util/virnetdevvportprofile.h b/src/util/virnetdevvportprof= ile.h index afa982f2e3..d1db8bac6a 100644 --- a/src/util/virnetdevvportprofile.h +++ b/src/util/virnetdevvportprofile.h @@ -16,16 +16,15 @@ * . */ =20 -#ifndef LIBVIRT_VIRNETDEVVPORTPROFILE_H -# define LIBVIRT_VIRNETDEVVPORTPROFILE_H +#pragma once =20 -# include "internal.h" -# include "viruuid.h" -# include "virutil.h" -# include "virmacaddr.h" -# include "virenum.h" +#include "internal.h" +#include "viruuid.h" +#include "virutil.h" +#include "virmacaddr.h" +#include "virenum.h" =20 -# define LIBVIRT_IFLA_VF_PORT_PROFILE_MAX 40 +#define LIBVIRT_IFLA_VF_PORT_PROFILE_MAX 40 =20 typedef enum virNetDevVPortProfile { VIR_NETDEV_VPORT_PROFILE_NONE, @@ -109,6 +108,3 @@ int virNetDevVPortProfileDisassociate(const char *ifnam= e, int vf, virNetDevVPortProfileOp vmOp) ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK; - - -#endif /* LIBVIRT_VIRNETDEVVPORTPROFILE_H */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560874539; cv=none; d=zoho.com; s=zohoarc; b=nZao+hFywrGeuL2UWHtIcQQ54W8CLHHZFV/TdZGZMSuN2pVo/KRD7MvlFYyjB2mnA/vokHQo5Vx/b0EneBPEDgGE4B+ks1URACER4z/otXlxBSuuDNmXuje1Vly6gt0JjcXrYGps7Smm3U0w0UUVgdAR4n0WiBQ/SnnePleGjag= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560874539; 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=eftJUWwgXGkybEWDk2nLE3JUB6SSK78xY4GgaRpBCOQ=; b=kmvHvQ0piYCd4+BCvPCl4X36WcroAJQBQRcoGxuistKVlBkxBCMPZtVOsZGWDci1DkNDRXq+3foJDi4u6Epz7Rp3L5DQlKxXigvRU0prJQrWQS7C3xm9+YITvciMMNrd4uUa3k2x4G2oCsvcBEUxVy35xL42ldFfuj1IgkL/sj0= 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 1560874539827722.7959825039145; Tue, 18 Jun 2019 09:15:39 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 329EE3082A49; Tue, 18 Jun 2019 16:15:27 +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 0445560FAB; Tue, 18 Jun 2019 16:15:25 +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 A162D206D4; Tue, 18 Jun 2019 16:15:23 +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 x5IGDUig024246 for ; Tue, 18 Jun 2019 12:13:30 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8D84D60FAB; Tue, 18 Jun 2019 16:13:30 +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 48F2484EF for ; Tue, 18 Jun 2019 16:13:30 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:12:49 -0500 Message-Id: <20190618161316.1722-20-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 19/46] util: arch.h: 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.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Tue, 18 Jun 2019 16:15:32 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/util/virarch.h | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/src/util/virarch.h b/src/util/virarch.h index 638ca9f484..233b83f31b 100644 --- a/src/util/virarch.h +++ b/src/util/virarch.h @@ -19,10 +19,9 @@ * */ =20 -#ifndef LIBVIRT_VIRARCH_H -# define LIBVIRT_VIRARCH_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 typedef enum { VIR_ARCH_NONE, @@ -73,28 +72,28 @@ typedef enum { VIR_ARCH_LAST, } virArch; =20 -# define ARCH_IS_X86(arch) ((arch) =3D=3D VIR_ARCH_X86_64 ||\ - (arch) =3D=3D VIR_ARCH_I686) +#define ARCH_IS_X86(arch) ((arch) =3D=3D VIR_ARCH_X86_64 ||\ + (arch) =3D=3D VIR_ARCH_I686) =20 -# define ARCH_IS_PPC(arch) ((arch) =3D=3D VIR_ARCH_PPC ||\ - (arch) =3D=3D VIR_ARCH_PPCLE ||\ - (arch) =3D=3D VIR_ARCH_PPC64 ||\ - (arch) =3D=3D VIR_ARCH_PPC64LE ||\ - (arch) =3D=3D VIR_ARCH_PPCEMB) +#define ARCH_IS_PPC(arch) ((arch) =3D=3D VIR_ARCH_PPC ||\ + (arch) =3D=3D VIR_ARCH_PPCLE ||\ + (arch) =3D=3D VIR_ARCH_PPC64 ||\ + (arch) =3D=3D VIR_ARCH_PPC64LE ||\ + (arch) =3D=3D VIR_ARCH_PPCEMB) =20 -# define ARCH_IS_PPC64(arch) ((arch) =3D=3D VIR_ARCH_PPC64 ||\ - (arch) =3D=3D VIR_ARCH_PPC64LE) +#define ARCH_IS_PPC64(arch) ((arch) =3D=3D VIR_ARCH_PPC64 ||\ + (arch) =3D=3D VIR_ARCH_PPC64LE) =20 -# define ARCH_IS_ARM(arch) ((arch) =3D=3D VIR_ARCH_ARMV6L ||\ - (arch) =3D=3D VIR_ARCH_ARMV7L ||\ - (arch) =3D=3D VIR_ARCH_ARMV7B ||\ - (arch) =3D=3D VIR_ARCH_AARCH64) +#define ARCH_IS_ARM(arch) ((arch) =3D=3D VIR_ARCH_ARMV6L ||\ + (arch) =3D=3D VIR_ARCH_ARMV7L ||\ + (arch) =3D=3D VIR_ARCH_ARMV7B ||\ + (arch) =3D=3D VIR_ARCH_AARCH64) =20 -# define ARCH_IS_RISCV(arch) ((arch) =3D=3D VIR_ARCH_RISCV32 ||\ - (arch) =3D=3D VIR_ARCH_RISCV64) +#define ARCH_IS_RISCV(arch) ((arch) =3D=3D VIR_ARCH_RISCV32 ||\ + (arch) =3D=3D VIR_ARCH_RISCV64) =20 -# define ARCH_IS_S390(arch) ((arch) =3D=3D VIR_ARCH_S390 ||\ - (arch) =3D=3D VIR_ARCH_S390X) +#define ARCH_IS_S390(arch) ((arch) =3D=3D VIR_ARCH_S390 ||\ + (arch) =3D=3D VIR_ARCH_S390X) =20 typedef enum { VIR_ARCH_LITTLE_ENDIAN, @@ -107,5 +106,3 @@ const char *virArchToString(virArch arch); virArch virArchFromString(const char *name); =20 virArch virArchFromHost(void); - -#endif /* LIBVIRT_VIRARCH_H */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560876108; cv=none; d=zoho.com; s=zohoarc; b=KEkrABl9Nc6n4bJVSh8tgIGfAXV1mscundUMRt9CWjbYu78nCWlyvfCl+0HlS+/MIlwot33dJ1/IKWWHZINhMRbztnsUqMA48K1QwJaJu/aTgBVF2fYIPN+B+trTfh8Wd1aqwnhn39hz06N7Lm7sSL2v8g8UXWUyjCqruPr0cOM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560876108; 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=JNsTIF4auCy1HNZzOKjUx9OkdmLq0vdOv8ehqsA19ME=; b=GHOz2uGqzu1kwJsLHwuL+UeOZNdWT80G9+kWwHyYXQFjX/MXYM2s5H72w26DCApbso3RIzxQT9HY2j90zWW2Bi7IuJGB7LcUOj9Aht+S3sz2TaXdtXj4r9BiK+MNtjYRDktLiG+5aXv1RNkeSRc9ecu6viLPJljPlnBDYTGExv0= 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 1560876108582715.8222077160937; Tue, 18 Jun 2019 09:41:48 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id C9240C053B34; Tue, 18 Jun 2019 16:41:46 +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 A05C57D933; Tue, 18 Jun 2019 16:41:46 +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 5F1AB206D8; Tue, 18 Jun 2019 16:41:46 +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 x5IGDUga024251 for ; Tue, 18 Jun 2019 12:13:30 -0400 Received: by smtp.corp.redhat.com (Postfix) id DD5B784EF; Tue, 18 Jun 2019 16:13:30 +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 AC1FC60FAB for ; Tue, 18 Jun 2019 16:13:30 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:12:50 -0500 Message-Id: <20190618161316.1722-21-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 20/46] util: file: 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.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 18 Jun 2019 16:41:47 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/util/virfile.h | 61 ++++++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 32 deletions(-) diff --git a/src/util/virfile.h b/src/util/virfile.h index 641960e2ca..094c92e2b9 100644 --- a/src/util/virfile.h +++ b/src/util/virfile.h @@ -22,15 +22,14 @@ * */ =20 -#ifndef LIBVIRT_VIRFILE_H -# define LIBVIRT_VIRFILE_H +#pragma once =20 -# include +#include =20 -# include "internal.h" -# include "virbitmap.h" -# include "virstoragefile.h" -# include "virautoclean.h" +#include "internal.h" +#include "virbitmap.h" +#include "virstoragefile.h" +#include "virautoclean.h" =20 typedef enum { VIR_FILE_CLOSE_PRESERVE_ERRNO =3D 1 << 0, @@ -59,25 +58,25 @@ static inline void virForceCloseHelper(int *fd) =20 /* For use on normal paths; caller must check return value, and failure sets errno per close. */ -# define VIR_CLOSE(FD) virFileClose(&(FD), 0) -# define VIR_FCLOSE(FILE) virFileFclose(&(FILE), false) +#define VIR_CLOSE(FD) virFileClose(&(FD), 0) +#define VIR_FCLOSE(FILE) virFileFclose(&(FILE), false) =20 /* Wrapper around fdopen that consumes fd on success. */ -# define VIR_FDOPEN(FD, MODE) virFileFdopen(&(FD), MODE) +#define VIR_FDOPEN(FD, MODE) virFileFdopen(&(FD), MODE) =20 /* For use on cleanup paths; errno is unaffected by close, and no return value to worry about. */ -# define VIR_FORCE_CLOSE(FD) virForceCloseHelper(&(FD)) -# define VIR_FORCE_FCLOSE(FILE) ignore_value(virFileFclose(&(FILE), true)) +#define VIR_FORCE_CLOSE(FD) virForceCloseHelper(&(FD)) +#define VIR_FORCE_FCLOSE(FILE) ignore_value(virFileFclose(&(FILE), true)) =20 /* Similar VIR_FORCE_CLOSE() but ignores EBADF errors since they are expec= ted * during mass close after fork(). */ -# define VIR_MASS_CLOSE(FD) \ +#define VIR_MASS_CLOSE(FD) \ ignore_value(virFileClose(&(FD), \ VIR_FILE_CLOSE_PRESERVE_ERRNO | \ VIR_FILE_CLOSE_IGNORE_EBADF)) =20 -# define VIR_LOG_CLOSE(FD) \ +#define VIR_LOG_CLOSE(FD) \ ignore_value(virFileClose(&(FD), \ VIR_FILE_CLOSE_PRESERVE_ERRNO | \ VIR_FILE_CLOSE_DONT_LOG)) @@ -89,7 +88,7 @@ static inline void virForceCloseHelper(int *fd) * when the fd goes out of scope. It's used to eliminate VIR_FORCE_CLOSE * in cleanup sections. */ -# define VIR_AUTOCLOSE __attribute__((cleanup(virForceCloseHelper))) int +#define VIR_AUTOCLOSE __attribute__((cleanup(virForceCloseHelper))) int =20 =20 /* Opaque type for managing a wrapper around a fd. */ @@ -268,7 +267,7 @@ int virDirRead(DIR *dirp, struct dirent **ent, const ch= ar *dirname) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; void virDirClose(DIR **dirp) ATTRIBUTE_NONNULL(1); -# define VIR_DIR_CLOSE(dir) virDirClose(&(dir)) +#define VIR_DIR_CLOSE(dir) virDirClose(&(dir)) =20 int virFileMakePath(const char *path) ATTRIBUTE_RETURN_CHECK; int virFileMakePathWithMode(const char *path, @@ -280,26 +279,26 @@ char *virFileBuildPath(const char *dir, const char *ext) ATTRIBUTE_RETURN_CHECK; =20 =20 -# ifdef WIN32 +#ifdef WIN32 /* On Win32, the canonical directory separator is the backslash, and * the search path separator is the semicolon. Note that also the * (forward) slash works as directory separator. */ -# define VIR_FILE_DIR_SEPARATOR '\\' -# define VIR_FILE_DIR_SEPARATOR_S "\\" -# define VIR_FILE_IS_DIR_SEPARATOR(c) ((c) =3D=3D VIR_FILE_DIR_SEPARATOR = || (c) =3D=3D '/') -# define VIR_FILE_PATH_SEPARATOR ';' -# define VIR_FILE_PATH_SEPARATOR_S ";" +# define VIR_FILE_DIR_SEPARATOR '\\' +# define VIR_FILE_DIR_SEPARATOR_S "\\" +# define VIR_FILE_IS_DIR_SEPARATOR(c) ((c) =3D=3D VIR_FILE_DIR_SEPARATOR |= | (c) =3D=3D '/') +# define VIR_FILE_PATH_SEPARATOR ';' +# define VIR_FILE_PATH_SEPARATOR_S ";" =20 -# else /* !WIN32 */ +#else /* !WIN32 */ =20 -# define VIR_FILE_DIR_SEPARATOR '/' -# define VIR_FILE_DIR_SEPARATOR_S "/" -# define VIR_FILE_IS_DIR_SEPARATOR(c) ((c) =3D=3D VIR_FILE_DIR_SEPARATOR) -# define VIR_FILE_PATH_SEPARATOR ':' -# define VIR_FILE_PATH_SEPARATOR_S ":" +# define VIR_FILE_DIR_SEPARATOR '/' +# define VIR_FILE_DIR_SEPARATOR_S "/" +# define VIR_FILE_IS_DIR_SEPARATOR(c) ((c) =3D=3D VIR_FILE_DIR_SEPARATOR) +# define VIR_FILE_PATH_SEPARATOR ':' +# define VIR_FILE_PATH_SEPARATOR_S ":" =20 -# endif /* !WIN32 */ +#endif /* !WIN32 */ =20 bool virFileIsAbsPath(const char *path); int virFileAbsPath(const char *path, @@ -314,7 +313,7 @@ int virFileOpenTty(int *ttymaster, char *virFileFindMountPoint(const char *type); =20 /* NB: this should be combined with virFileBuildPath */ -# define virBuildPath(path, ...) \ +#define virBuildPath(path, ...) \ virBuildPathInternal(path, __VA_ARGS__, NULL) int virBuildPathInternal(char **path, ...) ATTRIBUTE_SENTINEL; =20 @@ -392,5 +391,3 @@ int virFileSetXAttr(const char *path, int virFileRemoveXAttr(const char *path, const char *name) ATTRIBUTE_NOINLINE; - -#endif /* LIBVIRT_VIRFILE_H */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560874536; cv=none; d=zoho.com; s=zohoarc; b=mmrCddBEtJWKUSsaTV3h/1qnZ4MtVogltifHXkt90flqDfyx1FvQ0GhesN90DDirRGvdOgYA3jJMW0Dtxn06KElfxpuJsXbu+xLOZkOJK+anv8y0sEWzMDNWMIb3RwwOvwmJpNkO7nzn9bsr1wG/OnFwnrmwWZ6I9nJpvSjX9WQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560874536; 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=NO98Cq1Ahv5Cju5eG5uSIVTQidxkQ25jTWmy2gOffO8=; b=RWYtP9WU4p0auuzKOuZBDyD00qfqGe0em6N+V8zi0tJPuBC3xafjOr64F07Nr1oG1VFcxRcFjHX5F+hi6E1W1Npgt+gawBwlDJGojgu4KR5qDuUFatJCWunNkvBQJK1WjCapuaEOpHXuOLyYppt1v1/YQQ//4NWCH5MqABMllbo= 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 1560874536937257.94313333832895; Tue, 18 Jun 2019 09:15:36 -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 E6E973162916; Tue, 18 Jun 2019 16:15:29 +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 B7F515F593; Tue, 18 Jun 2019 16:15:29 +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 7800B1806B1A; Tue, 18 Jun 2019 16:15:29 +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 x5IGDVGG024256 for ; Tue, 18 Jun 2019 12:13:31 -0400 Received: by smtp.corp.redhat.com (Postfix) id 39CB960FAB; 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 081F28518 for ; Tue, 18 Jun 2019 16:13:30 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:12:51 -0500 Message-Id: <20190618161316.1722-22-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 21/46] util: firewall: 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.41]); Tue, 18 Jun 2019 16:15:30 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/util/virfirewall.h | 11 ++++------- src/util/virfirewalld.h | 7 ++----- src/util/virfirewalldpriv.h | 7 ++----- src/util/virfirewallpriv.h | 7 ++----- 4 files changed, 10 insertions(+), 22 deletions(-) diff --git a/src/util/virfirewall.h b/src/util/virfirewall.h index a0e81a9a46..ff4626975b 100644 --- a/src/util/virfirewall.h +++ b/src/util/virfirewall.h @@ -18,11 +18,10 @@ * . */ =20 -#ifndef LIBVIRT_VIRFIREWALL_H -# define LIBVIRT_VIRFIREWALL_H +#pragma once =20 -# include "internal.h" -# include "virautoclean.h" +#include "internal.h" +#include "virautoclean.h" =20 typedef struct _virFirewall virFirewall; typedef virFirewall *virFirewallPtr; @@ -52,7 +51,7 @@ void virFirewallFree(virFirewallPtr firewall); * * Returns the new rule */ -# define virFirewallAddRule(firewall, layer, ...) \ +#define virFirewallAddRule(firewall, layer, ...) \ virFirewallAddRuleFull(firewall, layer, false, NULL, NULL, __VA_A= RGS__) =20 typedef int (*virFirewallQueryCallback)(virFirewallPtr firewall, @@ -116,5 +115,3 @@ int virFirewallApply(virFirewallPtr firewall); void virFirewallSetLockOverride(bool avoid); =20 VIR_DEFINE_AUTOPTR_FUNC(virFirewall, virFirewallFree); - -#endif /* LIBVIRT_VIRFIREWALL_H */ diff --git a/src/util/virfirewalld.h b/src/util/virfirewalld.h index f05f5f2f08..d2db3b6f47 100644 --- a/src/util/virfirewalld.h +++ b/src/util/virfirewalld.h @@ -18,10 +18,9 @@ * . */ =20 -#ifndef LIBVIRT_VIRFIREWALLD_H -# define LIBVIRT_VIRFIREWALLD_H +#pragma once =20 -# define VIR_FIREWALL_FIREWALLD_SERVICE "org.fedoraproject.FirewallD1" +#define VIR_FIREWALL_FIREWALLD_SERVICE "org.fedoraproject.FirewallD1" =20 typedef enum { VIR_FIREWALLD_BACKEND_NONE, @@ -42,5 +41,3 @@ int virFirewallDApplyRule(virFirewallLayer layer, =20 int virFirewallDInterfaceSetZone(const char *iface, const char *zone); - -#endif /* LIBVIRT_VIRFIREWALLD_H */ diff --git a/src/util/virfirewalldpriv.h b/src/util/virfirewalldpriv.h index 6c03b467c9..4500a452eb 100644 --- a/src/util/virfirewalldpriv.h +++ b/src/util/virfirewalldpriv.h @@ -22,9 +22,6 @@ # error "virfirewalldpriv.h may only be included by virfirewalld.c or test= suites" #endif /* LIBVIRT_VIRFIREWALLDPRIV_H_ALLOW */ =20 -#ifndef LIBVIRT_VIRFIREWALLDPRIV_H -# define LIBVIRT_VIRFIREWALLDPRIV_H +#pragma once =20 -# define VIR_FIREWALL_FIREWALLD_SERVICE "org.fedoraproject.FirewallD1" - -#endif /* LIBVIRT_VIRFIREWALLDPRIV_H */ +#define VIR_FIREWALL_FIREWALLD_SERVICE "org.fedoraproject.FirewallD1" diff --git a/src/util/virfirewallpriv.h b/src/util/virfirewallpriv.h index 7c31d0680d..b846f8799c 100644 --- a/src/util/virfirewallpriv.h +++ b/src/util/virfirewallpriv.h @@ -22,10 +22,9 @@ # error "virfirewallpriv.h may only be included by virfirewall.c or test s= uites" #endif /* LIBVIRT_VIRFIREWALLPRIV_H_ALLOW */ =20 -#ifndef LIBVIRT_VIRFIREWALLPRIV_H -# define LIBVIRT_VIRFIREWALLPRIV_H +#pragma once =20 -# include "virfirewall.h" +#include "virfirewall.h" =20 typedef enum { VIR_FIREWALL_BACKEND_AUTOMATIC, @@ -36,5 +35,3 @@ typedef enum { } virFirewallBackend; =20 int virFirewallSetBackend(virFirewallBackend backend); - -#endif /* LIBVIRT_VIRFIREWALLPRIV_H */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560874541; cv=none; d=zoho.com; s=zohoarc; b=kC4olAK1AUWtdLUKMxpc0mLYxh6oy4vDeqQnYmZnuylTSFaEfQ5U0xfndglWaYlKKnWFDCVRjLTCZptNgz2ePdX1tTO477mMpQo4cOYfNN3iYY0AD/c6UHCm79xAfO01zeLdFk7WKyPFhDPM6sk/uQZ1Tzp/luaplJD9GneigQk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560874541; 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=Ga/ebLXgxJ1ymbEDBCgDXdAjPKiNaQW+EEj4mYgy878=; b=h1/9Jn4IoJlG61oyJsaBnq8R0f7ikvNbUWMEm0UyNPQF87TWeqtogbKeOYsTZElZ9EfsXt01g+STdTZwSIp8hKpFVNfJdAvWckKLYCIoFCMMUoA+zZulWb3dHqXef8sxE/M0HNgylZC1oChIvkOoG0M8805RPGmEgA1sefwheGE= 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 1560874541949358.1546450081621; Tue, 18 Jun 2019 09:15:41 -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 0951E3162906; Tue, 18 Jun 2019 16:15:38 +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 CB8DE5F5B8; Tue, 18 Jun 2019 16:15:37 +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 93A951806B23; Tue, 18 Jun 2019 16:15:37 +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 x5IGDVFU024264 for ; Tue, 18 Jun 2019 12:13:31 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8ACC884EF; 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 5968E60FAB 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:52 -0500 Message-Id: <20190618161316.1722-23-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 22/46] util: host: 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.41]); Tue, 18 Jun 2019 16:15:38 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/util/virhostcpu.h | 17 +++++++---------- src/util/virhostcpupriv.h | 11 ++++------- src/util/virhostdev.h | 19 ++++++++----------- src/util/virhostmem.h | 7 ++----- 4 files changed, 21 insertions(+), 33 deletions(-) diff --git a/src/util/virhostcpu.h b/src/util/virhostcpu.h index b822bc11a8..2ba79b97a5 100644 --- a/src/util/virhostcpu.h +++ b/src/util/virhostcpu.h @@ -19,13 +19,12 @@ * . */ =20 -#ifndef LIBVIRT_VIRHOSTCPU_H -# define LIBVIRT_VIRHOSTCPU_H +#pragma once =20 -# include "internal.h" -# include "virarch.h" -# include "virbitmap.h" -# include "virenum.h" +#include "internal.h" +#include "virarch.h" +#include "virbitmap.h" +#include "virenum.h" =20 =20 typedef struct _virHostCPUTscInfo virHostCPUTscInfo; @@ -64,12 +63,12 @@ int virHostCPUStatsAssign(virNodeCPUStatsPtr param, const char *name, unsigned long long value); =20 -# ifdef __linux__ +#ifdef __linux__ int virHostCPUGetSocket(unsigned int cpu, unsigned int *socket); int virHostCPUGetCore(unsigned int cpu, unsigned int *core); =20 virBitmapPtr virHostCPUGetSiblingsList(unsigned int cpu); -# endif +#endif =20 int virHostCPUGetOnline(unsigned int cpu, bool *online); =20 @@ -79,5 +78,3 @@ int virHostCPUGetMSR(unsigned long index, uint64_t *msr); =20 virHostCPUTscInfoPtr virHostCPUGetTscInfo(void); - -#endif /* LIBVIRT_VIRHOSTCPU_H */ diff --git a/src/util/virhostcpupriv.h b/src/util/virhostcpupriv.h index 980d4cb1fa..afb415f9ea 100644 --- a/src/util/virhostcpupriv.h +++ b/src/util/virhostcpupriv.h @@ -23,12 +23,11 @@ # error "virhostcpupriv.h may only be included by virhostcpu.c or test sui= tes" #endif /* LIBVIRT_VIRHOSTCPUPRIV_H_ALLOW */ =20 -#ifndef LIBVIRT_VIRHOSTCPUPRIV_H -# define LIBVIRT_VIRHOSTCPUPRIV_H +#pragma once =20 -# include "virhostcpu.h" +#include "virhostcpu.h" =20 -# ifdef __linux__ +#ifdef __linux__ int virHostCPUGetInfoPopulateLinux(FILE *cpuinfo, virArch arch, unsigned int *cpus, @@ -42,6 +41,4 @@ int virHostCPUGetStatsLinux(FILE *procstat, int cpuNum, virNodeCPUStatsPtr params, int *nparams); -# endif - -#endif /* LIBVIRT_VIRHOSTCPUPRIV_H */ +#endif diff --git a/src/util/virhostdev.h b/src/util/virhostdev.h index 7263f320a2..88501e2743 100644 --- a/src/util/virhostdev.h +++ b/src/util/virhostdev.h @@ -19,17 +19,16 @@ * . */ =20 -#ifndef LIBVIRT_VIRHOSTDEV_H -# define LIBVIRT_VIRHOSTDEV_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 -# include "virpci.h" -# include "virusb.h" -# include "virscsi.h" -# include "virscsivhost.h" -# include "conf/domain_conf.h" -# include "virmdev.h" +#include "virpci.h" +#include "virusb.h" +#include "virscsi.h" +#include "virscsivhost.h" +#include "conf/domain_conf.h" +#include "virmdev.h" =20 typedef enum { VIR_HOSTDEV_STRICT_ACS_CHECK =3D (1 << 0), /* strict acs check */ @@ -202,5 +201,3 @@ int virHostdevPCINodeDeviceReAttach(virHostdevManagerPt= r mgr, int virHostdevPCINodeDeviceReset(virHostdevManagerPtr mgr, virPCIDevicePtr pci) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); - -#endif /* LIBVIRT_VIRHOSTDEV_H */ diff --git a/src/util/virhostmem.h b/src/util/virhostmem.h index cba1732d8d..1369829807 100644 --- a/src/util/virhostmem.h +++ b/src/util/virhostmem.h @@ -19,10 +19,9 @@ * . */ =20 -#ifndef LIBVIRT_VIRHOSTMEM_H -# define LIBVIRT_VIRHOSTMEM_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 int virHostMemGetStats(int cellNum, virNodeMemoryStatsPtr params, @@ -54,5 +53,3 @@ int virHostMemAllocPages(unsigned int npages, int startCell, unsigned int cellCount, bool add); - -#endif /* LIBVIRT_VIRHOSTMEM_H */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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 From nobody Tue Apr 30 01:28:16 2024 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=1560874574; cv=none; d=zoho.com; s=zohoarc; b=cvjVPc9IUvCT9LJgq7xR1BdzwIupdjz72IvYIiDyrDQsb25uwOh7p+dJm8EL7UWxsbJ9+g7WwzGpPo7+xMY6aYrKkqqDgVNuhfEb284CgR37qIB5zR6BLg2kn1+rUFKmOXhOWRFWsPQOJiDYBmO5kRQB5IcJsq2stH+pt4ZkUaI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560874574; 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=Vcm0cvFCHmpXa+y4/C9U2IDI1J4PtgGJnTskKJFvnBM=; b=OpcFtPY0bfYKmzimiFYgXNrybAE7i5SzI0pL0vdmKKYGlmXe8zsvS+Tmzlc1azzmpIJhLfDSoKdscfoJdD/hvweuwH2m9SMH2ZzxZbGAqHamSIXRToTBgVtihTEv5f18Ma5BG2afMJaeGbFP2/Z86IDv+cIumK4jGz1cGakG8eQ= 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 1560874574535525.8584471745748; Tue, 18 Jun 2019 09:16:14 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C972430F1BDB; Tue, 18 Jun 2019 16:16:05 +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 A32311001E75; Tue, 18 Jun 2019 16:16:05 +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 669031806B1E; Tue, 18 Jun 2019 16:16:05 +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 x5IGDWIa024276 for ; Tue, 18 Jun 2019 12:13:32 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3817484EF; Tue, 18 Jun 2019 16:13:32 +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 0678060FAB 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:54 -0500 Message-Id: <20190618161316.1722-25-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 24/46] util: cgroup: 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.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Tue, 18 Jun 2019 16:16:08 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/util/vircgroup.h | 10 ++++------ src/util/vircgroupbackend.h | 15 ++++++--------- src/util/vircgroupv1.h | 5 +---- src/util/vircgroupv2.h | 5 +---- 4 files changed, 12 insertions(+), 23 deletions(-) diff --git a/src/util/vircgroup.h b/src/util/vircgroup.h index 377e0fd870..2f68fdb685 100644 --- a/src/util/vircgroup.h +++ b/src/util/vircgroup.h @@ -19,12 +19,11 @@ * . */ =20 -#ifndef LIBVIRT_VIRCGROUP_H -# define LIBVIRT_VIRCGROUP_H +#pragma once =20 -# include "virutil.h" -# include "virbitmap.h" -# include "virenum.h" +#include "virutil.h" +#include "virbitmap.h" +#include "virenum.h" =20 struct _virCgroup; typedef struct _virCgroup virCgroup; @@ -285,4 +284,3 @@ int virCgroupSetOwner(virCgroupPtr cgroup, int virCgroupHasEmptyTasks(virCgroupPtr cgroup, int controller); =20 bool virCgroupControllerAvailable(int controller); -#endif /* LIBVIRT_VIRCGROUP_H */ diff --git a/src/util/vircgroupbackend.h b/src/util/vircgroupbackend.h index 24b45be9bb..e58e327c68 100644 --- a/src/util/vircgroupbackend.h +++ b/src/util/vircgroupbackend.h @@ -18,15 +18,14 @@ * . */ =20 -#ifndef LIBVIRT_VIRCGROUPBACKEND_H -# define LIBVIRT_VIRCGROUPBACKEND_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 -# include "vircgroup.h" -# include "virhash.h" +#include "vircgroup.h" +#include "virhash.h" =20 -# define CGROUP_MAX_VAL 512 +#define CGROUP_MAX_VAL 512 =20 typedef enum { VIR_CGROUP_NONE =3D 0, /* create subdir under each cgroup if possible.= */ @@ -447,7 +446,7 @@ virCgroupBackendPtr virCgroupBackendForController(virCgroupPtr group, unsigned int controller); =20 -# define VIR_CGROUP_BACKEND_CALL(group, controller, func, ret, ...) \ +#define VIR_CGROUP_BACKEND_CALL(group, controller, func, ret, ...) \ virCgroupBackendPtr backend =3D virCgroupBackendForController(group, c= ontroller); \ if (!backend) { \ virReportError(VIR_ERR_INTERNAL_ERROR, \ @@ -460,5 +459,3 @@ virCgroupBackendForController(virCgroupPtr group, return ret; \ } \ return backend->func(group, ##__VA_ARGS__); - -#endif /* LIBVIRT_VIRCGROUPBACKEND_H */ diff --git a/src/util/vircgroupv1.h b/src/util/vircgroupv1.h index b1f86b5492..dbef9c7864 100644 --- a/src/util/vircgroupv1.h +++ b/src/util/vircgroupv1.h @@ -18,10 +18,7 @@ * . */ =20 -#ifndef LIBVIRT_VIRCGROUPV1_H -# define LIBVIRT_VIRCGROUPV1_H +#pragma once =20 void virCgroupV1Register(void); - -#endif /* LIBVIRT_VIRCGROUPV1_H */ diff --git a/src/util/vircgroupv2.h b/src/util/vircgroupv2.h index a877d36a01..1566154597 100644 --- a/src/util/vircgroupv2.h +++ b/src/util/vircgroupv2.h @@ -18,10 +18,7 @@ * . */ =20 -#ifndef LIBVIRT_VIRCGROUPV2_H -# define LIBVIRT_VIRCGROUPV2_H +#pragma once =20 void virCgroupV2Register(void); - -#endif /* LIBVIRT_VIRCGROUPV2_H */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560874577; cv=none; d=zoho.com; s=zohoarc; b=R0zKXQ/CAkk3IL6klq6r5PiJT4M4RoXGNUkvoUDVBgmlJ2axJaBgiNvsdrXZ6ytI6FEfhNWZ9SFQHLwSx8lbkCCmo6ERzaMG1xq2wQdaT12AFpf1IRMDNJtaUth/WhxNmjREFfZQJ9ErY5CRizkJ+wgU9CM4dr/Az3lIT0mimm4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560874577; 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=Y3vhkcScgu/Dv3vZE8YpkB8hG0srh3hr4qrOyITcxUk=; b=I4j6s0CSKuENzCchwQJ+xkYpY7QKMNxHDoyOo94/HK41BN74JO1Kmw1BXIpq7FvgEdo3ZEIsXgOiRNAV7+DPT/r2ecMl8WZsrGC65vu42ikQyuMzwfGkRyyyuLvr66OMkm4PQBMSvxUxUhzL/YFTMM8+pXkNE2Rcf4RCf8qmR/A= 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 1560874577267730.0515626640703; Tue, 18 Jun 2019 09:16:17 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9A7CF307D871; Tue, 18 Jun 2019 16:16:15 +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 7538984EF; Tue, 18 Jun 2019 16:16:15 +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 367551806B23; Tue, 18 Jun 2019 16:16:14 +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 x5IGDWAG024282 for ; Tue, 18 Jun 2019 12:13:32 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8D93B60FAB; Tue, 18 Jun 2019 16:13:32 +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 573AB84EF for ; Tue, 18 Jun 2019 16:13:32 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:12:55 -0500 Message-Id: <20190618161316.1722-26-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 25/46] util: error: 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.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Tue, 18 Jun 2019 16:16:16 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/util/virerror.h | 41 +++++++++++++++++++---------------------- src/util/virerrorpriv.h | 5 +---- 2 files changed, 20 insertions(+), 26 deletions(-) diff --git a/src/util/virerror.h b/src/util/virerror.h index 8f51510dc2..4cfb0c18dd 100644 --- a/src/util/virerror.h +++ b/src/util/virerror.h @@ -19,13 +19,12 @@ * */ =20 -#ifndef LIBVIRT_VIRERROR_H -# define LIBVIRT_VIRERROR_H +#pragma once =20 -# include "internal.h" -# include "virautoclean.h" +#include "internal.h" +#include "virautoclean.h" =20 -# define VIR_ERROR_MAX_LENGTH 1024 +#define VIR_ERROR_MAX_LENGTH 1024 =20 extern virErrorFunc virErrorHandler; extern void *virUserData; @@ -65,13 +64,13 @@ void virReportSystemErrorFull(int domcode, const char *fmt, ...) ATTRIBUTE_FMT_PRINTF(6, 7); =20 -# define virReportSystemError(theerrno, fmt,...) \ +#define virReportSystemError(theerrno, fmt,...) \ virReportSystemErrorFull(VIR_FROM_THIS, \ (theerrno), \ __FILE__, __FUNCTION__, __LINE__, \ (fmt), __VA_ARGS__) =20 -# define virReportInvalidNullArg(argname) \ +#define virReportInvalidNullArg(argname) \ virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, \ VIR_FROM_THIS, \ VIR_ERR_INVALID_ARG, \ @@ -82,7 +81,7 @@ void virReportSystemErrorFull(int domcode, 0, 0, \ _("%s in %s must be NULL"), \ #argname, __FUNCTION__) -# define virReportInvalidNonNullArg(argname) \ +#define virReportInvalidNonNullArg(argname) \ virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, \ VIR_FROM_THIS, \ VIR_ERR_INVALID_ARG, \ @@ -93,7 +92,7 @@ void virReportSystemErrorFull(int domcode, 0, 0, \ _("%s in %s must not be NULL"), \ #argname, __FUNCTION__) -# define virReportInvalidEmptyStringArg(argname) \ +#define virReportInvalidEmptyStringArg(argname) \ virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, \ VIR_FROM_THIS, \ VIR_ERR_INVALID_ARG, \ @@ -104,7 +103,7 @@ void virReportSystemErrorFull(int domcode, 0, 0, \ _("string %s in %s must not be empty"), \ #argname, __FUNCTION__) -# define virReportInvalidPositiveArg(argname) \ +#define virReportInvalidPositiveArg(argname) \ virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, \ VIR_FROM_THIS, \ VIR_ERR_INVALID_ARG, \ @@ -115,7 +114,7 @@ void virReportSystemErrorFull(int domcode, 0, 0, \ _("%s in %s must be greater than zero"), \ #argname, __FUNCTION__) -# define virReportInvalidNonZeroArg(argname) \ +#define virReportInvalidNonZeroArg(argname) \ virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, \ VIR_FROM_THIS, \ VIR_ERR_INVALID_ARG, \ @@ -126,7 +125,7 @@ void virReportSystemErrorFull(int domcode, 0, 0, \ _("%s in %s must not be zero"), \ #argname, __FUNCTION__) -# define virReportInvalidZeroArg(argname) \ +#define virReportInvalidZeroArg(argname) \ virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, \ VIR_FROM_THIS, \ VIR_ERR_INVALID_ARG, \ @@ -137,7 +136,7 @@ void virReportSystemErrorFull(int domcode, 0, 0, \ _("%s in %s must be zero"), \ #argname, __FUNCTION__) -# define virReportInvalidNonNegativeArg(argname) \ +#define virReportInvalidNonNegativeArg(argname) \ virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, \ VIR_FROM_THIS, \ VIR_ERR_INVALID_ARG, \ @@ -148,7 +147,7 @@ void virReportSystemErrorFull(int domcode, 0, 0, \ _("%s in %s must be zero or greater"), \ #argname, __FUNCTION__) -# define virReportInvalidArg(argname, fmt, ...) \ +#define virReportInvalidArg(argname, fmt, ...) \ virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, \ VIR_FROM_THIS, \ VIR_ERR_INVALID_ARG, \ @@ -159,10 +158,10 @@ void virReportSystemErrorFull(int domcode, 0, 0, \ (fmt), __VA_ARGS__) =20 -# define virReportUnsupportedError() \ +#define virReportUnsupportedError() \ virReportErrorHelper(VIR_FROM_THIS, VIR_ERR_NO_SUPPORT, \ __FILE__, __FUNCTION__, __LINE__, __FUNCTION__) -# define virReportRestrictedError(...) \ +#define virReportRestrictedError(...) \ virReportErrorHelper(VIR_FROM_THIS, VIR_ERR_OPERATION_DENIED, \ __FILE__, __FUNCTION__, __LINE__, __VA_ARGS__) /* The sizeof(...) comparison here is a hack to catch typos @@ -170,7 +169,7 @@ void virReportSystemErrorFull(int domcode, * as detecting if you passed a typename that refers to a function * or struct type, instead of an enum. It should get optimized away * since sizeof() is known at compile time */ -# define virReportEnumRangeError(typname, value) \ +#define virReportEnumRangeError(typname, value) \ virReportErrorHelper(VIR_FROM_THIS, VIR_ERR_INTERNAL_ERROR, \ __FILE__, __FUNCTION__, __LINE__, \ "Unexpected enum value %d for %s", \ @@ -181,14 +180,14 @@ void virReportOOMErrorFull(int domcode, const char *funcname, size_t linenr); =20 -# define virReportOOMError() \ +#define virReportOOMError() \ virReportOOMErrorFull(VIR_FROM_THIS, __FILE__, __FUNCTION__, __LINE__) =20 -# define virReportError(code, ...) \ +#define virReportError(code, ...) \ virReportErrorHelper(VIR_FROM_THIS, code, __FILE__, \ __FUNCTION__, __LINE__, __VA_ARGS__) =20 -# define virReportErrorObject(obj) \ +#define virReportErrorObject(obj) \ virRaiseErrorObject(__FILE__, __FUNCTION__, __LINE__, obj) =20 int virSetError(virErrorPtr newerr); @@ -207,5 +206,3 @@ void virErrorPreserveLast(virErrorPtr *saveerr); void virErrorRestore(virErrorPtr *savederr); =20 VIR_DEFINE_AUTOPTR_FUNC(virError, virFreeError); - -#endif /* LIBVIRT_VIRERROR_H */ diff --git a/src/util/virerrorpriv.h b/src/util/virerrorpriv.h index 8e482f2e40..66acf0b4be 100644 --- a/src/util/virerrorpriv.h +++ b/src/util/virerrorpriv.h @@ -18,11 +18,8 @@ # error "virerrorpriv.h may only be included by virerror.c or its test sui= te" #endif /* LIBVIRT_VIRERRORPRIV_H_ALLOW */ =20 -#ifndef LIBVIRT_VIRERRORPRIV_H -# define LIBVIRT_VIRERRORPRIV_H +#pragma once =20 const char * virErrorMsg(virErrorNumber error, const char *info); - -#endif /* LIBVIRT_VIRERRORPRIV_H */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560874584; cv=none; d=zoho.com; s=zohoarc; b=dDrkq0z/7OPlDNXqs29iJBAmfJRayc+U4FCluUmstIYd8/bKXhVqqZES09+nUvEYyfW92kdJZDOJYxKOPRI3aYwQUwMhY5J/IMK618oIzehw6g96Bf44CsgTwiVKGOU+yjVsPGcwLLZnnMU2T1aSCyt4WU9w1l62P7lf3ZWoXsc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560874584; 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=zOJmtYcW1xXAuhkXoC5179aHvo3C1HtPboH8g3UZXnQ=; b=P8rv7NapXkuibNs7AmXInaZFbyKkg6hih+5yily7nYjZQc6LWWkLqNyebDD6XlmADXx2tJB1o+YUuSyQQ/uKCAv54+ZuyPVOrL03rBVCaP6CJ22LkNt+mHxCVK4xkFCMoyI9AIs6OtBVlXdKdIOLD2I28FadI/n5N/EijUAi/tw= 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 1560874584820671.7644836489818; Tue, 18 Jun 2019 09:16:24 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 36AA8307D983; Tue, 18 Jun 2019 16:16:23 +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 115935F9B0; Tue, 18 Jun 2019 16:16:23 +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 C48941806B23; Tue, 18 Jun 2019 16:16:21 +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 x5IGDWtb024289 for ; Tue, 18 Jun 2019 12:13:32 -0400 Received: by smtp.corp.redhat.com (Postfix) id DFA1C84EF; Tue, 18 Jun 2019 16:13:32 +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 AD28860FAB for ; Tue, 18 Jun 2019 16:13:32 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:12:56 -0500 Message-Id: <20190618161316.1722-27-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 26/46] util: virprobe.h: 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.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Tue, 18 Jun 2019 16:16:23 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/util/virprobe.h | 63 +++++++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 33 deletions(-) diff --git a/src/util/virprobe.h b/src/util/virprobe.h index 5635e58252..80a5f48ec8 100644 --- a/src/util/virprobe.h +++ b/src/util/virprobe.h @@ -19,17 +19,16 @@ * */ =20 -#ifndef LIBVIRT_VIRPROBE_H -# define LIBVIRT_VIRPROBE_H +#pragma once =20 -# include "internal.h" -# include "virlog.h" +#include "internal.h" +#include "virlog.h" =20 -# if WITH_DTRACE_PROBES -# ifndef LIBVIRT_PROBES_H -# define LIBVIRT_PROBES_H -# include "libvirt_probes.h" -# endif /* LIBVIRT_PROBES_H */ +#if WITH_DTRACE_PROBES +# ifndef LIBVIRT_PROBES_H +# define LIBVIRT_PROBES_H +# include "libvirt_probes.h" +# endif /* LIBVIRT_PROBES_H */ =20 /* Systemtap 1.2 headers have a bug where they cannot handle a * variable declared with array type. Work around this by casting all @@ -39,50 +38,50 @@ * hopefully, if we ever add a call to PROBE with other than 9 * end arguments, you can figure out the pattern to extend this hack. */ -# define VIR_COUNT_ARGS(...) VIR_ARG11(__VA_ARGS__, 10, 9, 8, 7, 6, 5, 4,= 3, 2, 1) -# define VIR_ARG11(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, ...) _11 -# define VIR_ADD_CAST_EXPAND(a, b, ...) VIR_ADD_CAST_PASTE(a, b, __VA_ARG= S__) -# define VIR_ADD_CAST_PASTE(a, b, ...) a##b(__VA_ARGS__) +# define VIR_COUNT_ARGS(...) VIR_ARG11(__VA_ARGS__, 10, 9, 8, 7, 6, 5, 4, = 3, 2, 1) +# define VIR_ARG11(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, ...) _11 +# define VIR_ADD_CAST_EXPAND(a, b, ...) VIR_ADD_CAST_PASTE(a, b, __VA_ARGS= __) +# define VIR_ADD_CAST_PASTE(a, b, ...) a##b(__VA_ARGS__) =20 /* The double cast is necessary to silence gcc warnings; any pointer * can safely go to intptr_t and back to void *, which collapses * arrays into pointers; while any integer can be widened to intptr_t * then cast to void *. */ -# define VIR_ADD_CAST(a) ((void *)(intptr_t)(a)) -# define VIR_ADD_CAST1(a) \ +# define VIR_ADD_CAST(a) ((void *)(intptr_t)(a)) +# define VIR_ADD_CAST1(a) \ VIR_ADD_CAST(a) -# define VIR_ADD_CAST2(a, b) \ +# define VIR_ADD_CAST2(a, b) \ VIR_ADD_CAST(a), VIR_ADD_CAST(b) -# define VIR_ADD_CAST3(a, b, c) \ +# define VIR_ADD_CAST3(a, b, c) \ VIR_ADD_CAST(a), VIR_ADD_CAST(b), VIR_ADD_CAST(c) -# define VIR_ADD_CAST4(a, b, c, d) \ +# define VIR_ADD_CAST4(a, b, c, d) \ VIR_ADD_CAST(a), VIR_ADD_CAST(b), VIR_ADD_CAST(c), \ VIR_ADD_CAST(d) -# define VIR_ADD_CAST5(a, b, c, d, e) \ +# define VIR_ADD_CAST5(a, b, c, d, e) \ VIR_ADD_CAST(a), VIR_ADD_CAST(b), VIR_ADD_CAST(c), \ VIR_ADD_CAST(d), VIR_ADD_CAST(e) -# define VIR_ADD_CAST6(a, b, c, d, e, f) \ +# define VIR_ADD_CAST6(a, b, c, d, e, f) \ VIR_ADD_CAST(a), VIR_ADD_CAST(b), VIR_ADD_CAST(c), \ VIR_ADD_CAST(d), VIR_ADD_CAST(e), VIR_ADD_CAST(f) -# define VIR_ADD_CAST7(a, b, c, d, e, f, g) \ +# define VIR_ADD_CAST7(a, b, c, d, e, f, g) \ VIR_ADD_CAST(a), VIR_ADD_CAST(b), VIR_ADD_CAST(c), \ VIR_ADD_CAST(d), VIR_ADD_CAST(e), VIR_ADD_CAST(f), \ VIR_ADD_CAST(g) -# define VIR_ADD_CAST8(a, b, c, d, e, f, g, h) \ +# define VIR_ADD_CAST8(a, b, c, d, e, f, g, h) \ VIR_ADD_CAST(a), VIR_ADD_CAST(b), VIR_ADD_CAST(c), \ VIR_ADD_CAST(d), VIR_ADD_CAST(e), VIR_ADD_CAST(f), \ VIR_ADD_CAST(g), VIR_ADD_CAST(h) -# define VIR_ADD_CAST9(a, b, c, d, e, f, g, h, i) \ +# define VIR_ADD_CAST9(a, b, c, d, e, f, g, h, i) \ VIR_ADD_CAST(a), VIR_ADD_CAST(b), VIR_ADD_CAST(c), \ VIR_ADD_CAST(d), VIR_ADD_CAST(e), VIR_ADD_CAST(f), \ VIR_ADD_CAST(g), VIR_ADD_CAST(h), VIR_ADD_CAST(i) =20 -# define VIR_ADD_CASTS(...) \ +# define VIR_ADD_CASTS(...) \ VIR_ADD_CAST_EXPAND(VIR_ADD_CAST, VIR_COUNT_ARGS(__VA_ARGS__), \ __VA_ARGS__) =20 -# define PROBE_EXPAND(NAME, ARGS) NAME(ARGS) -# define PROBE(NAME, FMT, ...) \ +# define PROBE_EXPAND(NAME, ARGS) NAME(ARGS) +# define PROBE(NAME, FMT, ...) \ VIR_INFO_INT(&virLogSelf, \ __FILE__, __LINE__, __func__, \ #NAME ": " FMT, __VA_ARGS__); \ @@ -91,18 +90,16 @@ VIR_ADD_CASTS(__VA_ARGS__)); \ } =20 -# define PROBE_QUIET(NAME, FMT, ...) \ +# define PROBE_QUIET(NAME, FMT, ...) \ if (LIBVIRT_ ## NAME ## _ENABLED()) { \ PROBE_EXPAND(LIBVIRT_ ## NAME, \ VIR_ADD_CASTS(__VA_ARGS__)); \ } -# else -# define PROBE(NAME, FMT, ...) \ +#else +# define PROBE(NAME, FMT, ...) \ VIR_INFO_INT(&virLogSelf, \ __FILE__, __LINE__, __func__, \ #NAME ": " FMT, __VA_ARGS__); =20 -# define PROBE_QUIET(NAME, FMT, ...) -# endif - -#endif /* LIBVIRT_VIRPROBE_H */ +# define PROBE_QUIET(NAME, FMT, ...) +#endif --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560874559; cv=none; d=zoho.com; s=zohoarc; b=mWE7j//HzlJiq9s07fTvRPQ2pxZB2lRyD3JDtbYCSWJ55TbzfAEj/Pjj+0klQ8mcchJLkoAAEcZM/JCKyLfOur/4g4bjONQEftf5FQvxSzVqrgmHooOwhOl94bgk/gQIEmiDB5xTl+asWYLwNJCuzc4guK9GXPHS9zaaSRQ0CpU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560874559; 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=MgpZtLzBvo4Vjk+RtpOhpVK1J2WIQzn7wCwD3zAq/UY=; b=bIXLgmGgoTNR0fbbw1Udjx0W5TKBdhHHHm4xREYkc2aj+7vxTwsZPsJCp8ZUtamkMZPd3T4pX1v4ZWWjmgKe99ZAHj1/L0EAGIey5GWaJJpMoDB2aAtkNPW03EXeG5ohpeGElFdI8tMB+5Q00+aLPY6qzkGfnRpR9sOpwJSOUto= 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 1560874559491845.7718151110389; Tue, 18 Jun 2019 09:15:59 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 675003162905; Tue, 18 Jun 2019 16:15: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 4194F5C22F; Tue, 18 Jun 2019 16:15: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 F3AF81806B1A; Tue, 18 Jun 2019 16:15:53 +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 x5IGDXIB024299 for ; Tue, 18 Jun 2019 12:13:33 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3E72A60FAB; Tue, 18 Jun 2019 16:13:33 +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 09D8884EF for ; Tue, 18 Jun 2019 16:13:32 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:12:57 -0500 Message-Id: <20190618161316.1722-28-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 27/46] util: dbus: 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.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Tue, 18 Jun 2019 16:15:58 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/util/virdbus.h | 22 ++++++++++------------ src/util/virdbuspriv.h | 11 ++++------- 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/src/util/virdbus.h b/src/util/virdbus.h index c1e5de31ab..083c074d59 100644 --- a/src/util/virdbus.h +++ b/src/util/virdbus.h @@ -19,19 +19,18 @@ * */ =20 -#ifndef LIBVIRT_VIRDBUS_H -# define LIBVIRT_VIRDBUS_H +#pragma once =20 -# ifdef WITH_DBUS -# undef interface /* Work around namespace pollution in mingw's rpc.h */ -# include -# else -# define DBusConnection void -# define DBusMessage void -# endif -# include "internal.h" +#ifdef WITH_DBUS +# undef interface /* Work around namespace pollution in mingw's rpc.h */ +# include +#else +# define DBusConnection void +# define DBusMessage void +#endif +#include "internal.h" =20 -# include +#include =20 void virDBusSetSharedBus(bool shared); =20 @@ -75,4 +74,3 @@ int virDBusIsServiceEnabled(const char *name); int virDBusIsServiceRegistered(const char *name); =20 bool virDBusErrorIsUnknownMethod(virErrorPtr err); -#endif /* LIBVIRT_VIRDBUS_H */ diff --git a/src/util/virdbuspriv.h b/src/util/virdbuspriv.h index 5c0c7f8b6e..f96f393ff5 100644 --- a/src/util/virdbuspriv.h +++ b/src/util/virdbuspriv.h @@ -23,12 +23,11 @@ # error "virdbuspriv.h may only be included by virdbus.c or test suites" #endif /* LIBVIRT_VIRDBUSPRIV_H_ALLOW */ =20 -#ifndef LIBVIRT_VIRDBUSPRIV_H -# define LIBVIRT_VIRDBUSPRIV_H +#pragma once =20 -# include "virdbus.h" +#include "virdbus.h" =20 -# if defined(WITH_DBUS) && !HAVE_DBUSBASICVALUE +#if defined(WITH_DBUS) && !HAVE_DBUSBASICVALUE /* Copied (and simplified) from dbus 1.6.12, for use with older dbus heade= rs */ typedef union { @@ -42,7 +41,7 @@ typedef union double dbl; /**< as double */ unsigned char byt; /**< as byte */ } DBusBasicValue; -# endif +#endif =20 int virDBusMessageEncodeArgs(DBusMessage* msg, const char *types, @@ -55,5 +54,3 @@ int virDBusMessageDecodeArgs(DBusMessage* msg, int virDBusMessageEncode(DBusMessage* msg, const char *types, ...); - -#endif /* LIBVIRT_VIRDBUSPRIV_H */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560874564; cv=none; d=zoho.com; s=zohoarc; b=fFFbwXuh8iSneSeNnn2Wbu1w4k0f8YpWBzE8AwTZTBmsvvEvTecGlCxl8YLM5EQBiIaTElNvHQh/gRXW7JUd+640uNKHoAbrkFLNJKPdkZ26IttX9jfx+9mk02EObHydx9vRdrJsFXiccF3fTtJqLPRE9zuRwtIoyIVR/eL5e5Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560874564; 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=iDJ6ZxvgTige9F3hRpIGccUwxQ4Kg8r7IRBVcuAQqQg=; b=DoxLgpa1EAlyh7bVoB1g4Pikvs7l0BF4nbnydG3XklYpOyo9NycKE0lSd2jssbsCX9opP4JyvyUbTqPxe+BhZdEWwkOKN0eTktQJ7cUwB0wC+JxtUTaOOqe65Bi74+AGXL9H/hnp2kheORpylJrbSrb2cgz8ytyjIkWLXaESHFc= 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 1560874564835397.6861658937577; Tue, 18 Jun 2019 09:16:04 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2A40BC1EB1FF; Tue, 18 Jun 2019 16:16:03 +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 EA06E7DE32; Tue, 18 Jun 2019 16:16:01 +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 A59A3206D9; Tue, 18 Jun 2019 16:16:01 +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 x5IGDX4O024304 for ; Tue, 18 Jun 2019 12:13:33 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8E46984EF; Tue, 18 Jun 2019 16:13:33 +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 5CE1060FAB for ; Tue, 18 Jun 2019 16:13:33 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:12:58 -0500 Message-Id: <20190618161316.1722-29-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 28/46] util: command: 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.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 18 Jun 2019 16:16:03 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/util/vircommand.h | 11 ++++------- src/util/vircommandpriv.h | 7 ++----- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/util/vircommand.h b/src/util/vircommand.h index c03da43f25..c9a8d3c41c 100644 --- a/src/util/vircommand.h +++ b/src/util/vircommand.h @@ -19,12 +19,11 @@ * */ =20 -#ifndef LIBVIRT_VIRCOMMAND_H -# define LIBVIRT_VIRCOMMAND_H +#pragma once =20 -# include "internal.h" -# include "virbuffer.h" -# include "virautoclean.h" +#include "internal.h" +#include "virbuffer.h" +#include "virautoclean.h" =20 typedef struct _virCommand virCommand; typedef virCommand *virCommandPtr; @@ -222,5 +221,3 @@ int virCommandRunNul(virCommandPtr cmd, void *data); =20 VIR_DEFINE_AUTOPTR_FUNC(virCommand, virCommandFree); - -#endif /* LIBVIRT_VIRCOMMAND_H */ diff --git a/src/util/vircommandpriv.h b/src/util/vircommandpriv.h index e2f4c19596..80f1d1376c 100644 --- a/src/util/vircommandpriv.h +++ b/src/util/vircommandpriv.h @@ -23,10 +23,9 @@ # error "vircommandpriv.h may only be included by vircommand.c or test sui= tes" #endif /* LIBVIRT_VIRCOMMANDPRIV_H_ALLOW */ =20 -#ifndef LIBVIRT_VIRCOMMANDPRIV_H -# define LIBVIRT_VIRCOMMANDPRIV_H +#pragma once =20 -# include "vircommand.h" +#include "vircommand.h" =20 typedef void (*virCommandDryRunCallback)(const char *const*args, const char *const*env, @@ -39,5 +38,3 @@ typedef void (*virCommandDryRunCallback)(const char *cons= t*args, void virCommandSetDryRun(virBufferPtr buf, virCommandDryRunCallback cb, void *opaque); - -#endif /* LIBVIRT_VIRCOMMANDPRIV_H */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560876125; cv=none; d=zoho.com; s=zohoarc; b=bSsedghJW9PdJPtViuHhZaJnBYlJXnLFw3a8o2lDccahL4+NO+897CHdWLUD00UYZ6VtxQrNnMJioRcLJMmkCpBF8g5lGwx9y5elorkLQI5F9WS6LXrLDl5jvk03VeR3DimsbeDRJMEh7A9Z/8KTYLMOB/IfqGa2jwNElvVlPrw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560876125; 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=wZwdCL0iiLLVglV8swvzLE+UhAZpfWMEfiXBJU3YwcQ=; b=C4NCa/iCcSfYjNAL2BuDX1RxJI0bXjMZ1RM3gQL06jveHt7Mx8JogEZketNXJ6VbRE2XmZsk+f1fhkXQFKZvpldQb9fp6jEnjW8xx2Ue4bZ7vqPeTIkd4D9QBDRttdrAoJvpdi65+UwJ9TE5CzwAJ7kOripo4r3T/nmwv35zIDk= 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 1560876125478196.6760360347929; Tue, 18 Jun 2019 09:42:05 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D42C930872E1; Tue, 18 Jun 2019 16:42:02 +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 A7DE21001E61; Tue, 18 Jun 2019 16:42:01 +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 6C1F51806B19; Tue, 18 Jun 2019 16:42:00 +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 x5IGDXYu024314 for ; Tue, 18 Jun 2019 12:13:33 -0400 Received: by smtp.corp.redhat.com (Postfix) id DDFE960FAB; Tue, 18 Jun 2019 16:13:33 +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 AD2B184EF for ; Tue, 18 Jun 2019 16:13:33 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:12:59 -0500 Message-Id: <20190618161316.1722-30-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 29/46] util: hash: 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.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Tue, 18 Jun 2019 16:42:03 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/util/virhash.h | 8 ++------ src/util/virhashcode.h | 7 ++----- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/util/virhash.h b/src/util/virhash.h index d2156a5ce0..ed3774e693 100644 --- a/src/util/virhash.h +++ b/src/util/virhash.h @@ -7,11 +7,9 @@ * Copyright (C) 2000 Bjorn Reese and Daniel Veillard. */ =20 -#ifndef LIBVIRT_VIRHASH_H -# define LIBVIRT_VIRHASH_H +#pragma once =20 - -# include "virautoclean.h" +#include "virautoclean.h" =20 /* * The hash table. @@ -198,5 +196,3 @@ void *virHashSearch(const virHashTable *table, virHashS= earcher iter, void virHashValueFree(void *value, const void *name); =20 VIR_DEFINE_AUTOPTR_FUNC(virHashTable, virHashFree); - -#endif /* LIBVIRT_VIRHASH_H */ diff --git a/src/util/virhashcode.h b/src/util/virhashcode.h index e512e04bac..af877c93cc 100644 --- a/src/util/virhashcode.h +++ b/src/util/virhashcode.h @@ -25,12 +25,9 @@ * clients can be both 64 or 32 bit at the same time. */ =20 -#ifndef LIBVIRT_VIRHASHCODE_H -# define LIBVIRT_VIRHASHCODE_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 uint32_t virHashCodeGen(const void *key, size_t len, uint32_t seed) ATTRIBUTE_NOINLINE; - -#endif /* LIBVIRT_VIRHASHCODE_H */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560874579; cv=none; d=zoho.com; s=zohoarc; b=ix06cy31WjIRRT4BijtzuPNgnIsXBdaPCEjjVqSSXAvF1r4oVQfRCkDOF29KoizVICRCQNwEi251emBu8BFmYn43uQGdQgh62RHRNMyd/p9FeeoESl+hs0Io+txklFn12MZFRV9SUtMK6F5I+e4B/hWgaQLTS1wln6k8qWHbZSE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560874579; 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=PRfmPvEuyExM79QQuFfpDZj+YKSIvMe40+Aa9y1J5ls=; b=bpT/wJkWKbynyaq3/9xJ6BivMebfhvEeZqV51QjmZ+j6ODHQ3wDLFCRcuuWNJObfuKvc3x0UDbh5huFzxcuLmxvso0AZUhghPxPfi2VQcgkTZRSJ9q6tsMb6T516DuedSa6PoeTEx00+k7x5dTDaRBzakrujnujNenaPTC+OoNI= 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 1560874579551168.22782878096416; Tue, 18 Jun 2019 09:16:19 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7E358B2DF5; Tue, 18 Jun 2019 16:16:08 +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 E7E049F52; Tue, 18 Jun 2019 16:16:07 +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 A47161806B23; Tue, 18 Jun 2019 16:16:07 +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 x5IGDYmm024324 for ; Tue, 18 Jun 2019 12:13:34 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3B30C84EF; Tue, 18 Jun 2019 16:13:34 +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 0918F60FAB for ; Tue, 18 Jun 2019 16:13:33 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:13:00 -0500 Message-Id: <20190618161316.1722-31-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 30/46] util: mac: 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.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 18 Jun 2019 16:16:14 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/util/virmacaddr.h | 17 +++++++---------- src/util/virmacmap.h | 5 +---- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/util/virmacaddr.h b/src/util/virmacaddr.h index 55f9d61abe..55cfd12164 100644 --- a/src/util/virmacaddr.h +++ b/src/util/virmacaddr.h @@ -18,16 +18,15 @@ * . */ =20 -#ifndef LIBVIRT_VIRMACADDR_H -# define LIBVIRT_VIRMACADDR_H +#pragma once =20 -# include "internal.h" -# include "virautoclean.h" +#include "internal.h" +#include "virautoclean.h" =20 -# define VIR_MAC_BUFLEN 6 -# define VIR_MAC_HEXLEN (VIR_MAC_BUFLEN * 2) -# define VIR_MAC_PREFIX_BUFLEN 3 -# define VIR_MAC_STRING_BUFLEN (VIR_MAC_BUFLEN * 3) +#define VIR_MAC_BUFLEN 6 +#define VIR_MAC_HEXLEN (VIR_MAC_BUFLEN * 2) +#define VIR_MAC_PREFIX_BUFLEN 3 +#define VIR_MAC_STRING_BUFLEN (VIR_MAC_BUFLEN * 3) =20 typedef struct _virMacAddr virMacAddr; typedef virMacAddr *virMacAddrPtr; @@ -65,5 +64,3 @@ bool virMacAddrIsBroadcastRaw(const unsigned char s[VIR_M= AC_BUFLEN]); void virMacAddrFree(virMacAddrPtr addr); =20 VIR_DEFINE_AUTOPTR_FUNC(virMacAddr, virMacAddrFree); - -#endif /* LIBVIRT_VIRMACADDR_H */ diff --git a/src/util/virmacmap.h b/src/util/virmacmap.h index 68843b947a..4652295033 100644 --- a/src/util/virmacmap.h +++ b/src/util/virmacmap.h @@ -18,8 +18,7 @@ * . */ =20 -#ifndef LIBVIRT_VIRMACMAP_H -# define LIBVIRT_VIRMACMAP_H +#pragma once =20 typedef struct virMacMap virMacMap; typedef virMacMap *virMacMapPtr; @@ -46,5 +45,3 @@ int virMacMapWriteFile(virMacMapPtr mgr, =20 int virMacMapDumpStr(virMacMapPtr mgr, char **str); - -#endif /* LIBVIRT_VIRMACMAP_H */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560876130; cv=none; d=zoho.com; s=zohoarc; b=ENl5D8IL7ZUCEt8N8JO/ZL0TxAJq++RIPB98qw2D9Lik+AOicQ/9SlrePLTRI2jrkpFp/EUwakQUTeiPnTmLJVw0GhgJxDzghhabnVLqkq2V+eivZDzMXMqwbFyh8A86JzG8bpneUWXEKnN03zOO/WBlu1MVvR8SADMffNADAMs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560876130; 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=7KwrQgB4WayvSePsI3W7kTNmMQp9WQSUl4Tk0W9VM+A=; b=bWWCE1WGAxvqgs4FPsZkLxPlzz/8KS6a3lqMuXOFwkZxxn7KqxKWKEAQpExJ2Zdit9yu+KJvycm8pdb7X8iRLSTWNBVWLxdLXvoCsJD7/fq9CgIv5Tuxo6QoM/nSxBGx4yEy1B7x65KWp6qOeEXt/W3vuFQgi0qcCPThFiP/Hfg= 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 1560876130141855.0728899506856; Tue, 18 Jun 2019 09:42:10 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8636C31628E8; Tue, 18 Jun 2019 16:42:08 +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 5D65560156; Tue, 18 Jun 2019 16:42:07 +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 1C4C7206D8; Tue, 18 Jun 2019 16:42:06 +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 x5IGDYF6024329 for ; Tue, 18 Jun 2019 12:13:34 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8DEA160FAB; Tue, 18 Jun 2019 16:13:34 +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 59B9084EF for ; Tue, 18 Jun 2019 16:13:34 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:13:01 -0500 Message-Id: <20190618161316.1722-32-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 31/46] util: object: 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.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Tue, 18 Jun 2019 16:42:09 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/util/virobject.h | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/util/virobject.h b/src/util/virobject.h index d13fc4b1ac..fe5dbe7326 100644 --- a/src/util/virobject.h +++ b/src/util/virobject.h @@ -19,11 +19,10 @@ * */ =20 -#ifndef LIBVIRT_VIROBJECT_H -# define LIBVIRT_VIROBJECT_H +#pragma once =20 -# include "internal.h" -# include "virthread.h" +#include "internal.h" +#include "virthread.h" =20 typedef struct _virClass virClass; typedef virClass *virClassPtr; @@ -71,16 +70,16 @@ virClassPtr virClassForObject(void); virClassPtr virClassForObjectLockable(void); virClassPtr virClassForObjectRWLockable(void); =20 -# ifndef VIR_PARENT_REQUIRED -# define VIR_PARENT_REQUIRED ATTRIBUTE_NONNULL(1) -# endif +#ifndef VIR_PARENT_REQUIRED +# define VIR_PARENT_REQUIRED ATTRIBUTE_NONNULL(1) +#endif =20 /* Assign the class description nameClass to represent struct @name * (which must have an object-based 'parent' member at offset 0), and * with parent class @prnt. nameDispose must exist as either a * function or as a macro defined to NULL. */ -# define VIR_CLASS_NEW(name, prnt) \ +#define VIR_CLASS_NEW(name, prnt) \ verify_expr(offsetof(name, parent) =3D=3D 0, \ (name##Class =3D virClassNew(prnt, #name, sizeof(name), \ sizeof(((name *)NULL)->parent), \ @@ -120,7 +119,7 @@ virObjectAutoUnref(void *objptr); * Declares a variable of @type which will be automatically unref'd when * control goes out of the scope. */ -# define VIR_AUTOUNREF(type) \ +#define VIR_AUTOUNREF(type) \ __attribute__((cleanup(virObjectAutoUnref))) type =20 void * @@ -172,5 +171,3 @@ virObjectListFree(void *list); void virObjectListFreeCount(void *list, size_t count); - -#endif /* LIBVIRT_VIROBJECT_H */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560874590; cv=none; d=zoho.com; s=zohoarc; b=WisMAUsCnhGuxdYl+/afikb5dAjPjfW39VpGKxxFgOWz6MKvKBseQFzI92NqgNzQLH4caAKr7cRczRF5VEleTGBOaNjMlBW7V57LxseC2h8WnhKVRRqgSCbHGYKidYweReaGYlfc5LlNXsdSp5KJpohqeDTqgcv07zg9sdH4ol8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560874590; 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=z/UqaYF76KsQsctDkT3qmNrPLGPV4Tn57IuMJI3MnHA=; b=UD5iCvHaTiCkdUXbU5d86uidgWXIlqBGUfO1BPhr11Dh/PQM4QAyrS9lQaA5dG+aJ4IcC5+Hxr36TC1qOmPvGXdoOqHtzaphIFdosDyCoU8xfpg79haoUWMiHh/Ps6/ivIyiXtBs70Tce9cBpxj4xBfY1TOI2SDBMuc/u4u4cA0= 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 1560874590304268.25853978537907; Tue, 18 Jun 2019 09:16:30 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id AA75164123; Tue, 18 Jun 2019 16:16:28 +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 7F7BF60634; Tue, 18 Jun 2019 16:16:28 +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 3CA251806B23; Tue, 18 Jun 2019 16:16:28 +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 x5IGDY5F024339 for ; Tue, 18 Jun 2019 12:13:34 -0400 Received: by smtp.corp.redhat.com (Postfix) id E0D3B60FAB; Tue, 18 Jun 2019 16:13:34 +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 ACEB984F4 for ; Tue, 18 Jun 2019 16:13:34 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:13:02 -0500 Message-Id: <20190618161316.1722-33-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 32/46] util: string: 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.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 18 Jun 2019 16:16:29 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/util/virstring.h | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/src/util/virstring.h b/src/util/virstring.h index b2cd8ea53c..5e64ad1bb9 100644 --- a/src/util/virstring.h +++ b/src/util/virstring.h @@ -16,12 +16,11 @@ * . */ =20 -#ifndef LIBVIRT_VIRSTRING_H -# define LIBVIRT_VIRSTRING_H +#pragma once =20 -# include +#include =20 -# include "internal.h" +#include "internal.h" =20 char **virStringSplitCount(const char *string, const char *delim, @@ -126,7 +125,7 @@ int virStrncpy(char *dest, const char *src, size_t n, s= ize_t destbytes) ATTRIBUTE_RETURN_CHECK; int virStrcpy(char *dest, const char *src, size_t destbytes) ATTRIBUTE_RETURN_CHECK; -# define virStrcpyStatic(dest, src) virStrcpy((dest), (src), sizeof(dest)) +#define virStrcpyStatic(dest, src) virStrcpy((dest), (src), sizeof(dest)) =20 /* Don't call these directly - use the macros below */ int virStrdup(char **dest, const char *src, bool report, int domcode, @@ -159,8 +158,8 @@ int virVasprintfInternal(bool report, int domcode, cons= t char *filename, * Returns -1 on failure (with OOM error reported), 0 if @src was NULL, * 1 if @src was copied */ -# define VIR_STRDUP(dst, src) virStrdup(&(dst), src, true, VIR_FROM_THIS, \ - __FILE__, __FUNCTION__, __LINE__) +#define VIR_STRDUP(dst, src) virStrdup(&(dst), src, true, VIR_FROM_THIS, \ + __FILE__, __FUNCTION__, __LINE__) =20 /** * VIR_STRDUP_QUIET: @@ -173,7 +172,7 @@ int virVasprintfInternal(bool report, int domcode, cons= t char *filename, * * Returns -1 on failure, 0 if @src was NULL, 1 if @src was copied */ -# define VIR_STRDUP_QUIET(dst, src) virStrdup(&(dst), src, false, 0, NULL,= NULL, 0) +#define VIR_STRDUP_QUIET(dst, src) virStrdup(&(dst), src, false, 0, NULL, = NULL, 0) =20 /** * VIR_STRNDUP: @@ -191,9 +190,9 @@ int virVasprintfInternal(bool report, int domcode, cons= t char *filename, * Returns -1 on failure (with OOM error reported), 0 if @src was NULL, * 1 if @src was copied */ -# define VIR_STRNDUP(dst, src, n) virStrndup(&(dst), src, n, true, \ - VIR_FROM_THIS, __FILE__, \ - __FUNCTION__, __LINE__) +#define VIR_STRNDUP(dst, src, n) virStrndup(&(dst), src, n, true, \ + VIR_FROM_THIS, __FILE__, \ + __FUNCTION__, __LINE__) =20 /** * VIR_STRNDUP_QUIET: @@ -211,8 +210,8 @@ int virVasprintfInternal(bool report, int domcode, cons= t char *filename, * * Returns -1 on failure, 0 if @src was NULL, 1 if @src was copied */ -# define VIR_STRNDUP_QUIET(dst, src, n) virStrndup(&(dst), src, n, false, \ - 0, NULL, NULL, 0) +#define VIR_STRNDUP_QUIET(dst, src, n) virStrndup(&(dst), src, n, false, \ + 0, NULL, NULL, 0) =20 size_t virStringListLength(const char * const *strings); =20 @@ -225,7 +224,7 @@ size_t virStringListLength(const char * const *strings); * Returns -1 on failure (with OOM error reported), number of bytes printed * on success. */ -# define virVasprintf(strp, fmt, list) \ +#define virVasprintf(strp, fmt, list) \ virVasprintfInternal(true, VIR_FROM_THIS, __FILE__, __FUNCTION__, \ __LINE__, strp, fmt, list) =20 @@ -236,7 +235,7 @@ size_t virStringListLength(const char * const *strings); * * Returns -1 on failure, number of bytes printed on success. */ -# define virVasprintfQuiet(strp, fmt, list) \ +#define virVasprintfQuiet(strp, fmt, list) \ virVasprintfInternal(false, 0, NULL, NULL, 0, strp, fmt, list) =20 /** @@ -251,7 +250,7 @@ size_t virStringListLength(const char * const *strings); * on success. */ =20 -# define virAsprintf(strp, ...) \ +#define virAsprintf(strp, ...) \ virAsprintfInternal(true, VIR_FROM_THIS, __FILE__, __FUNCTION__, __LIN= E__, \ strp, __VA_ARGS__) =20 @@ -265,7 +264,7 @@ size_t virStringListLength(const char * const *strings); * Returns -1 on failure, number of bytes printed on success. */ =20 -# define virAsprintfQuiet(strp, ...) \ +#define virAsprintfQuiet(strp, ...) \ virAsprintfInternal(false, 0, NULL, NULL, 0, \ strp, __VA_ARGS__) =20 @@ -324,7 +323,5 @@ int virStringParseYesNo(const char *str, * Declares a NULL-terminated list of strings which will be automatically = freed * when the pointer goes out of scope. */ -# define VIR_AUTOSTRINGLIST \ +#define VIR_AUTOSTRINGLIST \ __attribute__((cleanup(virStringListAutoFree))) char ** - -#endif /* LIBVIRT_VIRSTRING_H */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560874597; cv=none; d=zoho.com; s=zohoarc; b=oo/o7yQ6Th2ZbMsF+NRKUyAZ7CvXWlxNL1Qu8mSU6spnsogHDE6BbkBTrahP2fyluAVBmDIjAVq630EKvL7iaWl6VXr1OTYw85vkNNDUFyF0u2pdYoexjB+BRts3QYGumXYpj/Vr+DDBcKwDkD1hLJQnwqMNmY4awXBjM+Sm1cs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560874597; 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=d5pDClQiDC1aIy2E49tTQNTSNxmS/FYToXJcXURYIP4=; b=oAxiC9AhZ2Khb4WiHZWtr88SysLKKCupcIf0/2cQWC0+lY0vK7ZuhI5RHc79tbRoRy/528FXsbfqUvO2KXRbBVwm9zT/ns0fPJNKxuAGfqGTCtjCdp9eyVUU7UaSMIxpeR5/7QvkcVVR2g+tSSSSXdD9FYIUmtx+EITVTxbfLbI= 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 1560874597849167.8310681558553; Tue, 18 Jun 2019 09:16:37 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3B2A930C319C; Tue, 18 Jun 2019 16:16:36 +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 1202B7DDF9; Tue, 18 Jun 2019 16:16:36 +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 C368C206D7; Tue, 18 Jun 2019 16:16:34 +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 x5IGDZ4C024347 for ; Tue, 18 Jun 2019 12:13:35 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3CEBD84EF; Tue, 18 Jun 2019 16:13:35 +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 0B9BB60FAB for ; Tue, 18 Jun 2019 16:13:34 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:13:03 -0500 Message-Id: <20190618161316.1722-34-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 33/46] util: socketaddr: 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.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Tue, 18 Jun 2019 16:16:36 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/util/virsocketaddr.h | 45 +++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/src/util/virsocketaddr.h b/src/util/virsocketaddr.h index 5230cddf64..b2ecb3c748 100644 --- a/src/util/virsocketaddr.h +++ b/src/util/virsocketaddr.h @@ -16,17 +16,16 @@ * . */ =20 -#ifndef LIBVIRT_VIRSOCKETADDR_H -# define LIBVIRT_VIRSOCKETADDR_H +#pragma once =20 -# include -# include -# ifdef HAVE_SYS_UN_H -# include -# endif +#include +#include +#ifdef HAVE_SYS_UN_H +# include +#endif =20 -# include "internal.h" -# include "virautoclean.h" +#include "internal.h" +#include "virautoclean.h" =20 /* On architectures which lack these limits, define them (ie. Cygwin). * Note that the libvirt code should be robust enough to handle the @@ -34,11 +33,11 @@ * length correctly in second argument to gethostname and by always * using strncpy instead of strcpy). */ -# ifndef INET_ADDRSTRLEN -# define INET_ADDRSTRLEN 16 -# endif +#ifndef INET_ADDRSTRLEN +# define INET_ADDRSTRLEN 16 +#endif =20 -# define VIR_LOOPBACK_IPV4_ADDR "127.0.0.1" +#define VIR_LOOPBACK_IPV4_ADDR "127.0.0.1" =20 typedef struct { union { @@ -46,27 +45,27 @@ typedef struct { struct sockaddr_storage stor; struct sockaddr_in inet4; struct sockaddr_in6 inet6; -# ifdef HAVE_SYS_UN_H +#ifdef HAVE_SYS_UN_H struct sockaddr_un un; -# endif +#endif } data; socklen_t len; } virSocketAddr; =20 -# define VIR_SOCKET_ADDR_VALID(s) \ +#define VIR_SOCKET_ADDR_VALID(s) \ ((s)->data.sa.sa_family !=3D AF_UNSPEC) =20 -# define VIR_SOCKET_ADDR_IS_FAMILY(s, f) \ +#define VIR_SOCKET_ADDR_IS_FAMILY(s, f) \ ((s)->data.sa.sa_family =3D=3D f) =20 -# define VIR_SOCKET_ADDR_FAMILY(s) \ +#define VIR_SOCKET_ADDR_FAMILY(s) \ ((s)->data.sa.sa_family) =20 -# define VIR_SOCKET_ADDR_IPV4_ALL "0.0.0.0" -# define VIR_SOCKET_ADDR_IPV6_ALL "::" +#define VIR_SOCKET_ADDR_IPV4_ALL "0.0.0.0" +#define VIR_SOCKET_ADDR_IPV6_ALL "::" =20 -# define VIR_SOCKET_ADDR_IPV4_ARPA "in-addr.arpa" -# define VIR_SOCKET_ADDR_IPV6_ARPA "ip6.arpa" +#define VIR_SOCKET_ADDR_IPV4_ARPA "in-addr.arpa" +#define VIR_SOCKET_ADDR_IPV6_ARPA "ip6.arpa" =20 typedef virSocketAddr *virSocketAddrPtr; =20 @@ -161,5 +160,3 @@ int virSocketAddrPTRDomain(const virSocketAddr *addr, void virSocketAddrFree(virSocketAddrPtr addr); =20 VIR_DEFINE_AUTOPTR_FUNC(virSocketAddr, virSocketAddrFree); - -#endif /* LIBVIRT_VIRSOCKETADDR_H */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560876139; cv=none; d=zoho.com; s=zohoarc; b=fi7GvDNjBEOAUrn0hH80JichorYuwYX/guj7trct7JH6uQtdeaMHSkMQhm0CRt+ElVz/arZ8jTMbmb/koTOa1Vkz3QvL61LPb8gDy0quxXNbBxo9PCVP+XGMxq8ix+ZvTlQMp5ckfAFWNUl+geiu1l6NT0V2mfasDyw3QfbZVWA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560876139; 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=E48uHyqFGk4txvehWYDz0o3fxlGOdeOj2rNisgElOQw=; b=hqsxtolVkpT48oc5EZOn6RBgzoORch0cuGcgYU+nXVIdv5y4+ksxQLCwVp3dY8AbWrq7N0WUz+z3FJ1S70qdMSUu79rFiJL0QFOq6hfjhs/xZPm3/AYpAmbdJKB9jx5zWseXjIIkotCzW+o/IC8c/sbLl0a4KKMTWamHslgPQf0= 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 1560876139901826.693423610574; Tue, 18 Jun 2019 09:42:19 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 26920772F9; Tue, 18 Jun 2019 16:42:13 +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 EE6DE84F4; Tue, 18 Jun 2019 16:42:11 +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 AC49A1806B19; Tue, 18 Jun 2019 16:42:10 +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 x5IGDZXv024354 for ; Tue, 18 Jun 2019 12:13:35 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8D14F60FAB; Tue, 18 Jun 2019 16:13:35 +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 5BACA84EF for ; Tue, 18 Jun 2019 16:13:35 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:13:04 -0500 Message-Id: <20190618161316.1722-35-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 34/46] util: sysinfo: 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.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 18 Jun 2019 16:42:18 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/util/virsysinfo.h | 13 +++++-------- src/util/virsysinfopriv.h | 5 +---- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/util/virsysinfo.h b/src/util/virsysinfo.h index c0015834bc..f30809294b 100644 --- a/src/util/virsysinfo.h +++ b/src/util/virsysinfo.h @@ -19,13 +19,12 @@ * . */ =20 -#ifndef LIBVIRT_VIRSYSINFO_H -# define LIBVIRT_VIRSYSINFO_H +#pragma once =20 -# include "internal.h" -# include "virutil.h" -# include "virbuffer.h" -# include "virenum.h" +#include "internal.h" +#include "virutil.h" +#include "virbuffer.h" +#include "virenum.h" =20 typedef enum { VIR_SYSINFO_SMBIOS, @@ -152,5 +151,3 @@ bool virSysinfoIsEqual(virSysinfoDefPtr src, virSysinfoDefPtr dst); =20 VIR_ENUM_DECL(virSysinfo); - -#endif /* LIBVIRT_VIRSYSINFO_H */ diff --git a/src/util/virsysinfopriv.h b/src/util/virsysinfopriv.h index b7beb44807..cdcb021309 100644 --- a/src/util/virsysinfopriv.h +++ b/src/util/virsysinfopriv.h @@ -21,8 +21,7 @@ # error "virsysinfopriv.h may only be included by virsysinfo.c or test sui= tes" #endif /* LIBVIRT_VIRSYSINFOPRIV_H_ALLOW */ =20 -#ifndef LIBVIRT_VIRSYSINFOPRIV_H -# define LIBVIRT_VIRSYSINFOPRIV_H +#pragma once =20 void virSysinfoSetup(const char *dmidecode, @@ -40,5 +39,3 @@ virSysinfoReadS390(void); =20 virSysinfoDefPtr virSysinfoReadDMI(void); - -#endif /* LIBVIRT_VIRSYSINFOPRIV_H */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560874606; cv=none; d=zoho.com; s=zohoarc; b=jEVXIFmNsf04NdKmSpbyn/4QFqv92VzBrA+UVTpwZqxMF9jlawfpl90oay+6lecNL2/tas3Z6MNF83bDJpsOE1H5zK4gfeKmyoxyGFB1B+JtW1RZxbpJ4jXoopIBOd8TNJjNKvpKrfom5A9YpQRss1hmxn9IJsferQJwXdCruJQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560874606; 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=d+jyZifagGh8s41i3ZHdOtsV9cxYYSTjOBl8SS+o95s=; b=L0rAknCDDiqhChGB3GqzCKh2aJAsLZgfQEAy3ZowvXGPPIegEBjYefRRUcei7hgY3lbp1EDIpRb9i/Hf3yLzRAAflD0oHBypX+lCmn/Y0xtHev24NPtCIlOk9E592cb9pgiX69sfJ/7IjMhS3KGZaTJcqrmmXnEwb6ELXjWbthM= 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 1560874606105815.3590402357611; Tue, 18 Jun 2019 09:16:46 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CE652B2DC8; Tue, 18 Jun 2019 16:16:41 +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 75C0817D14; Tue, 18 Jun 2019 16:16:41 +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 2A010206DE; Tue, 18 Jun 2019 16:16:40 +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 x5IGDZOl024364 for ; Tue, 18 Jun 2019 12:13:35 -0400 Received: by smtp.corp.redhat.com (Postfix) id DDB1684EF; Tue, 18 Jun 2019 16:13:35 +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 ABBE560FAB for ; Tue, 18 Jun 2019 16:13:35 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:13:05 -0500 Message-Id: <20190618161316.1722-36-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 35/46] util: netlink: 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.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 18 Jun 2019 16:16:45 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/util/virnetlink.h | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/src/util/virnetlink.h b/src/util/virnetlink.h index 1bc075a86f..6419a775e1 100644 --- a/src/util/virnetlink.h +++ b/src/util/virnetlink.h @@ -17,45 +17,44 @@ * . */ =20 -#ifndef LIBVIRT_VIRNETLINK_H -# define LIBVIRT_VIRNETLINK_H +#pragma once =20 -# include "internal.h" -# include "virmacaddr.h" -# include "virautoclean.h" +#include "internal.h" +#include "virmacaddr.h" +#include "virautoclean.h" =20 -# if defined(__linux__) && defined(HAVE_LIBNL) +#if defined(__linux__) && defined(HAVE_LIBNL) =20 /* Work around a bug where older libnl-1 headers expected older gcc * semantics of 'extern inline' that conflict with C99 semantics. */ -# ifdef HAVE_LIBNL1 -# define inline -# endif -# include -# ifdef HAVE_LIBNL1 -# undef inline -# endif +# ifdef HAVE_LIBNL1 +# define inline +# endif +# include +# ifdef HAVE_LIBNL1 +# undef inline +# endif =20 typedef struct nl_msg virNetlinkMsg; VIR_DEFINE_AUTOPTR_FUNC(virNetlinkMsg, nlmsg_free); =20 -# else +#else =20 struct nl_msg; struct sockaddr_nl; struct nlattr; struct nlmsghdr; =20 -# endif /* __linux__ */ +#endif /* __linux__ */ =20 -# define NETLINK_MSG_NEST_START(msg, container, attrtype) \ +#define NETLINK_MSG_NEST_START(msg, container, attrtype) \ do { \ container =3D nla_nest_start(msg, attrtype); \ if (!container) \ goto buffer_too_small; \ } while(0) =20 -# define NETLINK_MSG_NEST_END(msg, container) \ +#define NETLINK_MSG_NEST_END(msg, container) \ do { nla_nest_end(msg, container); } while(0) =20 /* @@ -63,7 +62,7 @@ do { nla_nest_end(msg, container); } while(0) * complain about @data not being a pointer type: * error: the address of 'foo' will always evaluate as 'true' [-Werror=3Da= ddress] */ -# define NETLINK_MSG_PUT(msg, attrtype, datalen, data) \ +#define NETLINK_MSG_PUT(msg, attrtype, datalen, data) \ do { \ const void *dataptr =3D data; \ if (dataptr && nla_put(msg, attrtype, datalen, dataptr) < 0) \ @@ -162,5 +161,3 @@ int virNetlinkEventAddClient(virNetlinkEventHandleCallb= ack handleCB, */ int virNetlinkEventRemoveClient(int watch, const virMacAddr *macaddr, unsigned int protocol); - -#endif /* LIBVIRT_VIRNETLINK_H */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560874575; cv=none; d=zoho.com; s=zohoarc; b=eGPYtwqov4z3zS7lqGMkVg2vQtzuDr9MBkErFhW1WJcbL5GoOJuZO679cM/M0zRsSlK/tuxyIMl3q/3n7gSD2fch/dcBsvzCjomEWkxcjzhAVLJo1uK7AOjnSvyAgDzXvJGP0CSlCXoPq5uDmtYeUt8HcI4T/2DamhdLCaIy1Ps= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560874575; 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=qigLgaqgIB2ZKrlkoo//dDZRbmqzpYLubsgMUaXx8so=; b=MoZI4mXGt6xt/PO4AFtKHG/X1AMvZk048FfzMGe/gUTg2x0+IJogMZoDo7f+NGtsDTTrCNHlNj54QRUoyaa3k9WD2CWknMuYVWziQ6HEA2RsnM8xdMDkBnd2YMsvT4nRDJsSv8px68pq/dxzYIbHbicZYc6E8e+DLgxbiSDoM9E= 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 1560874575896526.6288248891542; Tue, 18 Jun 2019 09:16:15 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 3C64A30C1AFD; Tue, 18 Jun 2019 16:16:14 +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 BA5697D925; Tue, 18 Jun 2019 16:16:13 +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 753D3206D4; Tue, 18 Jun 2019 16:16:13 +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 x5IGDaOf024371 for ; Tue, 18 Jun 2019 12:13:36 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3A45860FAB; Tue, 18 Jun 2019 16:13:36 +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 08BF284EF for ; Tue, 18 Jun 2019 16:13:35 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:13:06 -0500 Message-Id: <20190618161316.1722-37-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 36/46] util: xml: 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.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Tue, 18 Jun 2019 16:16:14 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/util/virxml.h | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/src/util/virxml.h b/src/util/virxml.h index 38031b62c5..6208977dd1 100644 --- a/src/util/virxml.h +++ b/src/util/virxml.h @@ -18,18 +18,17 @@ * . */ =20 -#ifndef LIBVIRT_VIRXML_H -# define LIBVIRT_VIRXML_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 -# include -# include -# include -# include +#include +#include +#include +#include =20 -# include "virbuffer.h" -# include "virautoclean.h" +#include "virbuffer.h" +#include "virautoclean.h" =20 int virXPathBoolean(const char *xpath, xmlXPathContextPtr ctxt); @@ -96,7 +95,7 @@ const char *virXMLPickShellSafeComment(const char *str1, = const char *str2); * * Return the parsed document object, or NULL on failure. */ -# define virXMLParse(filename, xmlStr, url) \ +#define virXMLParse(filename, xmlStr, url) \ virXMLParseHelper(VIR_FROM_THIS, filename, xmlStr, url, NULL) =20 /** @@ -108,7 +107,7 @@ const char *virXMLPickShellSafeComment(const char *str1= , const char *str2); * * Return the parsed document object, or NULL on failure. */ -# define virXMLParseString(xmlStr, url) \ +#define virXMLParseString(xmlStr, url) \ virXMLParseHelper(VIR_FROM_THIS, NULL, xmlStr, url, NULL) =20 /** @@ -119,7 +118,7 @@ const char *virXMLPickShellSafeComment(const char *str1= , const char *str2); * * Return the parsed document object, or NULL on failure. */ -# define virXMLParseFile(filename) \ +#define virXMLParseFile(filename) \ virXMLParseHelper(VIR_FROM_THIS, filename, NULL, NULL, NULL) =20 /** @@ -134,7 +133,7 @@ const char *virXMLPickShellSafeComment(const char *str1= , const char *str2); * * Return the parsed document object, or NULL on failure. */ -# define virXMLParseCtxt(filename, xmlStr, url, pctxt) \ +#define virXMLParseCtxt(filename, xmlStr, url, pctxt) \ virXMLParseHelper(VIR_FROM_THIS, filename, xmlStr, url, pctxt) =20 /** @@ -148,7 +147,7 @@ const char *virXMLPickShellSafeComment(const char *str1= , const char *str2); * * Return the parsed document object, or NULL on failure. */ -# define virXMLParseStringCtxt(xmlStr, url, pctxt) \ +#define virXMLParseStringCtxt(xmlStr, url, pctxt) \ virXMLParseHelper(VIR_FROM_THIS, NULL, xmlStr, url, pctxt) =20 /** @@ -161,7 +160,7 @@ const char *virXMLPickShellSafeComment(const char *str1= , const char *str2); * * Return the parsed document object, or NULL on failure. */ -# define virXMLParseFileCtxt(filename, pctxt) \ +#define virXMLParseFileCtxt(filename, pctxt) \ virXMLParseHelper(VIR_FROM_THIS, filename, NULL, NULL, pctxt) =20 int virXMLSaveFile(const char *path, @@ -240,12 +239,10 @@ VIR_DEFINE_AUTOCLEAN_FUNC(virXPathContextNodeSave, vi= rXPathContextNodeRestore); * This macro ensures that when the scope where it's used ends, @ctxt's cu= rrent * node pointer is reset to the original value when this macro was used. */ -# define VIR_XPATH_NODE_AUTORESTORE(_ctxt) \ +#define VIR_XPATH_NODE_AUTORESTORE(_ctxt) \ VIR_AUTOCLEAN(virXPathContextNodeSave) _ctxt ## CtxtSave =3D { .ctxt = =3D _ctxt,\ .node =3D= _ctxt->node}; \ ignore_value(&_ctxt ## CtxtSave) =20 VIR_DEFINE_AUTOPTR_FUNC(xmlDoc, xmlFreeDoc); VIR_DEFINE_AUTOPTR_FUNC(xmlXPathContext, xmlXPathFreeContext); - -#endif /* LIBVIRT_VIRXML_H */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560876141; cv=none; d=zoho.com; s=zohoarc; b=IIYd50U2G5tIlYD6bWIECuBzypVxCcBx1+hhRDXKUbiGn06I2ATmjCuLsvKtS1a05Q+QxX24ayTn1Cq3vBGsNKuxO1eDlDCI1KK9zHo19BTqfDprHKSOzfLrF5gaXqPZ/Sjg1AFzyDl4Dh91UyUUegqNAEpigIkcsmM/HwPTuxQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560876141; 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=Bxb+XtgnAwp+1zZP97cZAsgXiRyAqzkHGX8suYLOk34=; b=arYGk5dmaSnP1Yi6s39ZXX9TPneaOJQmfAi8Eea313ZcrybLAcaGWxHKO2xoXEmbtg1HY2tTm6Z0sLiJOOudRekypWDsQ05DIP8I/snCdsGG7EBofyMWdRkYmGVXHZKzaw8RFXvBs3Xr5dXHbths6dTBElmBzsOKq/esIMPTgw0= 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 1560876141950163.7536330282918; Tue, 18 Jun 2019 09:42:21 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 274A5308FED5; Tue, 18 Jun 2019 16:42:19 +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 00B5410190A0; Tue, 18 Jun 2019 16:42:18 +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 B14821806B1B; Tue, 18 Jun 2019 16:42:17 +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 x5IGDarV024379 for ; Tue, 18 Jun 2019 12:13:36 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8DECD84EF; Tue, 18 Jun 2019 16:13:36 +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 58C5360FAB for ; Tue, 18 Jun 2019 16:13:36 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:13:07 -0500 Message-Id: <20190618161316.1722-38-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 37/46] util: scsi: 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.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Tue, 18 Jun 2019 16:42:20 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/util/virscsi.h | 11 ++++------- src/util/virscsihost.h | 7 ++----- src/util/virscsivhost.h | 13 +++++-------- 3 files changed, 11 insertions(+), 20 deletions(-) diff --git a/src/util/virscsi.h b/src/util/virscsi.h index 907948455e..6cc68835b7 100644 --- a/src/util/virscsi.h +++ b/src/util/virscsi.h @@ -18,12 +18,11 @@ * . */ =20 -#ifndef LIBVIRT_VIRSCSI_H -# define LIBVIRT_VIRSCSI_H +#pragma once =20 -# include "internal.h" -# include "virobject.h" -# include "virautoclean.h" +#include "internal.h" +#include "virobject.h" +#include "virautoclean.h" =20 typedef struct _virSCSIDevice virSCSIDevice; typedef virSCSIDevice *virSCSIDevicePtr; @@ -94,5 +93,3 @@ virSCSIDevicePtr virSCSIDeviceListFind(virSCSIDeviceListP= tr list, virSCSIDevicePtr dev); =20 VIR_DEFINE_AUTOPTR_FUNC(virSCSIDevice, virSCSIDeviceFree); - -#endif /* LIBVIRT_VIRSCSI_H */ diff --git a/src/util/virscsihost.h b/src/util/virscsihost.h index 1e8b8803ce..ccc10f772d 100644 --- a/src/util/virscsihost.h +++ b/src/util/virscsihost.h @@ -16,10 +16,9 @@ * . */ =20 -#ifndef LIBVIRT_VIRSCSIHOST_H -# define LIBVIRT_VIRSCSIHOST_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 int virSCSIHostGetUniqueId(const char *sysfs_prefix, int host); =20 @@ -36,5 +35,3 @@ char *virSCSIHostGetNameByParentaddr(unsigned int domain, unsigned int slot, unsigned int function, unsigned int unique_id); - -#endif /* LIBVIRT_VIRSCSIHOST_H */ diff --git a/src/util/virscsivhost.h b/src/util/virscsivhost.h index 7349db378e..a1a0ea5618 100644 --- a/src/util/virscsivhost.h +++ b/src/util/virscsivhost.h @@ -18,13 +18,12 @@ * . */ =20 -#ifndef LIBVIRT_VIRSCSIVHOST_H -# define LIBVIRT_VIRSCSIVHOST_H +#pragma once =20 -# include "internal.h" -# include "virobject.h" -# include "virutil.h" -# include "virautoclean.h" +#include "internal.h" +#include "virobject.h" +#include "virutil.h" +#include "virautoclean.h" =20 typedef struct _virSCSIVHostDevice virSCSIVHostDevice; typedef virSCSIVHostDevice *virSCSIVHostDevicePtr; @@ -62,5 +61,3 @@ void virSCSIVHostDeviceFree(virSCSIVHostDevicePtr dev); int virSCSIVHostOpenVhostSCSI(int *vhostfd) ATTRIBUTE_NOINLINE; =20 VIR_DEFINE_AUTOPTR_FUNC(virSCSIVHostDevice, virSCSIVHostDeviceFree); - -#endif /* LIBVIRT_VIRSCSIVHOST_H */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560874589; cv=none; d=zoho.com; s=zohoarc; b=Vsj1Sb0IGan0wGG8IiJETLdMUCqEeYn3wpW70rFS926LrUxLLLIABci5lDii6UF5FlcK/0637veHCiD4Hrb9RAmMVuT5HEy0WZIDh30OiQS67s+xNNFtkHeGot/1mS11axELkFk1G6+LTdJMUCQFrrUNiipGG5xYP9R3mhifn84= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560874589; 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=G6hZwCJwps5r0sfjjMNtaNINDN3KK1SclbIXYqNk/Bs=; b=W10sgugpDjzLzMdfsfFgTVA6jDaMj6HU9BjHLpa2mjBAEqWKa2+uBefw1K55kQZGznU9YkM8OKAAehPHdlsPdx6rPNRtsUl4WZ+E2WMGZl6JsNnlm45R5BJLkByIRv+3tNyLPYrt18dCx7UfOJClHXcGQF26DwbYW+WLIU9F1hc= 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 1560874589632973.7228854117577; Tue, 18 Jun 2019 09:16:29 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B8852356F8; Tue, 18 Jun 2019 16:16:22 +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 8980617D14; Tue, 18 Jun 2019 16:16:21 +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 48283206D7; Tue, 18 Jun 2019 16:16:20 +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 x5IGDbkQ024389 for ; Tue, 18 Jun 2019 12:13:37 -0400 Received: by smtp.corp.redhat.com (Postfix) id 01F0260FAB; Tue, 18 Jun 2019 16:13:37 +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 AE0D784EF for ; Tue, 18 Jun 2019 16:13:36 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:13:08 -0500 Message-Id: <20190618161316.1722-39-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 38/46] util: misc: 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.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 18 Jun 2019 16:16:23 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/util/virarptable.h | 7 ++---- src/util/viraudit.h | 15 +++++------- src/util/virauth.h | 8 +++--- src/util/virauthconfig.h | 9 +++---- src/util/virautoclean.h | 17 ++++++------- src/util/virbitmap.h | 11 +++------ src/util/virbuffer.h | 19 ++++++--------- src/util/virclosecallbacks.h | 6 ++--- src/util/virconf.h | 9 +++---- src/util/vircrypto.h | 11 +++------ src/util/virdevmapper.h | 5 +--- src/util/virdnsmasq.h | 20 +++++++-------- src/util/virebtables.h | 7 ++---- src/util/virendian.h | 19 ++++++--------- src/util/virenum.h | 11 +++------ src/util/virevent.h | 7 ++---- src/util/vireventpoll.h | 8 ++---- src/util/virfcp.h | 5 +--- src/util/virfdstream.h | 6 ++--- src/util/virfilecache.h | 11 +++------ src/util/virfirmware.h | 8 ++---- src/util/virgettext.h | 5 +--- src/util/virgic.h | 9 +++---- src/util/virhook.h | 7 ++---- src/util/viridentity.h | 8 ++---- src/util/virinitctl.h | 5 +--- src/util/viriptables.h | 9 +++---- src/util/viriscsi.h | 7 ++---- src/util/virjson.h | 15 +++++------- src/util/virkeycode.h | 9 +++---- src/util/virkeyfile.h | 7 ++---- src/util/virkmod.h | 6 ++--- src/util/virlease.h | 7 ++---- src/util/virlockspace.h | 9 +++---- src/util/virmdev.h | 15 +++++------- src/util/virmodule.h | 5 +--- src/util/virnodesuspend.h | 7 ++---- src/util/virnuma.h | 10 +++----- src/util/virpci.h | 21 +++++++--------- src/util/virperf.h | 11 +++------ src/util/virpidfile.h | 9 +++---- src/util/virpolkit.h | 11 +++------ src/util/virportallocator.h | 9 +++---- src/util/virprocess.h | 15 +++++------- src/util/virqemu.h | 13 ++++------ src/util/virrandom.h | 7 ++---- src/util/virresctrl.h | 12 ++++----- src/util/virresctrlpriv.h | 7 ++---- src/util/virrotatingfile.h | 7 ++---- src/util/virseclabel.h | 5 +--- src/util/virsecret.h | 12 ++++----- src/util/virsexpr.h | 9 +++---- src/util/virsystemd.h | 7 ++---- src/util/virsystemdpriv.h | 7 ++---- src/util/virtime.h | 11 +++------ src/util/virtpm.h | 5 +--- src/util/virtypedparam.h | 15 +++++------- src/util/viruri.h | 15 +++++------- src/util/virusb.h | 13 ++++------ src/util/virutil.h | 47 +++++++++++++++++------------------- src/util/viruuid.h | 9 +++---- src/util/virvhba.h | 7 ++---- src/util/virvsock.h | 4 +-- src/util/virxdrdefs.h | 35 ++++++++++++--------------- 64 files changed, 248 insertions(+), 434 deletions(-) diff --git a/src/util/virarptable.h b/src/util/virarptable.h index 4437b3544f..812524d721 100644 --- a/src/util/virarptable.h +++ b/src/util/virarptable.h @@ -18,10 +18,9 @@ * . */ =20 -#ifndef LIBVIRT_VIRARPTABLE_H -# define LIBVIRT_VIRARPTABLE_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 typedef struct _virArpTableEntry virArpTableEntry; typedef virArpTableEntry *virArpTableEntryPtr; @@ -40,5 +39,3 @@ struct _virArpTable { =20 virArpTablePtr virArpTableGet(void); void virArpTableFree(virArpTablePtr table); - -#endif /* LIBVIRT_VIRARPTABLE_H */ diff --git a/src/util/viraudit.h b/src/util/viraudit.h index 66605b16b5..51e152ad1e 100644 --- a/src/util/viraudit.h +++ b/src/util/viraudit.h @@ -19,11 +19,10 @@ * */ =20 -#ifndef LIBVIRT_VIRAUDIT_H -# define LIBVIRT_VIRAUDIT_H +#pragma once =20 -# include "internal.h" -# include "virlog.h" +#include "internal.h" +#include "virlog.h" =20 typedef enum { VIR_AUDIT_RECORD_MACHINE_CONTROL, @@ -46,15 +45,13 @@ char *virAuditEncode(const char *key, const char *value= ); =20 void virAuditClose(void); =20 -# define VIR_AUDIT(type, success, ...) \ +#define VIR_AUDIT(type, success, ...) \ virAuditSend(&virLogSelf, __FILE__, __LINE__, __func__, \ NULL, NULL, type, success, __VA_ARGS__); =20 -# define VIR_AUDIT_USER(type, success, clienttty, clientaddr, ...) \ +#define VIR_AUDIT_USER(type, success, clienttty, clientaddr, ...) \ virAuditSend(&virLogSelf, __FILE__, __LINE__, __func__, \ clienttty, clientaddr, type, success, __VA_ARGS__); =20 -# define VIR_AUDIT_STR(str) \ +#define VIR_AUDIT_STR(str) \ ((str) ? (str) : "?") - -#endif /* LIBVIRT_VIRAUDIT_H */ diff --git a/src/util/virauth.h b/src/util/virauth.h index ebcca2cc01..d91a545ed2 100644 --- a/src/util/virauth.h +++ b/src/util/virauth.h @@ -20,11 +20,10 @@ * */ =20 -#ifndef LIBVIRT_VIRAUTH_H -# define LIBVIRT_VIRAUTH_H +#pragma once =20 -# include "internal.h" -# include "viruri.h" +#include "internal.h" +#include "viruri.h" =20 int virAuthGetConfigFilePath(virConnectPtr conn, char **path); @@ -53,4 +52,3 @@ char * virAuthGetPasswordPath(const char *path, const char *servicename, const char *username, const char *hostname); -#endif /* LIBVIRT_VIRAUTH_H */ diff --git a/src/util/virauthconfig.h b/src/util/virauthconfig.h index cc30affa33..3de5e36030 100644 --- a/src/util/virauthconfig.h +++ b/src/util/virauthconfig.h @@ -18,11 +18,10 @@ * . */ =20 -#ifndef LIBVIRT_VIRAUTHCONFIG_H -# define LIBVIRT_VIRAUTHCONFIG_H +#pragma once =20 -# include "internal.h" -# include "virautoclean.h" +#include "internal.h" +#include "virautoclean.h" =20 typedef struct _virAuthConfig virAuthConfig; typedef virAuthConfig *virAuthConfigPtr; @@ -42,5 +41,3 @@ int virAuthConfigLookup(virAuthConfigPtr auth, const char **value); =20 VIR_DEFINE_AUTOPTR_FUNC(virAuthConfig, virAuthConfigFree); - -#endif /* LIBVIRT_VIRAUTHCONFIG_H */ diff --git a/src/util/virautoclean.h b/src/util/virautoclean.h index b632023c73..6da288e67d 100644 --- a/src/util/virautoclean.h +++ b/src/util/virautoclean.h @@ -18,10 +18,9 @@ * */ =20 -#ifndef LIBVIRT_VIRAUTOCLEAN_H -# define LIBVIRT_VIRAUTOCLEAN_H +#pragma once =20 -# define VIR_AUTOPTR_FUNC_NAME(type) type##AutoPtrFree +#define VIR_AUTOPTR_FUNC_NAME(type) type##AutoPtrFree =20 /** * VIR_DEFINE_AUTOPTR_FUNC: @@ -32,7 +31,7 @@ * resources allocated to a variable of type @type. This newly * defined function works as a necessary wrapper around @func. */ -# define VIR_DEFINE_AUTOPTR_FUNC(type, func) \ +#define VIR_DEFINE_AUTOPTR_FUNC(type, func) \ static inline void VIR_AUTOPTR_FUNC_NAME(type)(type **_ptr) \ { \ if (*_ptr) \ @@ -40,7 +39,7 @@ *_ptr =3D NULL; \ } =20 -# define VIR_AUTOCLEAN_FUNC_NAME(type) type##AutoClean +#define VIR_AUTOCLEAN_FUNC_NAME(type) type##AutoClean =20 /** * VIR_DEFINE_AUTOCLEAN_FUNC: @@ -51,7 +50,7 @@ * resources in a stack'd variable of type @type. Note that @func must * take pointer to @type. */ -# define VIR_DEFINE_AUTOCLEAN_FUNC(type, func) \ +#define VIR_DEFINE_AUTOCLEAN_FUNC(type, func) \ static inline void VIR_AUTOCLEAN_FUNC_NAME(type)(type *_ptr) \ { \ (func)(_ptr); \ @@ -69,7 +68,7 @@ * Note that this macro must NOT be used with vectors! The freeing function * will not free any elements beyond the first. */ -# define VIR_AUTOPTR(type) \ +#define VIR_AUTOPTR(type) \ __attribute__((cleanup(VIR_AUTOPTR_FUNC_NAME(type)))) type * =20 /** @@ -84,7 +83,5 @@ * Note that this macro must NOT be used with vectors! The cleaning functi= on * will not clean any elements beyond the first. */ -# define VIR_AUTOCLEAN(type) \ +#define VIR_AUTOCLEAN(type) \ __attribute__((cleanup(VIR_AUTOCLEAN_FUNC_NAME(type)))) type - -#endif /* LIBVIRT_VIRAUTOCLEAN_H */ diff --git a/src/util/virbitmap.h b/src/util/virbitmap.h index 8696214da8..46696e0c70 100644 --- a/src/util/virbitmap.h +++ b/src/util/virbitmap.h @@ -19,13 +19,12 @@ * . */ =20 -#ifndef LIBVIRT_VIRBITMAP_H -# define LIBVIRT_VIRBITMAP_H +#pragma once =20 -# include "internal.h" -# include "virautoclean.h" +#include "internal.h" +#include "virautoclean.h" =20 -# include +#include =20 =20 typedef struct _virBitmap virBitmap; @@ -159,5 +158,3 @@ void virBitmapSubtract(virBitmapPtr a, virBitmapPtr b) void virBitmapShrink(virBitmapPtr map, size_t b); =20 VIR_DEFINE_AUTOPTR_FUNC(virBitmap, virBitmapFree); - -#endif /* LIBVIRT_VIRBITMAP_H */ diff --git a/src/util/virbuffer.h b/src/util/virbuffer.h index dd9d4ab3d4..d5a7a8dc33 100644 --- a/src/util/virbuffer.h +++ b/src/util/virbuffer.h @@ -18,13 +18,12 @@ * . */ =20 -#ifndef LIBVIRT_VIRBUFFER_H -# define LIBVIRT_VIRBUFFER_H +#pragma once =20 -# include +#include =20 -# include "internal.h" -# include "virautoclean.h" +#include "internal.h" +#include "virautoclean.h" =20 =20 /** @@ -35,7 +34,7 @@ typedef struct _virBuffer virBuffer; typedef virBuffer *virBufferPtr; =20 -# define VIR_BUFFER_INITIALIZER { 0, 0, 0, 0, NULL } +#define VIR_BUFFER_INITIALIZER { 0, 0, 0, 0, NULL } =20 struct _virBuffer { size_t size; @@ -66,7 +65,7 @@ VIR_DEFINE_AUTOCLEAN_FUNC(virBuffer, virBufferFreeAndRese= t); * Returns 0 if no error has occurred, otherwise an error is reported * and -1 is returned. */ -# define virBufferCheckError(buf) \ +#define virBufferCheckError(buf) \ virBufferCheckErrorInternal(buf, VIR_FROM_THIS, __FILE__, __FUNCTION__= , \ __LINE__) size_t virBufferUse(const virBuffer *buf); @@ -96,7 +95,7 @@ void virBufferEscapeSQL(virBufferPtr buf, void virBufferEscapeShell(virBufferPtr buf, const char *str); void virBufferURIEncodeString(virBufferPtr buf, const char *str); =20 -# define virBufferAddLit(buf_, literal_string_) \ +#define virBufferAddLit(buf_, literal_string_) \ virBufferAdd(buf_, "" literal_string_ "", sizeof(literal_string_) - 1) =20 void virBufferAdjustIndent(virBufferPtr buf, int indent); @@ -108,12 +107,10 @@ void virBufferSetIndent(virBufferPtr, int indent); * Gets the parent indentation, increments it by 2 and sets it to * child buffer. */ -# define virBufferSetChildIndent(childBuf_, parentBuf_) \ +#define virBufferSetChildIndent(childBuf_, parentBuf_) \ virBufferSetIndent(childBuf_, virBufferGetIndent(parentBuf_, false) + = 2) =20 int virBufferGetIndent(const virBuffer *buf, bool dynamic); =20 void virBufferTrim(virBufferPtr buf, const char *trim, int len); void virBufferAddStr(virBufferPtr buf, const char *str); - -#endif /* LIBVIRT_VIRBUFFER_H */ diff --git a/src/util/virclosecallbacks.h b/src/util/virclosecallbacks.h index e756c79a90..98fc2c4a94 100644 --- a/src/util/virclosecallbacks.h +++ b/src/util/virclosecallbacks.h @@ -18,10 +18,9 @@ * . */ =20 -#ifndef LIBVIRT_VIRCLOSECALLBACKS_H -# define LIBVIRT_VIRCLOSECALLBACKS_H +#pragma once =20 -# include "conf/virdomainobjlist.h" +#include "conf/virdomainobjlist.h" =20 typedef struct _virCloseCallbacks virCloseCallbacks; typedef virCloseCallbacks *virCloseCallbacksPtr; @@ -49,4 +48,3 @@ virCloseCallbacksRun(virCloseCallbacksPtr closeCallbacks, virConnectPtr conn, virDomainObjListPtr domains, void *opaque); -#endif /* LIBVIRT_VIRCLOSECALLBACKS_H */ diff --git a/src/util/virconf.h b/src/util/virconf.h index d692e4a805..ed9d404a1e 100644 --- a/src/util/virconf.h +++ b/src/util/virconf.h @@ -18,11 +18,10 @@ * . */ =20 -#ifndef LIBVIRT_VIRCONF_H -# define LIBVIRT_VIRCONF_H +#pragma once =20 -# include "virutil.h" -# include "virenum.h" +#include "virutil.h" +#include "virenum.h" =20 /** * virConfType: @@ -128,5 +127,3 @@ int virConfWriteMem(char *memory, int *len, virConfPtr conf); int virConfLoadConfig(virConfPtr *conf, const char *name); - -#endif /* LIBVIRT_VIRCONF_H */ diff --git a/src/util/vircrypto.h b/src/util/vircrypto.h index f816ab5435..826169276e 100644 --- a/src/util/vircrypto.h +++ b/src/util/vircrypto.h @@ -18,13 +18,12 @@ * . */ =20 -#ifndef LIBVIRT_VIRCRYPTO_H -# define LIBVIRT_VIRCRYPTO_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 -# define VIR_CRYPTO_HASH_SIZE_MD5 16 -# define VIR_CRYPTO_HASH_SIZE_SHA256 32 +#define VIR_CRYPTO_HASH_SIZE_MD5 16 +#define VIR_CRYPTO_HASH_SIZE_SHA256 32 =20 typedef enum { VIR_CRYPTO_HASH_MD5, /* Don't use this except for historic compat */ @@ -64,5 +63,3 @@ int virCryptoEncryptData(virCryptoCipher algorithm, uint8_t **ciphertext, size_t *ciphertextlen) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(6) ATTRIBUTE_NONNULL(8) ATTRIBUTE_NONNULL(9) ATTRIBUTE_RETURN_CHECK; - -#endif /* LIBVIRT_VIRCRYPTO_H */ diff --git a/src/util/virdevmapper.h b/src/util/virdevmapper.h index d9e1c1775a..e576d2bf7e 100644 --- a/src/util/virdevmapper.h +++ b/src/util/virdevmapper.h @@ -18,11 +18,8 @@ * . */ =20 -#ifndef LIBVIRT_VIRDEVMAPPER_H -# define LIBVIRT_VIRDEVMAPPER_H +#pragma once =20 int virDevMapperGetTargets(const char *path, char ***devPaths); - -#endif /* LIBVIRT_VIRDEVMAPPER_H */ diff --git a/src/util/virdnsmasq.h b/src/util/virdnsmasq.h index 74774743fa..ff0e56d635 100644 --- a/src/util/virdnsmasq.h +++ b/src/util/virdnsmasq.h @@ -21,11 +21,10 @@ * based on iptables.h */ =20 -#ifndef LIBVIRT_VIRDNSMASQ_H -# define LIBVIRT_VIRDNSMASQ_H +#pragma once =20 -# include "virobject.h" -# include "virsocketaddr.h" +#include "virobject.h" +#include "virsocketaddr.h" =20 typedef struct { @@ -106,17 +105,16 @@ bool dnsmasqCapsGet(dnsmasqCapsPtr caps, dnsmasqCapsF= lags flag); const char *dnsmasqCapsGetBinaryPath(dnsmasqCapsPtr caps); unsigned long dnsmasqCapsGetVersion(dnsmasqCapsPtr caps); =20 -# define DNSMASQ_DHCPv6_MAJOR_REQD 2 -# define DNSMASQ_DHCPv6_MINOR_REQD 64 -# define DNSMASQ_RA_MAJOR_REQD 2 -# define DNSMASQ_RA_MINOR_REQD 64 +#define DNSMASQ_DHCPv6_MAJOR_REQD 2 +#define DNSMASQ_DHCPv6_MINOR_REQD 64 +#define DNSMASQ_RA_MAJOR_REQD 2 +#define DNSMASQ_RA_MINOR_REQD 64 =20 -# define DNSMASQ_DHCPv6_SUPPORT(CAPS) \ +#define DNSMASQ_DHCPv6_SUPPORT(CAPS) \ (dnsmasqCapsGetVersion(CAPS) >=3D \ (DNSMASQ_DHCPv6_MAJOR_REQD * 1000000) + \ (DNSMASQ_DHCPv6_MINOR_REQD * 1000)) -# define DNSMASQ_RA_SUPPORT(CAPS) \ +#define DNSMASQ_RA_SUPPORT(CAPS) \ (dnsmasqCapsGetVersion(CAPS) >=3D \ (DNSMASQ_RA_MAJOR_REQD * 1000000) + \ (DNSMASQ_RA_MINOR_REQD * 1000)) -#endif /* LIBVIRT_VIRDNSMASQ_H */ diff --git a/src/util/virebtables.h b/src/util/virebtables.h index 87bb3a3708..9c878971c5 100644 --- a/src/util/virebtables.h +++ b/src/util/virebtables.h @@ -19,10 +19,9 @@ * . */ =20 -#ifndef LIBVIRT_VIREBTABLES_H -# define LIBVIRT_VIREBTABLES_H +#pragma once =20 -# include "virmacaddr.h" +#include "virmacaddr.h" =20 typedef struct _ebtablesContext ebtablesContext; =20 @@ -37,5 +36,3 @@ int ebtablesRemoveForwardAllowIn (ebtable= sContext *ctx, const virMacAddr *mac); =20 int ebtablesAddForwardPolicyReject(ebtablesContext *ctx); - -#endif /* LIBVIRT_VIREBTABLES_H */ diff --git a/src/util/virendian.h b/src/util/virendian.h index 4a92b1822d..e5b82026ac 100644 --- a/src/util/virendian.h +++ b/src/util/virendian.h @@ -19,10 +19,9 @@ * */ =20 -#ifndef LIBVIRT_VIRENDIAN_H -# define LIBVIRT_VIRENDIAN_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 /* The interfaces in this file are provided as macros for speed. */ =20 @@ -34,7 +33,7 @@ * Read 8 bytes at BUF as a big-endian 64-bit number. Caller is * responsible to avoid reading beyond array bounds. */ -# define virReadBufInt64BE(buf) \ +#define virReadBufInt64BE(buf) \ (((uint64_t)(uint8_t)((buf)[0]) << 56) | \ ((uint64_t)(uint8_t)((buf)[1]) << 48) | \ ((uint64_t)(uint8_t)((buf)[2]) << 40) | \ @@ -52,7 +51,7 @@ * Read 8 bytes at BUF as a little-endian 64-bit number. Caller is * responsible to avoid reading beyond array bounds. */ -# define virReadBufInt64LE(buf) \ +#define virReadBufInt64LE(buf) \ ((uint64_t)(uint8_t)((buf)[0]) | \ ((uint64_t)(uint8_t)((buf)[1]) << 8) | \ ((uint64_t)(uint8_t)((buf)[2]) << 16) | \ @@ -70,7 +69,7 @@ * Read 4 bytes at BUF as a big-endian 32-bit number. Caller is * responsible to avoid reading beyond array bounds. */ -# define virReadBufInt32BE(buf) \ +#define virReadBufInt32BE(buf) \ (((uint32_t)(uint8_t)((buf)[0]) << 24) | \ ((uint32_t)(uint8_t)((buf)[1]) << 16) | \ ((uint32_t)(uint8_t)((buf)[2]) << 8) | \ @@ -84,7 +83,7 @@ * Read 4 bytes at BUF as a little-endian 32-bit number. Caller is * responsible to avoid reading beyond array bounds. */ -# define virReadBufInt32LE(buf) \ +#define virReadBufInt32LE(buf) \ ((uint32_t)(uint8_t)((buf)[0]) | \ ((uint32_t)(uint8_t)((buf)[1]) << 8) | \ ((uint32_t)(uint8_t)((buf)[2]) << 16) | \ @@ -98,7 +97,7 @@ * Read 2 bytes at BUF as a big-endian 16-bit number. Caller is * responsible to avoid reading beyond array bounds. */ -# define virReadBufInt16BE(buf) \ +#define virReadBufInt16BE(buf) \ (((uint16_t)(uint8_t)((buf)[0]) << 8) | \ (uint16_t)(uint8_t)((buf)[1])) =20 @@ -110,8 +109,6 @@ * Read 2 bytes at BUF as a little-endian 16-bit number. Caller is * responsible to avoid reading beyond array bounds. */ -# define virReadBufInt16LE(buf) \ +#define virReadBufInt16LE(buf) \ ((uint16_t)(uint8_t)((buf)[0]) | \ ((uint16_t)(uint8_t)((buf)[1]) << 8)) - -#endif /* LIBVIRT_VIRENDIAN_H */ diff --git a/src/util/virenum.h b/src/util/virenum.h index 3ae1a70b72..ab443aa528 100644 --- a/src/util/virenum.h +++ b/src/util/virenum.h @@ -16,10 +16,9 @@ * . */ =20 -#ifndef LIBVIRT_VIRENUM_H -# define LIBVIRT_VIRENUM_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 int virEnumFromString(const char * const *types, @@ -31,7 +30,7 @@ virEnumToString(const char * const *types, unsigned int ntypes, int type); =20 -# define VIR_ENUM_IMPL(name, lastVal, ...) \ +#define VIR_ENUM_IMPL(name, lastVal, ...) \ static const char *const name ## TypeList[] =3D { __VA_ARGS__ }; \ const char *name ## TypeToString(int type) { \ return virEnumToString(name ## TypeList, \ @@ -45,7 +44,7 @@ virEnumToString(const char * const *types, } \ verify(ARRAY_CARDINALITY(name ## TypeList) =3D=3D lastVal) =20 -# define VIR_ENUM_DECL(name) \ +#define VIR_ENUM_DECL(name) \ const char *name ## TypeToString(int type); \ int name ## TypeFromString(const char*type) =20 @@ -76,5 +75,3 @@ virTristateSwitch virTristateSwitchFromBool(bool val); verify((int)VIR_TRISTATE_BOOL_YES =3D=3D (int)VIR_TRISTATE_SWITCH_ON); verify((int)VIR_TRISTATE_BOOL_NO =3D=3D (int)VIR_TRISTATE_SWITCH_OFF); verify((int)VIR_TRISTATE_BOOL_ABSENT =3D=3D (int)VIR_TRISTATE_SWITCH_ABSEN= T); - -#endif /* LIBVIRT_VIRENUM_H */ diff --git a/src/util/virevent.h b/src/util/virevent.h index 37d7070935..0b4f7d2b1b 100644 --- a/src/util/virevent.h +++ b/src/util/virevent.h @@ -19,8 +19,5 @@ * . */ =20 -#ifndef LIBVIRT_VIREVENT_H -# define LIBVIRT_VIREVENT_H -# include "internal.h" - -#endif /* LIBVIRT_VIREVENT_H */ +#pragma once +#include "internal.h" diff --git a/src/util/vireventpoll.h b/src/util/vireventpoll.h index ad1ee56e7c..7f0c847768 100644 --- a/src/util/vireventpoll.h +++ b/src/util/vireventpoll.h @@ -19,10 +19,9 @@ * . */ =20 -#ifndef LIBVIRT_VIREVENTPOLL_H -# define LIBVIRT_VIREVENTPOLL_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 /** * virEventPollAddHandle: register a callback for monitoring file handle e= vents @@ -125,6 +124,3 @@ int virEventPollToNativeEvents(int events); * return -1 if wakeup failed */ int virEventPollInterrupt(void); - - -#endif /* LIBVIRT_VIREVENTPOLL_H */ diff --git a/src/util/virfcp.h b/src/util/virfcp.h index 16a6b2d42e..6364f05ebc 100644 --- a/src/util/virfcp.h +++ b/src/util/virfcp.h @@ -18,8 +18,7 @@ * . */ =20 -#ifndef LIBVIRT_VIRFCP_H -# define LIBVIRT_VIRFCP_H +#pragma once =20 bool virFCIsCapableRport(const char *rport); @@ -28,5 +27,3 @@ int virFCReadRportValue(const char *rport, const char *entry, char **result); - -#endif /* LIBVIRT_VIRFCP_H */ diff --git a/src/util/virfdstream.h b/src/util/virfdstream.h index 093db303ff..d7204a4dc3 100644 --- a/src/util/virfdstream.h +++ b/src/util/virfdstream.h @@ -19,10 +19,9 @@ * */ =20 -#ifndef LIBVIRT_VIRFDSTREAM_H -# define LIBVIRT_VIRFDSTREAM_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 /* internal callback, the generic one is used up by daemon stream driver */ /* the close callback is called with fdstream private data locked */ @@ -65,4 +64,3 @@ int virFDStreamSetInternalCloseCb(virStreamPtr st, virFDStreamInternalCloseCb cb, void *opaque, virFDStreamInternalCloseCbFreeOpaque fcb= ); -#endif /* LIBVIRT_VIRFDSTREAM_H */ diff --git a/src/util/virfilecache.h b/src/util/virfilecache.h index 70c8a4bffe..006a9717cb 100644 --- a/src/util/virfilecache.h +++ b/src/util/virfilecache.h @@ -19,13 +19,12 @@ * */ =20 -#ifndef LIBVIRT_VIRFILECACHE_H -# define LIBVIRT_VIRFILECACHE_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 -# include "virobject.h" -# include "virhash.h" +#include "virobject.h" +#include "virhash.h" =20 typedef struct _virFileCache virFileCache; typedef virFileCache *virFileCachePtr; @@ -133,5 +132,3 @@ int virFileCacheInsertData(virFileCachePtr cache, const char *name, void *data); - -#endif /* LIBVIRT_VIRFILECACHE_H */ diff --git a/src/util/virfirmware.h b/src/util/virfirmware.h index 784e34cc65..ed59f34102 100644 --- a/src/util/virfirmware.h +++ b/src/util/virfirmware.h @@ -18,10 +18,9 @@ * . */ =20 -#ifndef LIBVIRT_VIRFIRMWARE_H -# define LIBVIRT_VIRFIRMWARE_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 typedef struct _virFirmware virFirmware; typedef virFirmware *virFirmwarePtr; @@ -44,6 +43,3 @@ virFirmwareParseList(const char *list, virFirmwarePtr **firmwares, size_t *nfirmwares) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); - - -#endif /* LIBVIRT_VIRFIRMWARE_H */ diff --git a/src/util/virgettext.h b/src/util/virgettext.h index fe5daa3fe2..3142124bbe 100644 --- a/src/util/virgettext.h +++ b/src/util/virgettext.h @@ -18,9 +18,6 @@ * . */ =20 -#ifndef LIBVIRT_VIRGETTEXT_H -# define LIBVIRT_VIRGETTEXT_H +#pragma once =20 int virGettextInitialize(void); - -#endif /* LIBVIRT_VIRGETTEXT_H */ diff --git a/src/util/virgic.h b/src/util/virgic.h index e54d7ec9d2..6552ab53f8 100644 --- a/src/util/virgic.h +++ b/src/util/virgic.h @@ -18,11 +18,10 @@ * . */ =20 -#ifndef LIBVIRT_VIRGIC_H -# define LIBVIRT_VIRGIC_H +#pragma once =20 -# include "virutil.h" -# include "virenum.h" +#include "virutil.h" +#include "virenum.h" =20 typedef enum { VIR_GIC_VERSION_NONE =3D 0, @@ -46,5 +45,3 @@ struct _virGICCapability { virGICVersion version; virGICImplementation implementation; }; - -#endif /* LIBVIRT_VIRGIC_H */ diff --git a/src/util/virhook.h b/src/util/virhook.h index fa188c89e3..f91cb87b10 100644 --- a/src/util/virhook.h +++ b/src/util/virhook.h @@ -19,10 +19,9 @@ * . */ =20 -#ifndef LIBVIRT_VIRHOOK_H -# define LIBVIRT_VIRHOOK_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 typedef enum { VIR_HOOK_DRIVER_DAEMON =3D 0, /* Daemon related events */ @@ -104,5 +103,3 @@ int virHookPresent(int driver); =20 int virHookCall(int driver, const char *id, int op, int sub_op, const char *extra, const char *input, char **output); - -#endif /* LIBVIRT_VIRHOOK_H */ diff --git a/src/util/viridentity.h b/src/util/viridentity.h index e385eda622..0fde3207ca 100644 --- a/src/util/viridentity.h +++ b/src/util/viridentity.h @@ -19,10 +19,9 @@ * */ =20 -#ifndef LIBVIRT_VIRIDENTITY_H -# define LIBVIRT_VIRIDENTITY_H +#pragma once =20 -# include "virobject.h" +#include "virobject.h" =20 typedef struct _virIdentity virIdentity; typedef virIdentity *virIdentityPtr; @@ -103,6 +102,3 @@ int virIdentitySetX509DName(virIdentityPtr ident, const char *dname); int virIdentitySetSELinuxContext(virIdentityPtr ident, const char *context); - - -#endif /* LIBVIRT_VIRIDENTITY_H */ diff --git a/src/util/virinitctl.h b/src/util/virinitctl.h index 14dda98b5b..46b2935a39 100644 --- a/src/util/virinitctl.h +++ b/src/util/virinitctl.h @@ -18,8 +18,7 @@ * . */ =20 -#ifndef LIBVIRT_VIRINITCTL_H -# define LIBVIRT_VIRINITCTL_H +#pragma once =20 typedef enum { VIR_INITCTL_RUNLEVEL_POWEROFF =3D 0, @@ -38,5 +37,3 @@ extern const char *virInitctlFifos[]; =20 int virInitctlSetRunLevel(const char *fifo, virInitctlRunLevel level); - -#endif /* LIBVIRT_VIRINITCTL_H */ diff --git a/src/util/viriptables.h b/src/util/viriptables.h index e680407ec8..feea988acd 100644 --- a/src/util/viriptables.h +++ b/src/util/viriptables.h @@ -18,11 +18,10 @@ * . */ =20 -#ifndef LIBVIRT_VIRIPTABLES_H -# define LIBVIRT_VIRIPTABLES_H +#pragma once =20 -# include "virsocketaddr.h" -# include "virfirewall.h" +#include "virsocketaddr.h" +#include "virfirewall.h" =20 int iptablesSetupPrivateChains (virFirewallLayer layer); =20 @@ -148,5 +147,3 @@ void iptablesAddOutputFixUdpChecksum (virFi= rewallPtr fw, void iptablesRemoveOutputFixUdpChecksum (virFirewallPtr fw, const char *iface, int port); - -#endif /* LIBVIRT_VIRIPTABLES_H */ diff --git a/src/util/viriscsi.h b/src/util/viriscsi.h index acf9ab18eb..6eddb504a2 100644 --- a/src/util/viriscsi.h +++ b/src/util/viriscsi.h @@ -19,10 +19,9 @@ * */ =20 -#ifndef LIBVIRT_VIRISCSI_H -# define LIBVIRT_VIRISCSI_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 char * virISCSIGetSession(const char *devpath, @@ -68,5 +67,3 @@ virISCSINodeUpdate(const char *portal, const char *value) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK; - -#endif /* LIBVIRT_VIRISCSI_H */ diff --git a/src/util/virjson.h b/src/util/virjson.h index fa8329af26..41404a9a3e 100644 --- a/src/util/virjson.h +++ b/src/util/virjson.h @@ -20,15 +20,14 @@ * */ =20 -#ifndef LIBVIRT_VIRJSON_H -# define LIBVIRT_VIRJSON_H +#pragma once =20 -# include "internal.h" -# include "virbitmap.h" -# include "virbuffer.h" -# include "virautoclean.h" +#include "internal.h" +#include "virbitmap.h" +#include "virbuffer.h" +#include "virautoclean.h" =20 -# include +#include =20 =20 typedef enum { @@ -164,5 +163,3 @@ char *virJSONStringReformat(const char *jsonstr, bool p= retty); virJSONValuePtr virJSONValueObjectDeflatten(virJSONValuePtr json); =20 VIR_DEFINE_AUTOPTR_FUNC(virJSONValue, virJSONValueFree); - -#endif /* LIBVIRT_VIRJSON_H */ diff --git a/src/util/virkeycode.h b/src/util/virkeycode.h index 9e94d6f61e..b8d167ff14 100644 --- a/src/util/virkeycode.h +++ b/src/util/virkeycode.h @@ -19,16 +19,13 @@ * */ =20 -#ifndef LIBVIRT_VIRKEYCODE_H -# define LIBVIRT_VIRKEYCODE_H +#pragma once =20 -# include "virutil.h" -# include "virenum.h" +#include "virutil.h" +#include "virenum.h" =20 VIR_ENUM_DECL(virKeycodeSet); int virKeycodeValueFromString(virKeycodeSet codeset, const char *keyname); int virKeycodeValueTranslate(virKeycodeSet from_codeset, virKeycodeSet to_offset, int key_value); - -#endif /* LIBVIRT_VIRKEYCODE_H */ diff --git a/src/util/virkeyfile.h b/src/util/virkeyfile.h index ad82bd02d5..4cae4331fc 100644 --- a/src/util/virkeyfile.h +++ b/src/util/virkeyfile.h @@ -18,10 +18,9 @@ * . */ =20 -#ifndef LIBVIRT_VIRKEYFILE_H -# define LIBVIRT_VIRKEYFILE_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 /** * virKeyFilePtr: @@ -57,5 +56,3 @@ const char *virKeyFileGetValueString(virKeyFilePtr conf, const char *groupname, const char *valuename) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); - -#endif /* LIBVIRT_VIRKEYFILE_H */ diff --git a/src/util/virkmod.h b/src/util/virkmod.h index 059af4fd5f..f05cf83cf6 100644 --- a/src/util/virkmod.h +++ b/src/util/virkmod.h @@ -19,10 +19,9 @@ * */ =20 -#ifndef LIBVIRT_VIRKMOD_H -# define LIBVIRT_VIRKMOD_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 char *virKModConfig(void); char *virKModLoad(const char *, bool) @@ -31,4 +30,3 @@ char *virKModUnload(const char *) ATTRIBUTE_NONNULL(1); bool virKModIsBlacklisted(const char *) ATTRIBUTE_NONNULL(1); -#endif /* LIBVIRT_VIRKMOD_H */ diff --git a/src/util/virlease.h b/src/util/virlease.h index 9aa8095f83..98a3a5854d 100644 --- a/src/util/virlease.h +++ b/src/util/virlease.h @@ -20,10 +20,9 @@ * */ =20 -#ifndef LIBVIRT_VIRLEASE_H -# define LIBVIRT_VIRLEASE_H +#pragma once =20 -# include "virjson.h" +#include "virjson.h" =20 int virLeaseReadCustomLeaseFile(virJSONValuePtr leases_array_new, const char *custom_lease_file, @@ -41,5 +40,3 @@ int virLeaseNew(virJSONValuePtr *lease_ret, const char *hostname, const char *iaid, const char *server_duid); - -#endif /* LIBVIRT_VIRLEASE_H */ diff --git a/src/util/virlockspace.h b/src/util/virlockspace.h index 8e6b61d486..7f4833c35c 100644 --- a/src/util/virlockspace.h +++ b/src/util/virlockspace.h @@ -19,11 +19,10 @@ * */ =20 -#ifndef LIBVIRT_VIRLOCKSPACE_H -# define LIBVIRT_VIRLOCKSPACE_H +#pragma once =20 -# include "internal.h" -# include "virjson.h" +#include "internal.h" +#include "virjson.h" =20 typedef struct _virLockSpace virLockSpace; typedef virLockSpace *virLockSpacePtr; @@ -58,5 +57,3 @@ int virLockSpaceReleaseResource(virLockSpacePtr lockspace, =20 int virLockSpaceReleaseResourcesForOwner(virLockSpacePtr lockspace, pid_t owner); - -#endif /* LIBVIRT_VIRLOCKSPACE_H */ diff --git a/src/util/virmdev.h b/src/util/virmdev.h index 784cee5bce..fb125e7056 100644 --- a/src/util/virmdev.h +++ b/src/util/virmdev.h @@ -16,14 +16,13 @@ * . */ =20 -#ifndef LIBVIRT_VIRMDEV_H -# define LIBVIRT_VIRMDEV_H +#pragma once =20 -# include "internal.h" -# include "virobject.h" -# include "virutil.h" -# include "virautoclean.h" -# include "virenum.h" +#include "internal.h" +#include "virobject.h" +#include "virutil.h" +#include "virautoclean.h" +#include "virenum.h" =20 typedef enum { VIR_MDEV_MODEL_TYPE_VFIO_PCI =3D 0, @@ -140,5 +139,3 @@ virMediatedDeviceTypeReadAttrs(const char *sysfspath, =20 VIR_DEFINE_AUTOPTR_FUNC(virMediatedDevice, virMediatedDeviceFree); VIR_DEFINE_AUTOPTR_FUNC(virMediatedDeviceType, virMediatedDeviceTypeFree); - -#endif /* LIBVIRT_VIRMDEV_H */ diff --git a/src/util/virmodule.h b/src/util/virmodule.h index de9f8ec07e..ca59d837d6 100644 --- a/src/util/virmodule.h +++ b/src/util/virmodule.h @@ -19,11 +19,8 @@ * */ =20 -#ifndef LIBVIRT_VIRMODULE_H -# define LIBVIRT_VIRMODULE_H +#pragma once =20 int virModuleLoad(const char *path, const char *regfunc, bool required); - -#endif /* LIBVIRT_VIRMODULE_H */ diff --git a/src/util/virnodesuspend.h b/src/util/virnodesuspend.h index c3e600ff88..f767961bff 100644 --- a/src/util/virnodesuspend.h +++ b/src/util/virnodesuspend.h @@ -19,15 +19,12 @@ * */ =20 -#ifndef LIBVIRT_VIRNODESUSPEND_H -# define LIBVIRT_VIRNODESUSPEND_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 int virNodeSuspend(unsigned int target, unsigned long long duration, unsigned int flags); =20 int virNodeSuspendGetTargetMask(unsigned int *bitmask); - -#endif /* LIBVIRT_VIRNODESUSPEND_H */ diff --git a/src/util/virnuma.h b/src/util/virnuma.h index 8e95011dfa..3afccdf08f 100644 --- a/src/util/virnuma.h +++ b/src/util/virnuma.h @@ -19,12 +19,11 @@ * */ =20 -#ifndef LIBVIRT_VIRNUMA_H -# define LIBVIRT_VIRNUMA_H +#pragma once =20 -# include "internal.h" -# include "virbitmap.h" -# include "virutil.h" +#include "internal.h" +#include "virbitmap.h" +#include "virutil.h" =20 =20 char *virNumaGetAutoPlacementAdvice(unsigned short vcpus, @@ -66,4 +65,3 @@ int virNumaSetPagePoolSize(int node, unsigned int page_size, unsigned long long page_count, bool add); -#endif /* LIBVIRT_VIRNUMA_H */ diff --git a/src/util/virpci.h b/src/util/virpci.h index 664e141039..457be3c929 100644 --- a/src/util/virpci.h +++ b/src/util/virpci.h @@ -18,15 +18,14 @@ * . */ =20 -#ifndef LIBVIRT_VIRPCI_H -# define LIBVIRT_VIRPCI_H +#pragma once =20 -# include "internal.h" -# include "virmdev.h" -# include "virobject.h" -# include "virutil.h" -# include "virautoclean.h" -# include "virenum.h" +#include "internal.h" +#include "virmdev.h" +#include "virobject.h" +#include "virutil.h" +#include "virautoclean.h" +#include "virenum.h" =20 typedef struct _virPCIDevice virPCIDevice; typedef virPCIDevice *virPCIDevicePtr; @@ -35,8 +34,8 @@ typedef virPCIDeviceAddress *virPCIDeviceAddressPtr; typedef struct _virPCIDeviceList virPCIDeviceList; typedef virPCIDeviceList *virPCIDeviceListPtr; =20 -# define VIR_DOMAIN_DEVICE_ZPCI_MAX_UID UINT16_MAX -# define VIR_DOMAIN_DEVICE_ZPCI_MAX_FID UINT32_MAX +#define VIR_DOMAIN_DEVICE_ZPCI_MAX_UID UINT16_MAX +#define VIR_DOMAIN_DEVICE_ZPCI_MAX_FID UINT32_MAX =20 typedef struct _virZPCIDeviceAddress virZPCIDeviceAddress; typedef virZPCIDeviceAddress *virZPCIDeviceAddressPtr; @@ -275,5 +274,3 @@ void virPCIDeviceAddressFree(virPCIDeviceAddressPtr add= ress); VIR_DEFINE_AUTOPTR_FUNC(virPCIDevice, virPCIDeviceFree); VIR_DEFINE_AUTOPTR_FUNC(virPCIDeviceAddress, virPCIDeviceAddressFree); VIR_DEFINE_AUTOPTR_FUNC(virPCIEDeviceInfo, virPCIEDeviceInfoFree); - -#endif /* LIBVIRT_VIRPCI_H */ diff --git a/src/util/virperf.h b/src/util/virperf.h index e68baa527d..27d04b3ea4 100644 --- a/src/util/virperf.h +++ b/src/util/virperf.h @@ -16,12 +16,11 @@ * . */ =20 -#ifndef LIBVIRT_VIRPERF_H -# define LIBVIRT_VIRPERF_H +#pragma once =20 -# include "virutil.h" -# include "virautoclean.h" -# include "virenum.h" +#include "virutil.h" +#include "virautoclean.h" +#include "virenum.h" =20 /* Some Intel processor families introduced some RDT (Resource Director * Technology) features to monitor or control shared resource based on @@ -84,5 +83,3 @@ int virPerfReadEvent(virPerfPtr perf, uint64_t *value); =20 VIR_DEFINE_AUTOPTR_FUNC(virPerf, virPerfFree); - -#endif /* LIBVIRT_VIRPERF_H */ diff --git a/src/util/virpidfile.h b/src/util/virpidfile.h index 6ff55e7b02..a42b82ff1d 100644 --- a/src/util/virpidfile.h +++ b/src/util/virpidfile.h @@ -21,11 +21,10 @@ * */ =20 -#ifndef LIBVIRT_VIRPIDFILE_H -# define LIBVIRT_VIRPIDFILE_H +#pragma once =20 -# include -# include "internal.h" +#include +#include "internal.h" =20 char *virPidFileBuildPath(const char *dir, const char *name); @@ -75,5 +74,3 @@ int virPidFileConstructPath(bool privileged, char **pidfile); =20 int virPidFileForceCleanupPath(const char *path) ATTRIBUTE_NONNULL(1); - -#endif /* LIBVIRT_VIRPIDFILE_H */ diff --git a/src/util/virpolkit.h b/src/util/virpolkit.h index f234534015..8247be33d0 100644 --- a/src/util/virpolkit.h +++ b/src/util/virpolkit.h @@ -19,13 +19,12 @@ * */ =20 -#ifndef LIBVIRT_VIRPOLKIT_H -# define LIBVIRT_VIRPOLKIT_H +#pragma once =20 -# include "internal.h" -# include "vircommand.h" +#include "internal.h" +#include "vircommand.h" =20 -# define PKTTYAGENT "/usr/bin/pkttyagent" +#define PKTTYAGENT "/usr/bin/pkttyagent" =20 int virPolkitCheckAuth(const char *actionid, pid_t pid, @@ -39,5 +38,3 @@ typedef virPolkitAgent *virPolkitAgentPtr; =20 void virPolkitAgentDestroy(virPolkitAgentPtr cmd); virPolkitAgentPtr virPolkitAgentCreate(void); - -#endif /* LIBVIRT_VIRPOLKIT_H */ diff --git a/src/util/virportallocator.h b/src/util/virportallocator.h index 3144b7bf98..e86fd0e62b 100644 --- a/src/util/virportallocator.h +++ b/src/util/virportallocator.h @@ -19,11 +19,10 @@ * */ =20 -#ifndef LIBVIRT_VIRPORTALLOCATOR_H -# define LIBVIRT_VIRPORTALLOCATOR_H +#pragma once =20 -# include "internal.h" -# include "virobject.h" +#include "internal.h" +#include "virobject.h" =20 typedef struct _virPortAllocatorRange virPortAllocatorRange; typedef virPortAllocatorRange *virPortAllocatorRangePtr; @@ -41,5 +40,3 @@ int virPortAllocatorAcquire(const virPortAllocatorRange *= range, int virPortAllocatorRelease(unsigned short port); =20 int virPortAllocatorSetUsed(unsigned short port); - -#endif /* LIBVIRT_VIRPORTALLOCATOR_H */ diff --git a/src/util/virprocess.h b/src/util/virprocess.h index 8e5b0c2127..d7d191ec75 100644 --- a/src/util/virprocess.h +++ b/src/util/virprocess.h @@ -19,15 +19,14 @@ * */ =20 -#ifndef LIBVIRT_VIRPROCESS_H -# define LIBVIRT_VIRPROCESS_H +#pragma once =20 -# include +#include =20 -# include "internal.h" -# include "virbitmap.h" -# include "virutil.h" -# include "virenum.h" +#include "internal.h" +#include "virbitmap.h" +#include "virutil.h" +#include "virenum.h" =20 typedef enum { VIR_PROC_POLICY_NONE =3D 0, @@ -125,5 +124,3 @@ typedef enum { } virProcessNamespaceFlags; =20 int virProcessNamespaceAvailable(unsigned int ns); - -#endif /* LIBVIRT_VIRPROCESS_H */ diff --git a/src/util/virqemu.h b/src/util/virqemu.h index dc5497b6fd..227325e80e 100644 --- a/src/util/virqemu.h +++ b/src/util/virqemu.h @@ -20,13 +20,12 @@ * */ =20 -#ifndef LIBVIRT_VIRQEMU_H -# define LIBVIRT_VIRQEMU_H +#pragma once =20 -# include "internal.h" -# include "virbuffer.h" -# include "virjson.h" -# include "virstorageencryption.h" +#include "internal.h" +#include "virbuffer.h" +#include "virjson.h" +#include "virstorageencryption.h" =20 typedef int (*virQEMUBuildCommandLineJSONArrayFormatFunc)(const char *key, virJSONValuePtr = array, @@ -52,5 +51,3 @@ void virQEMUBuildQemuImgKeySecretOpts(virBufferPtr buf, virStorageEncryptionInfoDefPtr enc, const char *alias) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); - -#endif /* LIBVIRT_VIRQEMU_H */ diff --git a/src/util/virrandom.h b/src/util/virrandom.h index 55cd0971ae..c33932e8b3 100644 --- a/src/util/virrandom.h +++ b/src/util/virrandom.h @@ -16,10 +16,9 @@ * . */ =20 -#ifndef LIBVIRT_VIRRANDOM_H -# define LIBVIRT_VIRRANDOM_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 uint64_t virRandomBits(int nbits) ATTRIBUTE_NOINLINE; double virRandom(void); @@ -27,5 +26,3 @@ uint32_t virRandomInt(uint32_t max); int virRandomBytes(unsigned char *buf, size_t buflen) ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NOINLINE; int virRandomGenerateWWN(char **wwn, const char *virt_type) ATTRIBUTE_NOIN= LINE; - -#endif /* LIBVIRT_VIRRANDOM_H */ diff --git a/src/util/virresctrl.h b/src/util/virresctrl.h index abdeb594ee..e92f8e0ece 100644 --- a/src/util/virresctrl.h +++ b/src/util/virresctrl.h @@ -16,14 +16,13 @@ * . */ =20 -#ifndef LIBVIRT_VIRRESCTRL_H -# define LIBVIRT_VIRRESCTRL_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 -# include "virbitmap.h" -# include "virutil.h" -# include "virenum.h" +#include "virbitmap.h" +#include "virutil.h" +#include "virenum.h" =20 typedef enum { VIR_CACHE_TYPE_BOTH, @@ -235,4 +234,3 @@ virResctrlMonitorGetCacheOccupancy(virResctrlMonitorPtr= monitor, void virResctrlMonitorFreeStats(virResctrlMonitorStatsPtr *stats, size_t nstats); -#endif /* LIBVIRT_VIRRESCTRL_H */ diff --git a/src/util/virresctrlpriv.h b/src/util/virresctrlpriv.h index 5f04c0c12e..8aba32ab37 100644 --- a/src/util/virresctrlpriv.h +++ b/src/util/virresctrlpriv.h @@ -20,12 +20,9 @@ # error "virresctrlpriv.h may only be included by virresctrl.c or test sui= tes" #endif /* LIBVIRT_VIRRESCTRLPRIV_H_ALLOW */ =20 -#ifndef LIBVIRT_VIRRESCTRLPRIV_H -# define LIBVIRT_VIRRESCTRLPRIV_H +#pragma once =20 -# include "virresctrl.h" +#include "virresctrl.h" =20 virResctrlAllocPtr virResctrlAllocGetUnused(virResctrlInfoPtr resctrl); - -#endif /* LIBVIRT_VIRRESCTRLPRIV_H */ diff --git a/src/util/virrotatingfile.h b/src/util/virrotatingfile.h index 1dc48fb947..71fbe2c38c 100644 --- a/src/util/virrotatingfile.h +++ b/src/util/virrotatingfile.h @@ -19,10 +19,9 @@ * */ =20 -#ifndef LIBVIRT_VIRROTATINGFILE_H -# define LIBVIRT_VIRROTATINGFILE_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 typedef struct virRotatingFileWriter virRotatingFileWriter; typedef virRotatingFileWriter *virRotatingFileWriterPtr; @@ -58,5 +57,3 @@ ssize_t virRotatingFileReaderConsume(virRotatingFileReade= rPtr file, =20 void virRotatingFileWriterFree(virRotatingFileWriterPtr file); void virRotatingFileReaderFree(virRotatingFileReaderPtr file); - -#endif /* LIBVIRT_VIRROTATINGFILE_H */ diff --git a/src/util/virseclabel.h b/src/util/virseclabel.h index 4480def79e..4395a73240 100644 --- a/src/util/virseclabel.h +++ b/src/util/virseclabel.h @@ -19,8 +19,7 @@ * . */ =20 -#ifndef LIBVIRT_VIRSECLABEL_H -# define LIBVIRT_VIRSECLABEL_H +#pragma once =20 typedef enum { VIR_DOMAIN_SECLABEL_DEFAULT, @@ -67,5 +66,3 @@ virSecurityDeviceLabelDefCopy(const virSecurityDeviceLabe= lDef *src) =20 void virSecurityLabelDefFree(virSecurityLabelDefPtr def); void virSecurityDeviceLabelDefFree(virSecurityDeviceLabelDefPtr def); - -#endif /* LIBVIRT_VIRSECLABEL_H */ diff --git a/src/util/virsecret.h b/src/util/virsecret.h index aaeb204f7c..8bc8a24e0f 100644 --- a/src/util/virsecret.h +++ b/src/util/virsecret.h @@ -19,14 +19,13 @@ * */ =20 -#ifndef LIBVIRT_VIRSECRET_H -# define LIBVIRT_VIRSECRET_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 -# include "virutil.h" -# include "virxml.h" -# include "virenum.h" +#include "virutil.h" +#include "virxml.h" +#include "virenum.h" =20 VIR_ENUM_DECL(virSecretUsage); =20 @@ -57,4 +56,3 @@ int virSecretLookupParseSecret(xmlNodePtr secretnode, void virSecretLookupFormatSecret(virBufferPtr buf, const char *secrettype, virSecretLookupTypeDefPtr def); -#endif /* LIBVIRT_VIRSECRET_H */ diff --git a/src/util/virsexpr.h b/src/util/virsexpr.h index 4469207a75..d140659722 100644 --- a/src/util/virsexpr.h +++ b/src/util/virsexpr.h @@ -20,11 +20,10 @@ * */ =20 -#ifndef LIBVIRT_VIRSEXPR_H -# define LIBVIRT_VIRSEXPR_H +#pragma once =20 -# include "internal.h" -# include "virbuffer.h" +#include "internal.h" +#include "virbuffer.h" =20 enum sexpr_type { SEXPR_NIL, @@ -65,5 +64,3 @@ int sexpr_has(const struct sexpr *sexpr, const char *node= ); int sexpr_int(const struct sexpr *sexpr, const char *name); double sexpr_float(const struct sexpr *sexpr, const char *name); uint64_t sexpr_u64(const struct sexpr *sexpr, const char *name); - -#endif /* LIBVIRT_VIRSEXPR_H */ diff --git a/src/util/virsystemd.h b/src/util/virsystemd.h index 7d9c0ebd62..db4ecbff60 100644 --- a/src/util/virsystemd.h +++ b/src/util/virsystemd.h @@ -19,10 +19,9 @@ * */ =20 -#ifndef LIBVIRT_VIRSYSTEMD_H -# define LIBVIRT_VIRSYSTEMD_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 char *virSystemdMakeScopeName(const char *name, const char *drivername, @@ -50,5 +49,3 @@ int virSystemdCanHibernate(bool *result); int virSystemdCanHybridSleep(bool *result); =20 char *virSystemdGetMachineNameByPID(pid_t pid); - -#endif /* LIBVIRT_VIRSYSTEMD_H */ diff --git a/src/util/virsystemdpriv.h b/src/util/virsystemdpriv.h index be96f698f3..a49c91e649 100644 --- a/src/util/virsystemdpriv.h +++ b/src/util/virsystemdpriv.h @@ -23,11 +23,8 @@ # error "virsystemdpriv.h may only be included by virsystemd.c or test sui= tes" #endif /* LIBVIRT_VIRSYSTEMDPRIV_H_ALLOW */ =20 -#ifndef LIBVIRT_VIRSYSTEMDPRIV_H -# define LIBVIRT_VIRSYSTEMDPRIV_H +#pragma once =20 -# include "virsystemd.h" +#include "virsystemd.h" =20 void virSystemdHasMachinedResetCachedValue(void); - -#endif /* LIBVIRT_VIRSYSTEMDPRIV_H */ diff --git a/src/util/virtime.h b/src/util/virtime.h index 01f6b0c7fa..b8ea38e291 100644 --- a/src/util/virtime.h +++ b/src/util/virtime.h @@ -18,12 +18,11 @@ * . */ =20 -#ifndef LIBVIRT_VIRTIME_H -# define LIBVIRT_VIRTIME_H +#pragma once =20 -# include +#include =20 -# include "internal.h" +#include "internal.h" =20 /* The format string we intend to use is: * @@ -31,7 +30,7 @@ * %4d-%02d-%02d %02d:%02d:%02d.%03d+0000 * */ -# define VIR_TIME_STRING_BUFLEN \ +#define VIR_TIME_STRING_BUFLEN \ (4 + 1 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1 + 3 + 5 + 1) /* Yr Mon Day Hour Min Sec Ms TZ NULL */ =20 @@ -72,5 +71,3 @@ int virTimeBackOffStart(virTimeBackOffVar *var, unsigned long long first, unsigned long long timeo= ut); =20 bool virTimeBackOffWait(virTimeBackOffVar *var); - -#endif /* LIBVIRT_VIRTIME_H */ diff --git a/src/util/virtpm.h b/src/util/virtpm.h index 796b9c088c..4408bdb217 100644 --- a/src/util/virtpm.h +++ b/src/util/virtpm.h @@ -18,9 +18,6 @@ * . */ =20 -#ifndef LIBVIRT_VIRTPM_H -# define LIBVIRT_VIRTPM_H +#pragma once =20 char *virTPMCreateCancelPath(const char *devpath) ATTRIBUTE_NOINLINE; - -#endif /* LIBVIRT_VIRTPM_H */ diff --git a/src/util/virtypedparam.h b/src/util/virtypedparam.h index 112f2a2af9..ce4e75b389 100644 --- a/src/util/virtypedparam.h +++ b/src/util/virtypedparam.h @@ -19,12 +19,11 @@ * */ =20 -#ifndef LIBVIRT_VIRTYPEDPARAM_H -# define LIBVIRT_VIRTYPEDPARAM_H +#pragma once =20 -# include "internal.h" -# include "virutil.h" -# include "virenum.h" +#include "internal.h" +#include "virutil.h" +#include "virenum.h" =20 /** * VIR_TYPED_PARAM_MULTIPLE: @@ -32,7 +31,7 @@ * Flag indicating that the params has multiple occurrences of the paramet= er. * Only used as a flag for @type argument of the virTypedParamsValidate. */ -# define VIR_TYPED_PARAM_MULTIPLE (1U << 31) +#define VIR_TYPED_PARAM_MULTIPLE (1U << 31) =20 verify(!(VIR_TYPED_PARAM_LAST & VIR_TYPED_PARAM_MULTIPLE)); =20 @@ -120,7 +119,7 @@ int virTypedParamsSerialize(virTypedParameterPtr params, =20 VIR_ENUM_DECL(virTypedParameter); =20 -# define VIR_TYPED_PARAMS_DEBUG(params, nparams) \ +#define VIR_TYPED_PARAMS_DEBUG(params, nparams) \ do { \ int _i; \ if (!params) \ @@ -134,5 +133,3 @@ VIR_ENUM_DECL(virTypedParameter); VIR_FREE(_value); \ } \ } while (0) - -#endif /* LIBVIRT_VIRTYPEDPARAM_H */ diff --git a/src/util/viruri.h b/src/util/viruri.h index f5b472860e..e988582bbe 100644 --- a/src/util/viruri.h +++ b/src/util/viruri.h @@ -18,14 +18,13 @@ * . */ =20 -#ifndef LIBVIRT_VIRURI_H -# define LIBVIRT_VIRURI_H +#pragma once =20 -# include +#include =20 -# include "internal.h" -# include "virconf.h" -# include "virautoclean.h" +#include "internal.h" +#include "virconf.h" +#include "virautoclean.h" =20 typedef struct _virURI virURI; typedef virURI *virURIPtr; @@ -64,6 +63,4 @@ void virURIFree(virURIPtr uri); VIR_DEFINE_AUTOPTR_FUNC(virURI, virURIFree); int virURIResolveAlias(virConfPtr conf, const char *alias, char **uri); =20 -# define VIR_URI_SERVER(uri) ((uri) && (uri)->server ? (uri)->server : "lo= calhost") - -#endif /* LIBVIRT_VIRURI_H */ +#define VIR_URI_SERVER(uri) ((uri) && (uri)->server ? (uri)->server : "loc= alhost") diff --git a/src/util/virusb.h b/src/util/virusb.h index 6d61a2555a..c95514ed3d 100644 --- a/src/util/virusb.h +++ b/src/util/virusb.h @@ -18,14 +18,13 @@ * . */ =20 -#ifndef LIBVIRT_VIRUSB_H -# define LIBVIRT_VIRUSB_H +#pragma once =20 -# include "internal.h" -# include "virobject.h" -# include "virautoclean.h" +#include "internal.h" +#include "virobject.h" +#include "virautoclean.h" =20 -# define USB_DEVFS "/dev/bus/usb/" +#define USB_DEVFS "/dev/bus/usb/" =20 typedef struct _virUSBDevice virUSBDevice; typedef virUSBDevice *virUSBDevicePtr; @@ -97,5 +96,3 @@ virUSBDevicePtr virUSBDeviceListFind(virUSBDeviceListPtr = list, virUSBDevicePtr dev); =20 VIR_DEFINE_AUTOPTR_FUNC(virUSBDevice, virUSBDeviceFree); - -#endif /* LIBVIRT_VIRUSB_H */ diff --git a/src/util/virutil.h b/src/util/virutil.h index ded9b039e5..67a21c86bd 100644 --- a/src/util/virutil.h +++ b/src/util/virutil.h @@ -20,19 +20,18 @@ * . */ =20 -#ifndef LIBVIRT_VIRUTIL_H -# define LIBVIRT_VIRUTIL_H +#pragma once =20 -# include "internal.h" -# include -# include +#include "internal.h" +#include +#include =20 -# ifndef MIN -# define MIN(a, b) ((a) < (b) ? (a) : (b)) -# endif -# ifndef MAX -# define MAX(a, b) ((a) > (b) ? (a) : (b)) -# endif +#ifndef MIN +# define MIN(a, b) ((a) < (b) ? (a) : (b)) +#endif +#ifndef MAX +# define MAX(a, b) ((a) > (b) ? (a) : (b)) +#endif =20 =20 int virSetBlocking(int fd, bool blocking) ATTRIBUTE_RETURN_CHECK; @@ -69,28 +68,28 @@ int virDiskNameToIndex(const char* str); char *virIndexToDiskName(int idx, const char *prefix); =20 /* No-op workarounds for functionality missing in mingw. */ -# ifndef HAVE_GETUID +#ifndef HAVE_GETUID static inline int getuid(void) { return 0; } -# endif +#endif =20 -# ifndef HAVE_GETEUID +#ifndef HAVE_GETEUID static inline int geteuid(void) { return 0; } -# endif +#endif =20 -# ifndef HAVE_GETGID +#ifndef HAVE_GETGID static inline int getgid(void) { return 0; } -# endif +#endif =20 -# ifndef HAVE_GETEGID +#ifndef HAVE_GETEGID static inline int getegid(void) { return 0; } -# endif +#endif =20 -# ifdef FUNC_PTHREAD_SIGMASK_BROKEN -# undef pthread_sigmask +#ifdef FUNC_PTHREAD_SIGMASK_BROKEN +# undef pthread_sigmask static inline int pthread_sigmask(int how, const void *set, void *old) @@ -100,7 +99,7 @@ static inline int pthread_sigmask(int how, (void) old; return 0; } -# endif +#endif =20 char *virGetHostname(void); char *virGetHostnameQuiet(void); @@ -172,7 +171,5 @@ char *virHostGetDRMRenderNode(void) ATTRIBUTE_NOINLINE; * This macro assigns @lvalue to @rvalue and evaluates as true if the valu= e of * @rvalue did not fit into the @lvalue. */ -# define VIR_ASSIGN_IS_OVERFLOW(lvalue, rvalue) \ +#define VIR_ASSIGN_IS_OVERFLOW(lvalue, rvalue) \ (((lvalue) =3D (rvalue)) !=3D (rvalue)) - -#endif /* LIBVIRT_VIRUTIL_H */ diff --git a/src/util/viruuid.h b/src/util/viruuid.h index 70223b3bb2..b709c182ff 100644 --- a/src/util/viruuid.h +++ b/src/util/viruuid.h @@ -18,10 +18,9 @@ * . */ =20 -#ifndef LIBVIRT_VIRUUID_H -# define LIBVIRT_VIRUUID_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 =20 /** @@ -29,7 +28,7 @@ * @conn: connection * @uuid: possibly null UUID array */ -# define VIR_UUID_DEBUG(conn, uuid) \ +#define VIR_UUID_DEBUG(conn, uuid) \ do { \ if (uuid) { \ char _uuidstr[VIR_UUID_STRING_BUFLEN]; \ @@ -54,5 +53,3 @@ int virUUIDParse(const char *uuidstr, =20 const char *virUUIDFormat(const unsigned char *uuid, char *uuidstr) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NO= NNULL(2); - -#endif /* LIBVIRT_VIRUUID_H */ diff --git a/src/util/virvhba.h b/src/util/virvhba.h index 4d15833e85..1aecbf2b00 100644 --- a/src/util/virvhba.h +++ b/src/util/virvhba.h @@ -16,10 +16,9 @@ * . */ =20 -#ifndef LIBVIRT_VIRVHBA_H -# define LIBVIRT_VIRVHBA_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 enum { VPORT_CREATE, @@ -58,5 +57,3 @@ char * virVHBAGetHostByFabricWWN(const char *sysfs_prefix, const char *fabric_wwn) ATTRIBUTE_NONNULL(2); - -#endif /* LIBVIRT_VIRVHBA_H */ diff --git a/src/util/virvsock.h b/src/util/virvsock.h index 268e121916..d6ba2faabf 100644 --- a/src/util/virvsock.h +++ b/src/util/virvsock.h @@ -16,8 +16,7 @@ * . */ =20 -#ifndef LIBVIRT_VIRVSOCK_H -# define LIBVIRT_VIRVSOCK_H +#pragma once =20 int virVsockSetGuestCid(int fd, @@ -26,4 +25,3 @@ virVsockSetGuestCid(int fd, int virVsockAcquireGuestCid(int fd, unsigned int *guest_cid); -#endif /* LIBVIRT_VIRVSOCK_H */ diff --git a/src/util/virxdrdefs.h b/src/util/virxdrdefs.h index 794606638d..264d02e7cd 100644 --- a/src/util/virxdrdefs.h +++ b/src/util/virxdrdefs.h @@ -18,26 +18,23 @@ * . */ =20 -#ifndef LIBVIRT_VIRXDRDEFS_H -# define LIBVIRT_VIRXDRDEFS_H +#pragma once =20 /* cygwin's xdr implementation defines xdr_u_int64_t instead of xdr_uint64= _t * and lacks IXDR_PUT_INT32 and IXDR_GET_INT32 */ -# ifdef HAVE_XDR_U_INT64_T -# define xdr_uint64_t xdr_u_int64_t -# endif -# ifndef IXDR_PUT_INT32 -# define IXDR_PUT_INT32 IXDR_PUT_LONG -# endif -# ifndef IXDR_GET_INT32 -# define IXDR_GET_INT32 IXDR_GET_LONG -# endif -# ifndef IXDR_PUT_U_INT32 -# define IXDR_PUT_U_INT32 IXDR_PUT_U_LONG -# endif -# ifndef IXDR_GET_U_INT32 -# define IXDR_GET_U_INT32 IXDR_GET_U_LONG -# endif - -#endif /* LIBVIRT_VIRXDRDEFS_H */ +#ifdef HAVE_XDR_U_INT64_T +# define xdr_uint64_t xdr_u_int64_t +#endif +#ifndef IXDR_PUT_INT32 +# define IXDR_PUT_INT32 IXDR_PUT_LONG +#endif +#ifndef IXDR_GET_INT32 +# define IXDR_GET_INT32 IXDR_GET_LONG +#endif +#ifndef IXDR_PUT_U_INT32 +# define IXDR_PUT_U_INT32 IXDR_PUT_U_LONG +#endif +#ifndef IXDR_GET_U_INT32 +# define IXDR_GET_U_INT32 IXDR_GET_U_LONG +#endif --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560876148; cv=none; d=zoho.com; s=zohoarc; b=VJrZfHJJvqIKPuZYoj1i08hoYUo+e/GIJ28S6pVNW+bA0E4+li8lj9Z4tr8wLNk58rTzOEBKv2d2rxMKLUwZYQCHa2sCpDW5EvgyyHaDI/9y1dj5OEO24I/mo7Om85A1cN7VgOo2knLENBFV+mUjnk7o+m2o3h4kmRJUGRbjix8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560876148; 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=/e7/4uZQbQLHmpnVLT/yc0F1r1xoWGawsntcknJspas=; b=TBxQlMRWVob+OjDuZKfdpvcotlcQDBU7fxMOSa9hNRs39xof2qyaoTDK2xLRforeobhTs0TLL89NWbxYmg86shX2j9eqA8ajvGrSpxeuKnoTXRoovJAVPbddVOWK1YRhJHdIHIiay1xX8jrWc9nUy2bQ5y8yuiwStaZqlFqbyts= 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 156087614837699.12410917195689; Tue, 18 Jun 2019 09:42:28 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id D4F523097052; Tue, 18 Jun 2019 16:42:24 +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 A9C6817985; Tue, 18 Jun 2019 16:42:24 +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 5FD39206D2; Tue, 18 Jun 2019 16:42:24 +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 x5IGDbVX024396 for ; Tue, 18 Jun 2019 12:13:37 -0400 Received: by smtp.corp.redhat.com (Postfix) id 54E6C84EF; Tue, 18 Jun 2019 16:13:37 +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 2280760FAB for ; Tue, 18 Jun 2019 16:13:37 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:13:09 -0500 Message-Id: <20190618161316.1722-40-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 39/46] src/vbox: 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.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Tue, 18 Jun 2019 16:42:25 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/vbox/vbox_MSCOMGlue.h | 11 +-- src/vbox/vbox_common.h | 161 +++++++++++++++++----------------- src/vbox/vbox_driver.h | 19 ++-- src/vbox/vbox_get_driver.h | 7 +- src/vbox/vbox_glue.h | 15 ++-- src/vbox/vbox_snapshot_conf.h | 9 +- src/vbox/vbox_uniformed_api.h | 11 +-- 7 files changed, 106 insertions(+), 127 deletions(-) diff --git a/src/vbox/vbox_MSCOMGlue.h b/src/vbox/vbox_MSCOMGlue.h index dd42f03148..3f778b2990 100644 --- a/src/vbox/vbox_MSCOMGlue.h +++ b/src/vbox/vbox_MSCOMGlue.h @@ -19,10 +19,9 @@ * */ =20 -#ifndef LIBVIRT_VBOX_MSCOMGLUE_H -# define LIBVIRT_VBOX_MSCOMGLUE_H +#pragma once =20 -# include "vbox_CAPI_v3_2.h" +#include "vbox_CAPI_v3_2.h" =20 extern PFNVBOXGETXPCOMCFUNCTIONS g_pfnGetFunctions; =20 @@ -37,12 +36,10 @@ struct _vboxArray { void *handle; }; =20 -# define VBOX_ARRAY_INITIALIZER { NULL, 0, NULL } +#define VBOX_ARRAY_INITIALIZER { NULL, 0, NULL } =20 nsresult vboxArrayGet(vboxArray *array, void *self, void *getter); nsresult vboxArrayGetWithPtrArg(vboxArray *array, void *self, void *getter= , void *arg); nsresult vboxArrayGetWithUintArg(vboxArray *array, void *self, void *gette= r, PRUint32 arg); void vboxArrayRelease(vboxArray *array); -# define vboxArrayUnalloc vboxArrayRelease - -#endif /* LIBVIRT_VBOX_MSCOMGLUE_H */ +#define vboxArrayUnalloc vboxArrayRelease diff --git a/src/vbox/vbox_common.h b/src/vbox/vbox_common.h index f3b9afad8f..f3294334d8 100644 --- a/src/vbox/vbox_common.h +++ b/src/vbox/vbox_common.h @@ -17,16 +17,15 @@ * . */ =20 -#ifndef LIBVIRT_VBOX_COMMON_H -# define LIBVIRT_VBOX_COMMON_H +#pragma once =20 -# ifdef ___VirtualBox_CXPCOM_h -# error this file should not be included after vbox_CAPI_v*.h -# endif +#ifdef ___VirtualBox_CXPCOM_h +# error this file should not be included after vbox_CAPI_v*.h +#endif =20 -# include "internal.h" -# include -# include "wchar.h" +#include "internal.h" +#include +#include "wchar.h" =20 /* This file extracts some symbols defined in * vbox_CAPI_v*.h. It tells the vbox_common.c @@ -42,34 +41,34 @@ * We must MAKE SURE these codes are compatible. */ =20 typedef unsigned char PRUint8; -# if (defined(HPUX) && defined(__cplusplus) \ +#if (defined(HPUX) && defined(__cplusplus) \ && !defined(__GNUC__) && __cplusplus < 199707L) \ || (defined(SCO) && defined(__cplusplus) \ && !defined(__GNUC__) && __cplusplus =3D=3D 1L) typedef char PRInt8; -# else +#else typedef signed char PRInt8; -# endif +#endif =20 -# define PR_INT8_MAX 127 -# define PR_INT8_MIN (-128) -# define PR_UINT8_MAX 255U +#define PR_INT8_MAX 127 +#define PR_INT8_MIN (-128) +#define PR_UINT8_MAX 255U =20 typedef unsigned short PRUint16; typedef short PRInt16; =20 -# define PR_INT16_MAX 32767 -# define PR_INT16_MIN (-32768) -# define PR_UINT16_MAX 65535U +#define PR_INT16_MAX 32767 +#define PR_INT16_MIN (-32768) +#define PR_UINT16_MAX 65535U =20 typedef unsigned int PRUint32; typedef int PRInt32; -# define PR_INT32(x) x -# define PR_UINT32(x) x ## U +#define PR_INT32(x) x +#define PR_UINT32(x) x ## U =20 -# define PR_INT32_MAX PR_INT32(2147483647) -# define PR_INT32_MIN (-PR_INT32_MAX - 1) -# define PR_UINT32_MAX PR_UINT32(4294967295) +#define PR_INT32_MAX PR_INT32(2147483647) +#define PR_INT32_MIN (-PR_INT32_MAX - 1) +#define PR_UINT32_MAX PR_UINT32(4294967295) =20 typedef long PRInt64; typedef unsigned long PRUint64; @@ -85,8 +84,8 @@ typedef unsigned long PRUptrdiff; =20 typedef PRIntn PRBool; =20 -# define PR_TRUE 1 -# define PR_FALSE 0 +#define PR_TRUE 1 +#define PR_FALSE 0 =20 typedef PRUint8 PRPackedBool; =20 @@ -96,31 +95,31 @@ typedef PRUint8 PRPackedBool; */ typedef enum { PR_FAILURE =3D -1, PR_SUCCESS =3D 0 } PRStatus; =20 -# ifndef __PRUNICHAR__ -# define __PRUNICHAR__ -# if defined(WIN32) || defined(XP_MAC) +#ifndef __PRUNICHAR__ +# define __PRUNICHAR__ +# if defined(WIN32) || defined(XP_MAC) typedef wchar_t PRUnichar; -# else +# else typedef PRUint16 PRUnichar; -# endif # endif +#endif =20 typedef long PRWord; typedef unsigned long PRUword; =20 -# define nsnull 0 +#define nsnull 0 typedef PRUint32 nsresult; =20 -# if defined(__GNUC__) && (__GNUC__ > 2) -# define NS_LIKELY(x) (__builtin_expect((x), 1)) -# define NS_UNLIKELY(x) (__builtin_expect((x), 0)) -# else -# define NS_LIKELY(x) (x) -# define NS_UNLIKELY(x) (x) -# endif +#if defined(__GNUC__) && (__GNUC__ > 2) +# define NS_LIKELY(x) (__builtin_expect((x), 1)) +# define NS_UNLIKELY(x) (__builtin_expect((x), 0)) +#else +# define NS_LIKELY(x) (x) +# define NS_UNLIKELY(x) (x) +#endif =20 -# define NS_FAILED(_nsresult) (NS_UNLIKELY((_nsresult) & 0x80000000)) -# define NS_SUCCEEDED(_nsresult) (NS_LIKELY(!((_nsresult) & 0x80000000))) +#define NS_FAILED(_nsresult) (NS_UNLIKELY((_nsresult) & 0x80000000)) +#define NS_SUCCEEDED(_nsresult) (NS_LIKELY(!((_nsresult) & 0x80000000))) =20 /** * An "interface id" which can be used to uniquely identify a given @@ -140,24 +139,24 @@ typedef nsID nsIID; =20 typedef struct _vboxArray vboxArray; =20 -# ifdef WIN32 +#ifdef WIN32 =20 struct _vboxArray { void **items; size_t count; void *handle; }; -# define VBOX_ARRAY_INITIALIZER { NULL, 0, NULL } +# define VBOX_ARRAY_INITIALIZER { NULL, 0, NULL } =20 -# else /* !WIN32 */ +#else /* !WIN32 */ =20 struct _vboxArray { void **items; size_t count; }; -# define VBOX_ARRAY_INITIALIZER { NULL, 0 } +# define VBOX_ARRAY_INITIALIZER { NULL, 0 } =20 -# endif /* !WIN32 */ +#endif /* !WIN32 */ =20 /* We make the assumption that these enum flags * are compatible in all vbox API version. @@ -313,26 +312,26 @@ enum HardDiskVariant HardDiskVariant_Diff =3D 0x20000 }; =20 -# define VBOX_E_OBJECT_NOT_FOUND 0x80BB0001 -# define VBOX_E_INVALID_VM_STATE 0x80BB0002 -# define VBOX_E_VM_ERROR 0x80BB0003 -# define VBOX_E_FILE_ERROR 0x80BB0004 -# define VBOX_E_IPRT_ERROR 0x80BB0005 -# define VBOX_E_PDM_ERROR 0x80BB0006 -# define VBOX_E_INVALID_OBJECT_STATE 0x80BB0007 -# define VBOX_E_HOST_ERROR 0x80BB0008 -# define VBOX_E_NOT_SUPPORTED 0x80BB0009 -# define VBOX_E_XML_ERROR 0x80BB000A -# define VBOX_E_INVALID_SESSION_STATE 0x80BB000B -# define VBOX_E_OBJECT_IN_USE 0x80BB000C +#define VBOX_E_OBJECT_NOT_FOUND 0x80BB0001 +#define VBOX_E_INVALID_VM_STATE 0x80BB0002 +#define VBOX_E_VM_ERROR 0x80BB0003 +#define VBOX_E_FILE_ERROR 0x80BB0004 +#define VBOX_E_IPRT_ERROR 0x80BB0005 +#define VBOX_E_PDM_ERROR 0x80BB0006 +#define VBOX_E_INVALID_OBJECT_STATE 0x80BB0007 +#define VBOX_E_HOST_ERROR 0x80BB0008 +#define VBOX_E_NOT_SUPPORTED 0x80BB0009 +#define VBOX_E_XML_ERROR 0x80BB000A +#define VBOX_E_INVALID_SESSION_STATE 0x80BB000B +#define VBOX_E_OBJECT_IN_USE 0x80BB000C =20 /* VBOX storage controller name definitions */ =20 -# define VBOX_CONTROLLER_IDE_NAME "IDE Controller" -# define VBOX_CONTROLLER_FLOPPY_NAME "Floppy Controller" -# define VBOX_CONTROLLER_SATA_NAME "SATA Controller" -# define VBOX_CONTROLLER_SCSI_NAME "SCSI Controller" -# define VBOX_CONTROLLER_SAS_NAME "SAS Controller" +#define VBOX_CONTROLLER_IDE_NAME "IDE Controller" +#define VBOX_CONTROLLER_FLOPPY_NAME "Floppy Controller" +#define VBOX_CONTROLLER_SATA_NAME "SATA Controller" +#define VBOX_CONTROLLER_SCSI_NAME "SCSI Controller" +#define VBOX_CONTROLLER_SAS_NAME "SAS Controller" =20 /* Simplied definitions in vbox_CAPI_*.h */ =20 @@ -365,10 +364,10 @@ typedef nsISupports IKeyboard; =20 /* Macros for all vbox drivers. */ =20 -# define RC_SUCCEEDED(rc) NS_SUCCEEDED(rc.resultCode) -# define RC_FAILED(rc) NS_FAILED(rc.resultCode) +#define RC_SUCCEEDED(rc) NS_SUCCEEDED(rc.resultCode) +#define RC_FAILED(rc) NS_FAILED(rc.resultCode) =20 -# define VBOX_UTF16_FREE(arg) \ +#define VBOX_UTF16_FREE(arg) \ do { \ if (arg) { \ gVBoxAPI.UPFN.Utf16Free(data->pFuncs, arg); \ @@ -376,7 +375,7 @@ typedef nsISupports IKeyboard; } \ } while (0) =20 -# define VBOX_UTF8_FREE(arg) \ +#define VBOX_UTF8_FREE(arg) \ do { \ if (arg) { \ gVBoxAPI.UPFN.Utf8Free(data->pFuncs, arg); \ @@ -384,7 +383,7 @@ typedef nsISupports IKeyboard; } \ } while (0) =20 -# define VBOX_COM_UNALLOC_MEM(arg) \ +#define VBOX_COM_UNALLOC_MEM(arg) \ do { \ if (arg) { \ gVBoxAPI.UPFN.ComUnallocMem(data->pFuncs, arg); \ @@ -392,12 +391,12 @@ typedef nsISupports IKeyboard; } \ } while (0) =20 -# define VBOX_UTF16_TO_UTF8(arg1, arg2) gVBoxAPI.UPFN.Utf16ToUtf8(data->p= Funcs, arg1, arg2) -# define VBOX_UTF8_TO_UTF16(arg1, arg2) gVBoxAPI.UPFN.Utf8ToUtf16(data->p= Funcs, arg1, arg2) +#define VBOX_UTF16_TO_UTF8(arg1, arg2) gVBoxAPI.UPFN.Utf16ToUtf8(data->pF= uncs, arg1, arg2) +#define VBOX_UTF8_TO_UTF16(arg1, arg2) gVBoxAPI.UPFN.Utf8ToUtf16(data->pF= uncs, arg1, arg2) =20 -# define VBOX_ADDREF(arg) gVBoxAPI.nsUISupports.AddRef((voi= d *)(arg)) +#define VBOX_ADDREF(arg) gVBoxAPI.nsUISupports.AddRef((void= *)(arg)) =20 -# define VBOX_RELEASE(arg) \ +#define VBOX_RELEASE(arg) \ do { \ if (arg) { \ gVBoxAPI.nsUISupports.Release((void *)arg); \ @@ -405,7 +404,7 @@ typedef nsISupports IKeyboard; } \ } while (0) =20 -# define VBOX_MEDIUM_RELEASE(arg) \ +#define VBOX_MEDIUM_RELEASE(arg) \ do { \ if (arg) { \ gVBoxAPI.UIMedium.Release(arg); \ @@ -413,21 +412,21 @@ typedef nsISupports IKeyboard; } \ } while (0) =20 -# define vboxIIDUnalloc(iid) gVBoxAPI.UIID.vboxIIDUnal= loc(data, iid) -# define vboxIIDToUUID(iid, uuid) gVBoxAPI.UIID.vboxIIDToUU= ID(data, iid, uuid) -# define vboxIIDFromUUID(iid, uuid) gVBoxAPI.UIID.vboxIIDFrom= UUID(data, iid, uuid) -# define vboxIIDIsEqual(iid1, iid2) gVBoxAPI.UIID.vboxIIDIsEq= ual(data, iid1, iid2) -# define DEBUGIID(msg, iid) gVBoxAPI.UIID.DEBUGIID(da= ta, msg, iid) -# define vboxIIDFromArrayItem(iid, array, idx) \ +#define vboxIIDUnalloc(iid) gVBoxAPI.UIID.vboxIIDUnall= oc(data, iid) +#define vboxIIDToUUID(iid, uuid) gVBoxAPI.UIID.vboxIIDToUUI= D(data, iid, uuid) +#define vboxIIDFromUUID(iid, uuid) gVBoxAPI.UIID.vboxIIDFromU= UID(data, iid, uuid) +#define vboxIIDIsEqual(iid1, iid2) gVBoxAPI.UIID.vboxIIDIsEqu= al(data, iid1, iid2) +#define DEBUGIID(msg, iid) gVBoxAPI.UIID.DEBUGIID(dat= a, msg, iid) +#define vboxIIDFromArrayItem(iid, array, idx) \ gVBoxAPI.UIID.vboxIIDFromArrayItem(data, iid, array, idx) =20 -# define VBOX_IID_INITIALIZE(iid) gVBoxAPI.UIID.vboxIIDInit= ialize(iid) +#define VBOX_IID_INITIALIZE(iid) gVBoxAPI.UIID.vboxIIDIniti= alize(iid) =20 -# define ARRAY_GET_MACHINES \ +#define ARRAY_GET_MACHINES \ (gVBoxAPI.UArray.handleGetMachines(data->vboxObj)) =20 /* Set result to -1 in case of failure. */ -# define installUniformedAPI(gVBoxAPI, result) \ +#define installUniformedAPI(gVBoxAPI, result) \ do { \ result =3D 0; \ if (uVersion >=3D 5000000 && uVersion < 5000051) { \ @@ -440,5 +439,3 @@ typedef nsISupports IKeyboard; result =3D -1; \ } \ } while (0) - -#endif /* LIBVIRT_VBOX_COMMON_H */ diff --git a/src/vbox/vbox_driver.h b/src/vbox/vbox_driver.h index fa30c4a3f5..bcbdf12bc9 100644 --- a/src/vbox/vbox_driver.h +++ b/src/vbox/vbox_driver.h @@ -22,21 +22,18 @@ * additional information or have any questions. */ =20 -#ifndef LIBVIRT_VBOX_DRIVER_H -# define LIBVIRT_VBOX_DRIVER_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 -# if defined(VBOX_NETWORK_DRIVER) +#if defined(VBOX_NETWORK_DRIVER) int vboxNetworkRegister(void); -# endif +#endif =20 -# if defined(VBOX_STORAGE_DRIVER) +#if defined(VBOX_STORAGE_DRIVER) int vboxStorageRegister(void); -# endif +#endif =20 -# if defined(VBOX_DRIVER) +#if defined(VBOX_DRIVER) int vboxRegister(void); -# endif - -#endif /* LIBVIRT_VBOX_DRIVER_H */ +#endif diff --git a/src/vbox/vbox_get_driver.h b/src/vbox/vbox_get_driver.h index 08e39ad157..bcfac252d0 100644 --- a/src/vbox/vbox_get_driver.h +++ b/src/vbox/vbox_get_driver.h @@ -16,13 +16,10 @@ * . */ =20 -#ifndef LIBVIRT_VBOX_GET_DRIVER_H -# define LIBVIRT_VBOX_GET_DRIVER_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 virHypervisorDriverPtr vboxGetHypervisorDriver(uint32_t uVersion); virNetworkDriverPtr vboxGetNetworkDriver(uint32_t uVersion); virStorageDriverPtr vboxGetStorageDriver(uint32_t uVersion); - -#endif /* LIBVIRT_VBOX_GET_DRIVER_H */ diff --git a/src/vbox/vbox_glue.h b/src/vbox/vbox_glue.h index 39281e0d78..deb1aa76d3 100644 --- a/src/vbox/vbox_glue.h +++ b/src/vbox/vbox_glue.h @@ -19,13 +19,10 @@ * */ =20 -#ifndef LIBVIRT_VBOX_GLUE_H -# define LIBVIRT_VBOX_GLUE_H +#pragma once =20 -# ifdef WIN32 -# include "vbox_MSCOMGlue.h" -# else -# include "vbox_XPCOMCGlue.h" -# endif - -#endif /* LIBVIRT_VBOX_GLUE_H */ +#ifdef WIN32 +# include "vbox_MSCOMGlue.h" +#else +# include "vbox_XPCOMCGlue.h" +#endif diff --git a/src/vbox/vbox_snapshot_conf.h b/src/vbox/vbox_snapshot_conf.h index 72b90e698f..3394d7dcbc 100644 --- a/src/vbox/vbox_snapshot_conf.h +++ b/src/vbox/vbox_snapshot_conf.h @@ -16,12 +16,11 @@ * . */ =20 -#ifndef LIBVIRT_VBOX_SNAPSHOT_CONF_H -# define LIBVIRT_VBOX_SNAPSHOT_CONF_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 -# define VBOX_UUID_REGEX "([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}= -[a-f0-9]{12})" +#define VBOX_UUID_REGEX "([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-= [a-f0-9]{12})" =20 /*Stores VirtualBox xml hard disk information A hard disk can have a parent and children*/ @@ -137,5 +136,3 @@ virVBoxSnapshotConfHardDiskPtrByLocation(virVBoxSnapsho= tConfMachinePtr machine, virVBoxSnapshotConfSnapshotPtr virVBoxSnapshotConfSnapshotByName(virVBoxSnapshotConfSnapshotPtr snapshot, const char *snapshotName); - -#endif /* LIBVIRT_VBOX_SNAPSHOT_CONF_H */ diff --git a/src/vbox/vbox_uniformed_api.h b/src/vbox/vbox_uniformed_api.h index 64dddefab9..ca307e30b1 100644 --- a/src/vbox/vbox_uniformed_api.h +++ b/src/vbox/vbox_uniformed_api.h @@ -16,10 +16,9 @@ * . */ =20 -#ifndef LIBVIRT_VBOX_UNIFORMED_API_H -# define LIBVIRT_VBOX_UNIFORMED_API_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 /* This file may be used in three place. That is vbox_tmpl.c, * vbox_common.c and vbox_driver.c. The vboxUniformedAPI and some @@ -85,9 +84,9 @@ struct _vboxDriver { PCVBOXXPCOM pFuncs; IVirtualBox *vboxObj; ISession *vboxSession; -# ifdef VBOX_API_VERSION +#ifdef VBOX_API_VERSION IVirtualBoxClient *vboxClient; -# endif +#endif =20 unsigned long version; =20 @@ -559,5 +558,3 @@ virDomainPtr vboxDomainLookupByUUID(virConnectPtr conn, void vbox50InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI); void vbox51InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI); void vbox52InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI); - -#endif /* LIBVIRT_VBOX_UNIFORMED_API_H */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560874610; cv=none; d=zoho.com; s=zohoarc; b=ITaDZD3UhlwGEDhPHdk4XJFfZ9fl95UxaVx3AI0XtR61g/4oC2B4B+gG5pt4rwqaAJhP2vF1fD7v9s74JlhX9FbihRYgk7/mRv2n9EyarwLeZBp+s6GN8WwSMzv+d3i1HT9oaVJYw+m9/S6ZmEqMX9F/ASxeX+fDArbLJdkaPc4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560874610; 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=mu+5ACmfpsFzMOlY0hQGyj5DUiM3Hgov3N3suozkaWo=; b=hSrvO38cwd83R6dgp/8XjH2q7kyu2qH/kRuJ5RZ4x3DsC/Evtj0tj1HJRCy1+20MY7NvEdCk11ttKLiOaE4ds+GJ7KQ8xvhwbAqSrBtxlu/jNd9aqNMCuXIqDvAzR50l9ZAYiQGxeYep1j3Wzi3NWPVyTapFIpFzdGOKRY7WV5A= 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 1560874610216484.17011075968605; Tue, 18 Jun 2019 09:16:50 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 8B218A4540; Tue, 18 Jun 2019 16:16:48 +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 3DE8E5F7C1; Tue, 18 Jun 2019 16:16: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 E35671806B1D; Tue, 18 Jun 2019 16:16:47 +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 x5IGDbkt024404 for ; Tue, 18 Jun 2019 12:13:37 -0400 Received: by smtp.corp.redhat.com (Postfix) id A5C0C60FAB; Tue, 18 Jun 2019 16:13:37 +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 743188518 for ; Tue, 18 Jun 2019 16:13:37 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:13:10 -0500 Message-Id: <20190618161316.1722-41-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 40/46] src/vmware: 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.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 18 Jun 2019 16:16:49 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/vmware/vmware_conf.h | 19 ++++++++----------- src/vmware/vmware_driver.h | 5 +---- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/vmware/vmware_conf.h b/src/vmware/vmware_conf.h index 93b424ef2f..deeed22300 100644 --- a/src/vmware/vmware_conf.h +++ b/src/vmware/vmware_conf.h @@ -18,18 +18,17 @@ * . */ =20 -#ifndef LIBVIRT_VMWARE_CONF_H -# define LIBVIRT_VMWARE_CONF_H +#pragma once =20 -# define NOGUI "nogui" +#define NOGUI "nogui" =20 -# include "internal.h" -# include "virdomainobjlist.h" -# include "virthread.h" -# include "virenum.h" +#include "internal.h" +#include "virdomainobjlist.h" +#include "virthread.h" +#include "virenum.h" =20 -# define VIR_FROM_THIS VIR_FROM_VMWARE -# define PROGRAM_SENTINEL ((char *)0x1) +#define VIR_FROM_THIS VIR_FROM_VMWARE +#define PROGRAM_SENTINEL ((char *)0x1) =20 enum vmwareDriverType { VMWARE_DRIVER_PLAYER =3D 0, /* VMware Player */ @@ -85,5 +84,3 @@ int vmwareMakePath(char *srcDir, char *srcName, char *src= Ext, int vmwareExtractPid(const char * vmxPath); =20 char *vmwareCopyVMXFileName(const char *datastorePath, void *opaque); - -#endif /* LIBVIRT_VMWARE_CONF_H */ diff --git a/src/vmware/vmware_driver.h b/src/vmware/vmware_driver.h index e66d222a51..1b28db5977 100644 --- a/src/vmware/vmware_driver.h +++ b/src/vmware/vmware_driver.h @@ -16,9 +16,6 @@ * . */ =20 -#ifndef LIBVIRT_VMWARE_DRIVER_H -# define LIBVIRT_VMWARE_DRIVER_H +#pragma once =20 int vmwareRegister(void); - -#endif /* LIBVIRT_VMWARE_DRIVER_H */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560874613; cv=none; d=zoho.com; s=zohoarc; b=DX+tc1SQL/tap48hr0OzNfShdJfH5Op6+iMPJA9UcuuiYQKGMXeUKH5EwgydnsQfflX9+hYUVV75f4CzJKn0Lbhysohikw28yckbpusGl93yAqlGgY5O5/5Dtah/m7WUS/05DuCJnAxU76Zr57wmnqJtjkzb6AJLpvyPExJz3gw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560874613; 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=xmf1uH3VAzcOGiICN+iJNDChUkScgraI1YlegXR3J40=; b=TO50DMpp1eyxW+msEr63Sn3qeK8yWLsL/NN13JpIpRnIdbzCBTtjMZ2bOr+d0c1Y3H/rfViJkbD/4a7L6nrJj9OqMV51bvV4kTV/gg2yEtOV5zxn8fBbFMcu9Jahgw09MV1nsu8dy47hSc7AEXh6MHZcLH4/Wmp0yT9M9PrETZA= 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 1560874613440130.27728963074355; Tue, 18 Jun 2019 09:16:53 -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 CECDB308794D; Tue, 18 Jun 2019 16:16:51 +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 AA53A57AF; Tue, 18 Jun 2019 16:16:51 +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 71CAE206D7; Tue, 18 Jun 2019 16:16:51 +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 x5IGDcBm024414 for ; Tue, 18 Jun 2019 12:13:38 -0400 Received: by smtp.corp.redhat.com (Postfix) id 018F284EF; Tue, 18 Jun 2019 16:13:38 +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 C45BD60FAB for ; Tue, 18 Jun 2019 16:13:37 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:13:11 -0500 Message-Id: <20190618161316.1722-42-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 41/46] src/vmx: 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.45]); Tue, 18 Jun 2019 16:16:52 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/vmx/vmx.h | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/vmx/vmx.h b/src/vmx/vmx.h index 8c068b4cb2..18478ac0ae 100644 --- a/src/vmx/vmx.h +++ b/src/vmx/vmx.h @@ -19,14 +19,13 @@ * */ =20 -#ifndef LIBVIRT_VMX_H -# define LIBVIRT_VMX_H +#pragma once =20 -# include "internal.h" -# include "virconf.h" -# include "domain_conf.h" +#include "internal.h" +#include "virconf.h" +#include "domain_conf.h" =20 -# define VMX_CONFIG_FORMAT_ARGV "vmware-vmx" +#define VMX_CONFIG_FORMAT_ARGV "vmware-vmx" =20 typedef struct _virVMXContext virVMXContext; =20 @@ -66,15 +65,15 @@ struct _virVMXContext { =20 char *virVMXEscapeHex(const char *string, char escape, const char *special= ); =20 -# define virVMXEscapeHexPipe(_string) virVMXEscapeHex(_string, '|', "\"") +#define virVMXEscapeHexPipe(_string) virVMXEscapeHex(_string, '|', "\"") =20 -# define virVMXEscapeHexPercent(_string) virVMXEscapeHex(_string, '%', "/\= \") +#define virVMXEscapeHexPercent(_string) virVMXEscapeHex(_string, '%', "/\\= ") =20 int virVMXUnescapeHex(char *string, char escape); =20 -# define virVMXUnescapeHexPipe(_string) virVMXUnescapeHex(_string, '|') +#define virVMXUnescapeHexPipe(_string) virVMXUnescapeHex(_string, '|') =20 -# define virVMXUnescapeHexPercent(_string) virVMXUnescapeHex(_string, '%') +#define virVMXUnescapeHexPercent(_string) virVMXUnescapeHex(_string, '%') =20 char *virVMXConvertToUTF8(const char *encoding, const char *string); =20 @@ -141,5 +140,3 @@ int virVMXFormatParallel(virVMXContext *ctx, virDomainC= hrDefPtr def, virBufferPtr buffer); =20 int virVMXFormatSVGA(virDomainVideoDefPtr def, virBufferPtr buffer); - -#endif /* LIBVIRT_VMX_H */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560874627; cv=none; d=zoho.com; s=zohoarc; b=dyaDg3e/zuB/szwHOZwiZnwnDfxvJlzAiSkp/wpBnfU9rplDCSoTj+JXttfcqh7bY6CqZR3qie5x0tFx/yLxd2aqrpFhg9PK6wvFjCmjWUabm2/b1ku+VzKxvFjBpz9vBtynv9ZcY13sa4nPRxgD8XKxMGGNd1wPDFQoTAK+F+U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560874627; 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=bwAPJY6ATqJDjWaCJX3yav9hwba06638KWIzrQrFasY=; b=gzxilYj48RLRH9aFpabX00Lme0R2AJ7ugJfnwtFd75drKEIflQPguTMgIcb+DoG3Stv0eTQPGfU0UI6IL7HjxIP4NNY1ghtzpDIE/Zd4Y39lyyy8SnXFzVroHcAONVsWCs00sa43Ehm5YryDeZntr/+T6yZeKyzRnS01/vgi2mM= 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 1560874627390297.11461758213227; Tue, 18 Jun 2019 09:17:07 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id B6A443086233; Tue, 18 Jun 2019 16:17:00 +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 90AF05C22B; Tue, 18 Jun 2019 16:17:00 +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 57B351806B1C; Tue, 18 Jun 2019 16:16:59 +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 x5IGDcE4024419 for ; Tue, 18 Jun 2019 12:13:38 -0400 Received: by smtp.corp.redhat.com (Postfix) id 55B0984EF; Tue, 18 Jun 2019 16:13:38 +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 212AF8518 for ; Tue, 18 Jun 2019 16:13:38 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:13:12 -0500 Message-Id: <20190618161316.1722-43-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 42/46] src/vz: 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.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Tue, 18 Jun 2019 16:17:06 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/vz/vz_driver.h | 5 +---- src/vz/vz_sdk.h | 9 +++------ src/vz/vz_utils.h | 37 +++++++++++++++++-------------------- 3 files changed, 21 insertions(+), 30 deletions(-) diff --git a/src/vz/vz_driver.h b/src/vz/vz_driver.h index 593a585075..ce75b11c04 100644 --- a/src/vz/vz_driver.h +++ b/src/vz/vz_driver.h @@ -20,9 +20,6 @@ * */ =20 -#ifndef LIBVIRT_VZ_DRIVER_H -# define LIBVIRT_VZ_DRIVER_H +#pragma once =20 int vzRegister(void); - -#endif /* LIBVIRT_VZ_DRIVER_H */ diff --git a/src/vz/vz_sdk.h b/src/vz/vz_sdk.h index e412b821bb..5acee2ca9d 100644 --- a/src/vz/vz_sdk.h +++ b/src/vz/vz_sdk.h @@ -20,12 +20,11 @@ * */ =20 -#ifndef LIBVIRT_VZ_SDK_H -# define LIBVIRT_VZ_SDK_H +#pragma once =20 -# include +#include =20 -# include "vz_utils.h" +#include "vz_utils.h" =20 int prlsdkInit(void); void prlsdkDeinit(void); @@ -94,5 +93,3 @@ PRL_HANDLE prlsdkSdkDomainLookupByName(vzDriverPtr driver, const char *name); int prlsdkCancelJob(virDomainObjPtr dom); int prlsdkResizeImage(virDomainObjPtr dom, virDomainDiskDefPtr disk, unsig= ned long long newsize); - -#endif /* LIBVIRT_VZ_SDK_H */ diff --git a/src/vz/vz_utils.h b/src/vz/vz_utils.h index fb289ed4a7..d9e3ebc30a 100644 --- a/src/vz/vz_utils.h +++ b/src/vz/vz_utils.h @@ -20,27 +20,26 @@ * */ =20 -#ifndef LIBVIRT_VZ_UTILS_H -# define LIBVIRT_VZ_UTILS_H +#pragma once =20 -# include +#include =20 -# include "driver.h" -# include "conf/domain_conf.h" -# include "conf/snapshot_conf.h" -# include "conf/virdomainsnapshotobjlist.h" -# include "conf/virdomainobjlist.h" -# include "conf/domain_event.h" -# include "virthread.h" -# include "datatypes.h" +#include "driver.h" +#include "conf/domain_conf.h" +#include "conf/snapshot_conf.h" +#include "conf/virdomainsnapshotobjlist.h" +#include "conf/virdomainobjlist.h" +#include "conf/domain_event.h" +#include "virthread.h" +#include "datatypes.h" =20 -# define vzParseError() \ +#define vzParseError() \ virReportErrorHelper(VIR_FROM_TEST, VIR_ERR_OPERATION_FAILED, __FILE__= , \ __FUNCTION__, __LINE__, _("Can't parse prlctl out= put")) =20 -# define IS_CT(def) (def->os.type =3D=3D VIR_DOMAIN_OSTYPE_EXE) +#define IS_CT(def) (def->os.type =3D=3D VIR_DOMAIN_OSTYPE_EXE) =20 -# define vzDomNotFoundError(domain) \ +#define vzDomNotFoundError(domain) \ do { \ char uuidstr[VIR_UUID_STRING_BUFLEN]; \ virUUIDFormat(domain->uuid, uuidstr); \ @@ -48,8 +47,8 @@ _("no domain with matching uuid '%s'"), uuidstr); \ } while (0) =20 -# define PARALLELS_DOMAIN_ROUTED_NETWORK_NAME "host-routed" -# define VIRTUOZZO_VER_7 ((unsigned long)7000000) +#define PARALLELS_DOMAIN_ROUTED_NETWORK_NAME "host-routed" +#define VIRTUOZZO_VER_7 ((unsigned long)7000000) =20 struct _vzCapabilities { virStorageFileFormat vmDiskFormat; @@ -62,7 +61,7 @@ typedef struct _vzCapabilities vzCapabilities; typedef struct _vzCapabilities *vzCapabilitiesPtr; =20 /* +2 to keep enclosing { and } */ -# define VIR_UUID_STRING_BRACED_BUFLEN (VIR_UUID_STRING_BUFLEN + 2) +#define VIR_UUID_STRING_BRACED_BUFLEN (VIR_UUID_STRING_BUFLEN + 2) =20 struct _vzDriver { virObjectLockable parent; @@ -146,7 +145,7 @@ vzGetDefaultSCSIModel(vzDriverPtr driver, =20 int vzCheckUnsupportedGraphics(virDomainGraphicsDefPtr gr); =20 -# define PARALLELS_BLOCK_STATS_FOREACH(OP) \ + define PARALLELS_BLOCK_STATS_FOREACH(OP) \ OP(rd_req, VIR_DOMAIN_BLOCK_STATS_READ_REQ, "read_requests") \ OP(rd_bytes, VIR_DOMAIN_BLOCK_STATS_READ_BYTES, "read_total") \ OP(wr_req, VIR_DOMAIN_BLOCK_STATS_WRITE_REQ, "write_requests") \ @@ -158,5 +157,3 @@ void vzDomainObjEndJob(virDomainObjPtr dom); int vzDomainJobUpdateTime(vzDomainJobObjPtr job); - -#endif /* LIBVIRT_VZ_UTILS_H */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560876156; cv=none; d=zoho.com; s=zohoarc; b=oIfmioRWTKQ1/IcxB+XwcAP7z0zqcmtQXb1ii/q4cWH07SDmolj81uxIEc3787UT0aazyaE7h9s+SXMGrOGeUr6Vgw4kIx/lgWlYi+WKg9itfnocbfhq3RtLqil4dGkix+BDbxrI33/5+RwPgGiOyZhIcs5tDnOF/j4T5ZRcNdY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560876156; 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=swhVrAzMMEk7ngVlXZzbp0m9OMExbdnaAZYq7pvWA3U=; b=XSpFHPTEJTQVMk6ylVhyCJrdhQq2SVlej5dfM+KB0vFkVO+d6GN+4K/oOZ9RfGYZDH0og+Nyc+687Cl9jLpbVzf88/DKZLnqAUO8aI+fb1wamPOXJ4uwLLaNK1AIN2jQq3ribKfqHFdEJVKX8lY1o3K8cNi0DjHwOuCY9AvA/Sk= 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 15608761566681013.8492136564896; Tue, 18 Jun 2019 09:42:36 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 1D5447DD03; Tue, 18 Jun 2019 16:42:35 +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 ECC0917B80; Tue, 18 Jun 2019 16:42:34 +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 B2D78206D7; Tue, 18 Jun 2019 16:42:34 +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 x5IGDfSN024451 for ; Tue, 18 Jun 2019 12:13:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id E24AC84EF; Tue, 18 Jun 2019 16:13:41 +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 A130360FAB for ; Tue, 18 Jun 2019 16:13:38 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:13:13 -0500 Message-Id: <20190618161316.1722-44-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 43/46] xen: 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.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 18 Jun 2019 16:42:35 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- src/xenapi/xenapi_driver.h | 5 +---- src/xenapi/xenapi_driver_private.h | 17 +++++++---------- src/xenapi/xenapi_utils.h | 15 ++++++--------- src/xenconfig/xen_common.h | 17 +++++++---------- src/xenconfig/xen_sxpr.h | 13 +++++-------- src/xenconfig/xen_xl.h | 11 ++++------- src/xenconfig/xen_xm.h | 9 ++++----- src/xenconfig/xenxs_private.h | 29 +++++++++++++---------------- 8 files changed, 47 insertions(+), 69 deletions(-) diff --git a/src/xenapi/xenapi_driver.h b/src/xenapi/xenapi_driver.h index 85bbe06776..f126dcbed6 100644 --- a/src/xenapi/xenapi_driver.h +++ b/src/xenapi/xenapi_driver.h @@ -17,9 +17,6 @@ * . */ =20 -#ifndef LIBVIRT_XENAPI_DRIVER_H -# define LIBVIRT_XENAPI_DRIVER_H +#pragma once =20 int xenapiRegister(void); - -#endif /* LIBVIRT_XENAPI_DRIVER_H */ diff --git a/src/xenapi/xenapi_driver_private.h b/src/xenapi/xenapi_driver_= private.h index 590a96f532..276bc7c516 100644 --- a/src/xenapi/xenapi_driver_private.h +++ b/src/xenapi/xenapi_driver_private.h @@ -17,17 +17,16 @@ * . */ =20 -#ifndef LIBVIRT_XENAPI_DRIVER_PRIVATE_H -# define LIBVIRT_XENAPI_DRIVER_PRIVATE_H +#pragma once =20 -# include -# include -# include "virerror.h" +#include +#include +#include "virerror.h" =20 /*# define PRINT_XML*/ -# define VIR_FROM_THIS VIR_FROM_XENAPI -# define LIBVIRT_MODELNAME_LEN (32) -# define xenapiSessionErrorHandler(conn, errNum, buf) \ +#define VIR_FROM_THIS VIR_FROM_XENAPI +#define LIBVIRT_MODELNAME_LEN (32) +#define xenapiSessionErrorHandler(conn, errNum, buf) \ xenapiSessionErrorHandle(conn, errNum, buf, \ __FILE__, __FUNCTION__, __LINE__) =20 @@ -57,5 +56,3 @@ struct _xenapiPrivate { virCapsPtr caps; virDomainXMLOptionPtr xmlopt; }; - -#endif /* LIBVIRT_XENAPI_DRIVER_PRIVATE_H */ diff --git a/src/xenapi/xenapi_utils.h b/src/xenapi/xenapi_utils.h index 70a0e5fc13..e394197bfd 100644 --- a/src/xenapi/xenapi_utils.h +++ b/src/xenapi/xenapi_utils.h @@ -18,15 +18,14 @@ * . */ =20 -#ifndef LIBVIRT_XENAPI_UTILS_H -# define LIBVIRT_XENAPI_UTILS_H +#pragma once =20 -# include -# include "internal.h" -# include "viruri.h" -# include "domain_conf.h" +#include +#include "internal.h" +#include "viruri.h" +#include "domain_conf.h" =20 -# define NETWORK_DEVID_SIZE (12) +#define NETWORK_DEVID_SIZE (12) =20 typedef uint64_t cpumap_t; =20 @@ -75,5 +74,3 @@ createVMRecordFromXml (virConnectPtr conn, virDomainDefPt= r defPtr, =20 int allocStringMap (xen_string_string_map **strings, char *key, char *val); - -#endif /* LIBVIRT_XENAPI_UTILS_H */ diff --git a/src/xenconfig/xen_common.h b/src/xenconfig/xen_common.h index b22d18aa67..231fa0d078 100644 --- a/src/xenconfig/xen_common.h +++ b/src/xenconfig/xen_common.h @@ -18,16 +18,15 @@ * . */ =20 -#ifndef LIBVIRT_XEN_COMMON_H -# define LIBVIRT_XEN_COMMON_H +#pragma once =20 -# include "internal.h" -# include "virconf.h" -# include "domain_conf.h" +#include "internal.h" +#include "virconf.h" +#include "domain_conf.h" =20 -# define XEN_CONFIG_FORMAT_XL "xen-xl" -# define XEN_CONFIG_FORMAT_XM "xen-xm" -# define XEN_CONFIG_FORMAT_SEXPR "xen-sxpr" +#define XEN_CONFIG_FORMAT_XL "xen-xl" +#define XEN_CONFIG_FORMAT_XM "xen-xm" +#define XEN_CONFIG_FORMAT_SEXPR "xen-sxpr" =20 int xenConfigGetString(virConfPtr conf, const char *name, @@ -68,5 +67,3 @@ int xenFormatConfigCommon(virConfPtr conf, char *xenMakeIPList(virNetDevIPInfoPtr guestIP); =20 int xenDomainDefAddImplicitInputDevice(virDomainDefPtr def); - -#endif /* LIBVIRT_XEN_COMMON_H */ diff --git a/src/xenconfig/xen_sxpr.h b/src/xenconfig/xen_sxpr.h index 0cec2a4068..019657380c 100644 --- a/src/xenconfig/xen_sxpr.h +++ b/src/xenconfig/xen_sxpr.h @@ -20,13 +20,12 @@ * . */ =20 -#ifndef LIBVIRT_XEN_SXPR_H -# define LIBVIRT_XEN_SXPR_H +#pragma once =20 -# include "internal.h" -# include "virconf.h" -# include "domain_conf.h" -# include "virsexpr.h" +#include "internal.h" +#include "virconf.h" +#include "domain_conf.h" +#include "virsexpr.h" =20 /* helper functions to get the dom id from a sexpr */ int xenGetDomIdFromSxprString(const char *sexpr, int *id); @@ -65,5 +64,3 @@ int xenFormatSxprChr(virDomainChrDefPtr def, virBufferPtr= buf); int xenFormatSxprSound(virDomainDefPtr def, virBufferPtr buf); =20 char * xenFormatSxpr(virConnectPtr conn, virDomainDefPtr def); - -#endif /* LIBVIRT_XEN_SXPR_H */ diff --git a/src/xenconfig/xen_xl.h b/src/xenconfig/xen_xl.h index e347ad274f..24f6470283 100644 --- a/src/xenconfig/xen_xl.h +++ b/src/xenconfig/xen_xl.h @@ -20,12 +20,11 @@ * */ =20 -#ifndef LIBVIRT_XEN_XL_H -# define LIBVIRT_XEN_XL_H +#pragma once =20 -# include "virconf.h" -# include "domain_conf.h" -# include "xen_common.h" +#include "virconf.h" +#include "domain_conf.h" +#include "xen_common.h" =20 virDomainDefPtr xenParseXL(virConfPtr conn, virCapsPtr caps, @@ -34,5 +33,3 @@ virDomainDefPtr xenParseXL(virConfPtr conn, virConfPtr xenFormatXL(virDomainDefPtr def, virConnectPtr); =20 const char *xenTranslateCPUFeature(const char *feature_name, bool from_lib= xl); - -#endif /* LIBVIRT_XEN_XL_H */ diff --git a/src/xenconfig/xen_xm.h b/src/xenconfig/xen_xm.h index b0a73fc09b..a2cc6715b4 100644 --- a/src/xenconfig/xen_xm.h +++ b/src/xenconfig/xen_xm.h @@ -20,12 +20,11 @@ * . */ =20 -#ifndef LIBVIRT_XEN_XM_H -# define LIBVIRT_XEN_XM_H +#pragma once =20 -# include "internal.h" -# include "virconf.h" -# include "domain_conf.h" +#include "internal.h" +#include "virconf.h" +#include "domain_conf.h" =20 virConfPtr xenFormatXM(virConnectPtr conn, virDomainDefPtr def); =20 diff --git a/src/xenconfig/xenxs_private.h b/src/xenconfig/xenxs_private.h index 7cba0bff86..79909aba2f 100644 --- a/src/xenconfig/xenxs_private.h +++ b/src/xenconfig/xenxs_private.h @@ -19,28 +19,25 @@ * . */ =20 -#ifndef LIBVIRT_XENXS_PRIVATE_H -# define LIBVIRT_XENXS_PRIVATE_H +#pragma once =20 -# include "internal.h" +#include "internal.h" =20 -# include -# include "xen_sxpr.h" +#include +#include "xen_sxpr.h" =20 /* xen-unstable changeset 19788 removed MAX_VIRT_CPUS from public * headers. Its semantic was retained with XEN_LEGACY_MAX_VCPUS. * Ensure MAX_VIRT_CPUS is defined accordingly. */ -# if !defined(MAX_VIRT_CPUS) && defined(XEN_LEGACY_MAX_VCPUS) -# define MAX_VIRT_CPUS XEN_LEGACY_MAX_VCPUS -# endif +#if !defined(MAX_VIRT_CPUS) && defined(XEN_LEGACY_MAX_VCPUS) +# define MAX_VIRT_CPUS XEN_LEGACY_MAX_VCPUS +#endif =20 -# define MIN_XEN_GUEST_SIZE 64 /* 64 megabytes */ +#define MIN_XEN_GUEST_SIZE 64 /* 64 megabytes */ =20 -# ifdef __sun -# define DEFAULT_VIF_SCRIPT "vif-vnic" -# else -# define DEFAULT_VIF_SCRIPT "vif-bridge" -# endif - -#endif /* LIBVIRT_XENXS_PRIVATE_H */ +#ifdef __sun +# define DEFAULT_VIF_SCRIPT "vif-vnic" +#else +# define DEFAULT_VIF_SCRIPT "vif-bridge" +#endif --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560876162; cv=none; d=zoho.com; s=zohoarc; b=laHO4wbpFY7nQmUaSY4XGwul0WBSY+sas9XHL0c7SQPn77+x3YcpLWNp4L4i/XAe2VyTNPqPv4F5Cqv7Ek56wSf5mT/G4uz3fNBRt7JGsBu/seKOcieeocBlnoD+pnFh6a9Tf1R6FIBXJiDPGZX3ICUBOsSeNXO2llzD0DKYOjo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560876162; 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=Pzj+GJJSKxBLFsxNH/DeyUK5aD/Pa3+4USETnNWt+mc=; b=UGbsnbVVyhg4VthGS8tk9/i3BbfVEMmNcx40SH91PHK18icdwqHNi/0raX5ZwMcdNehLs7Aeb81H6tbJFHyaznPP2sLBObMSMBtcbiPw+PcfTE6bbYartfFlFVyyb0rPOUCICQuZKxTNrqcRVppbPAe3rhMFXVKHpcj+5Zs+R8o= 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 1560876162551809.3502891535901; Tue, 18 Jun 2019 09:42:42 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C18833162918; Tue, 18 Jun 2019 16:42: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 93E2B60566; Tue, 18 Jun 2019 16:42: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 5B93A1806B18; Tue, 18 Jun 2019 16:42:40 +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 x5IGDgIL024457 for ; Tue, 18 Jun 2019 12:13:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 446D760FAB; Tue, 18 Jun 2019 16:13:42 +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 0E27A84EF for ; Tue, 18 Jun 2019 16:13:41 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:13:14 -0500 Message-Id: <20190618161316.1722-45-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 44/46] tests: 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.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Tue, 18 Jun 2019 16:42:41 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- tests/qemumonitortestutils.h | 19 +++--- tests/qemusecuritytest.h | 7 +- tests/testutils.h | 45 ++++++------ tests/testutilshostcpus.h | 11 ++- tests/testutilslxc.h | 11 ++- tests/testutilsqemu.h | 21 +++--- tests/testutilsqemuschema.h | 11 ++- tests/testutilsxen.h | 13 ++-- tests/virfilewrapper.h | 5 +- tests/virhashdata.h | 5 +- tests/virmock.h | 129 +++++++++++++++++------------------ tests/virnettlshelpers.h | 17 ++--- 12 files changed, 129 insertions(+), 165 deletions(-) diff --git a/tests/qemumonitortestutils.h b/tests/qemumonitortestutils.h index 3e93f9551a..75ea63382d 100644 --- a/tests/qemumonitortestutils.h +++ b/tests/qemumonitortestutils.h @@ -17,14 +17,13 @@ * */ =20 -#ifndef LIBVIRT_QEMUMONITORTESTUTILS_H -# define LIBVIRT_QEMUMONITORTESTUTILS_H +#pragma once =20 -# include "domain_conf.h" -# include "qemu/qemu_conf.h" -# include "qemu/qemu_monitor.h" -# include "qemu/qemu_agent.h" -# include "virautoclean.h" +#include "domain_conf.h" +#include "qemu/qemu_conf.h" +#include "qemu/qemu_monitor.h" +#include "qemu/qemu_agent.h" +#include "virautoclean.h" =20 typedef struct _qemuMonitorTest qemuMonitorTest; typedef qemuMonitorTest *qemuMonitorTestPtr; @@ -74,9 +73,9 @@ int qemuMonitorTestAddItemExpect(qemuMonitorTestPtr test, bool apostrophe, const char *response); =20 -# define qemuMonitorTestNewSimple(xmlopt) \ +#define qemuMonitorTestNewSimple(xmlopt) \ qemuMonitorTestNew(xmlopt, NULL, NULL, NULL, NULL) -# define qemuMonitorTestNewSchema(xmlopt, schema) \ +#define qemuMonitorTestNewSchema(xmlopt, schema) \ qemuMonitorTestNew(xmlopt, NULL, NULL, NULL, schema) =20 qemuMonitorTestPtr qemuMonitorTestNew(virDomainXMLOptionPtr xmlopt, @@ -103,5 +102,3 @@ qemuAgentPtr qemuMonitorTestGetAgent(qemuMonitorTestPtr= test); virDomainObjPtr qemuMonitorTestGetDomainObj(qemuMonitorTestPtr test); =20 VIR_DEFINE_AUTOPTR_FUNC(qemuMonitorTest, qemuMonitorTestFree); - -#endif /* LIBVIRT_QEMUMONITORTESTUTILS_H */ diff --git a/tests/qemusecuritytest.h b/tests/qemusecuritytest.h index a26014b5dc..f166eac3ac 100644 --- a/tests/qemusecuritytest.h +++ b/tests/qemusecuritytest.h @@ -16,11 +16,8 @@ * . */ =20 -#ifndef LIBVIRT_QEMUSECURITYTEST_H -# define LIBVIRT_QEMUSECURITYTEST_H +#pragma once =20 -# define ENVVAR "LIBVIRT_QEMU_SECURITY_TEST" +#define ENVVAR "LIBVIRT_QEMU_SECURITY_TEST" =20 extern int checkPaths(void); - -#endif /* LIBVIRT_QEMUSECURITYTEST_H */ diff --git a/tests/testutils.h b/tests/testutils.h index d0a259e2d4..8c12fd7c12 100644 --- a/tests/testutils.h +++ b/tests/testutils.h @@ -18,31 +18,30 @@ * . */ =20 -#ifndef LIBVIRT_TESTUTILS_H -# define LIBVIRT_TESTUTILS_H +#pragma once =20 -# include "viralloc.h" -# include "virfile.h" -# include "virstring.h" -# include "virjson.h" -# include "capabilities.h" -# include "domain_conf.h" +#include "viralloc.h" +#include "virfile.h" +#include "virstring.h" +#include "virjson.h" +#include "capabilities.h" +#include "domain_conf.h" =20 -# define EXIT_AM_SKIP 77 /* tell Automake we're skipping a test */ -# define EXIT_AM_HARDFAIL 99 /* tell Automake that the framework is broken= */ +#define EXIT_AM_SKIP 77 /* tell Automake we're skipping a test */ +#define EXIT_AM_HARDFAIL 99 /* tell Automake that the framework is broken = */ =20 /* Work around lack of gnulib support for fprintf %z */ -# ifndef NO_LIBVIRT -# undef fprintf -# define fprintf virFilePrintf -# endif +#ifndef NO_LIBVIRT +# undef fprintf +# define fprintf virFilePrintf +#endif =20 extern char *progname; =20 /* Makefile.am provides these two definitions */ -# if !defined(abs_srcdir) || !defined(abs_builddir) -# error Fix Makefile.am -# endif +#if !defined(abs_srcdir) || !defined(abs_builddir) +# error Fix Makefile.am +#endif =20 bool virTestOOMActive(void); =20 @@ -88,13 +87,13 @@ unsigned int virTestGetVerbose(void); unsigned int virTestGetExpensive(void); unsigned int virTestGetRegenerate(void); =20 -# define VIR_TEST_DEBUG(...) \ +#define VIR_TEST_DEBUG(...) \ do { \ if (virTestGetDebug()) \ fprintf(stderr, __VA_ARGS__); \ } while (0) =20 -# define VIR_TEST_VERBOSE(...) \ +#define VIR_TEST_VERBOSE(...) \ do { \ if (virTestGetVerbose()) \ fprintf(stderr, __VA_ARGS__); \ @@ -113,12 +112,12 @@ int virTestMain(int argc, ...); =20 /* Setup, then call func() */ -# define VIR_TEST_MAIN(func) \ +#define VIR_TEST_MAIN(func) \ int main(int argc, char **argv) { \ return virTestMain(argc, argv, func, NULL); \ } =20 -# define VIR_TEST_PRELOAD(lib) \ +#define VIR_TEST_PRELOAD(lib) \ do { \ const char *preload =3D getenv("LD_PRELOAD"); \ if (preload =3D=3D NULL || strstr(preload, lib) =3D=3D NULL) { \ @@ -138,7 +137,7 @@ int virTestMain(int argc, } \ } while (0) =20 -# define VIR_TEST_MAIN_PRELOAD(func, ...) \ +#define VIR_TEST_MAIN_PRELOAD(func, ...) \ int main(int argc, char **argv) { \ return virTestMain(argc, argv, func, __VA_ARGS__, NULL); \ } @@ -163,5 +162,3 @@ int testCompareDomXML2XMLFiles(virCapsPtr caps, bool live, unsigned int parseFlags, testCompareDomXML2XMLResult expectResult); - -#endif /* LIBVIRT_TESTUTILS_H */ diff --git a/tests/testutilshostcpus.h b/tests/testutilshostcpus.h index 32929a0953..a8c34cfc4a 100644 --- a/tests/testutilshostcpus.h +++ b/tests/testutilshostcpus.h @@ -14,12 +14,11 @@ * . */ =20 -#ifndef LIBVIRT_TESTUTILSHOSTCPUS_H -# define LIBVIRT_TESTUTILSHOSTCPUS_H +#pragma once =20 -# include "conf/cpu_conf.h" -# include "internal.h" -# include "util/virarch.h" +#include "conf/cpu_conf.h" +#include "internal.h" +#include "util/virarch.h" =20 static virCPUFeatureDef cpuDefaultFeatures[] =3D { { (char *) "ds", -1 }, @@ -165,5 +164,3 @@ testUtilsHostCpusGetDefForArch(virArch arch) =20 return NULL; } - -#endif /* LIBVIRT_TESTUTILSHOSTCPUS_H */ diff --git a/tests/testutilslxc.h b/tests/testutilslxc.h index 16f1986eca..6339f88734 100644 --- a/tests/testutilslxc.h +++ b/tests/testutilslxc.h @@ -14,14 +14,11 @@ * . */ =20 -#ifndef LIBVIRT_TESTUTILSLXC_H -# define LIBVIRT_TESTUTILSLXC_H +#pragma once =20 -# include "capabilities.h" +#include "capabilities.h" =20 -# define FAKEDEVDIR0 "/fakedevdir0/bla/fasl" -# define FAKEDEVDIR1 "/fakedevdir1/bla/fasl" +#define FAKEDEVDIR0 "/fakedevdir0/bla/fasl" +#define FAKEDEVDIR1 "/fakedevdir1/bla/fasl" =20 virCapsPtr testLXCCapsInit(void); - -#endif /* LIBVIRT_TESTUTILSLXC_H */ diff --git a/tests/testutilsqemu.h b/tests/testutilsqemu.h index 25dedb5edd..0632141d68 100644 --- a/tests/testutilsqemu.h +++ b/tests/testutilsqemu.h @@ -14,18 +14,17 @@ * . */ =20 -#ifndef LIBVIRT_TESTUTILSQEMU_H -# define LIBVIRT_TESTUTILSQEMU_H +#pragma once =20 -# ifdef WITH_QEMU +#ifdef WITH_QEMU =20 -# include "capabilities.h" -# include "virfilecache.h" -# include "domain_conf.h" -# include "qemu/qemu_capabilities.h" -# include "qemu/qemu_conf.h" +# include "capabilities.h" +# include "virfilecache.h" +# include "domain_conf.h" +# include "qemu/qemu_capabilities.h" +# include "qemu/qemu_conf.h" =20 -# define TEST_QEMU_CAPS_PATH abs_srcdir "/qemucapabilitiesdata" +# define TEST_QEMU_CAPS_PATH abs_srcdir "/qemucapabilitiesdata" =20 enum { GIC_NONE =3D 0, @@ -107,6 +106,4 @@ int testQemuInfoSetArgs(struct testQemuInfo *info, virHashTablePtr capslatest, ...); void testQemuInfoClear(struct testQemuInfo *info); =20 -# endif - -#endif /* LIBVIRT_TESTUTILSQEMU_H */ +#endif diff --git a/tests/testutilsqemuschema.h b/tests/testutilsqemuschema.h index 73984e9946..de9da7cb97 100644 --- a/tests/testutilsqemuschema.h +++ b/tests/testutilsqemuschema.h @@ -16,12 +16,11 @@ * . */ =20 -#ifndef LIBVIRT_TESTUTILSQEMUSCHEMA_H -# define LIBVIRT_TESTUTILSQEMUSCHEMA_H +#pragma once =20 -# include "virhash.h" -# include "virjson.h" -# include "virbuffer.h" +#include "virhash.h" +#include "virjson.h" +#include "virbuffer.h" =20 int testQEMUSchemaValidate(virJSONValuePtr obj, @@ -34,5 +33,3 @@ testQEMUSchemaGetLatest(void); =20 virHashTablePtr testQEMUSchemaLoad(void); - -#endif /* LIBVIRT_TESTUTILSQEMUSCHEMA_H */ diff --git a/tests/testutilsxen.h b/tests/testutilsxen.h index 9164a59507..95dadb04c4 100644 --- a/tests/testutilsxen.h +++ b/tests/testutilsxen.h @@ -14,14 +14,11 @@ * . */ =20 -#ifndef LIBVIRT_TESTUTILSXEN_H -# define LIBVIRT_TESTUTILSXEN_H +#pragma once =20 -# include "capabilities.h" -# ifdef WITH_LIBXL -# include "libxl/libxl_capabilities.h" -# endif +#include "capabilities.h" +#ifdef WITH_LIBXL +# include "libxl/libxl_capabilities.h" +#endif =20 virCapsPtr testXLInitCaps(void); - -#endif /* LIBVIRT_TESTUTILSXEN_H */ diff --git a/tests/virfilewrapper.h b/tests/virfilewrapper.h index 80fd6244ad..a19c771d3b 100644 --- a/tests/virfilewrapper.h +++ b/tests/virfilewrapper.h @@ -16,8 +16,7 @@ * . */ =20 -#ifndef LIBVIRT_VIRFILEWRAPPER_H -# define LIBVIRT_VIRFILEWRAPPER_H +#pragma once =20 void virFileWrapperAddPrefix(const char *prefix, @@ -28,5 +27,3 @@ virFileWrapperRemovePrefix(const char *prefix); =20 void virFileWrapperClearPrefixes(void); - -#endif /* LIBVIRT_VIRFILEWRAPPER_H */ diff --git a/tests/virhashdata.h b/tests/virhashdata.h index 309519962d..1b457f2857 100644 --- a/tests/virhashdata.h +++ b/tests/virhashdata.h @@ -14,8 +14,7 @@ * . */ =20 -#ifndef LIBVIRT_VIRHASHDATA_H -# define LIBVIRT_VIRHASHDATA_H +#pragma once =20 const char *uuids[] =3D { /* [ 2] */ "a9b02f96-e430-4f7c-a7ff-a647d080447a", @@ -283,5 +282,3 @@ const char *uuids_new[] =3D { "5920cc9d-62a3-4772-9e73-eb97f0bc483c", "53c215dd-bdba-4fdc-887a-86ab6f860df4", }; - -#endif /* LIBVIRT_VIRHASHDATA_H */ diff --git a/tests/virmock.h b/tests/virmock.h index 46631433c7..74bb0d5b15 100644 --- a/tests/virmock.h +++ b/tests/virmock.h @@ -19,60 +19,59 @@ * */ =20 -#ifndef LIBVIRT_VIRMOCK_H -# define LIBVIRT_VIRMOCK_H - -# if HAVE_DLFCN_H -# include -# endif - -# include "internal.h" - -# define VIR_MOCK_COUNT_ARGS(...) VIR_MOCK_ARG21(__VA_ARGS__, 20, 19, 18, = 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1) -# define VIR_MOCK_ARG21(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12,= _13, _14, _15, _16, _17, _18, _19, _20, _21, ...) _21 -# define VIR_MOCK_ARG_PASTE(a, b, ...) a##b(__VA_ARGS__) - -# define VIR_MOCK_ARGNAME(a, b) b -# define VIR_MOCK_ARGTYPE(a, b) a -# define VIR_MOCK_ARGTYPENAME(a, b) a b -# define VIR_MOCK_ARGTYPENAME_UNUSED(a, b) a b ATTRIBUTE_UNUSED - -# define VIR_MOCK_GET_ARG2(z, a, b) z(a, b) -# define VIR_MOCK_GET_ARG3(z, a, b, c) z(a, b) -# define VIR_MOCK_GET_ARG4(z, a, b, c, d) z(a, b), z(c, d) -# define VIR_MOCK_GET_ARG5(z, a, b, c, d, e) z(a, b), z(c, d) -# define VIR_MOCK_GET_ARG6(z, a, b, c, d, e, f) z(a, b), z(c, d), z(e, f) -# define VIR_MOCK_GET_ARG7(z, a, b, c, d, e, f, g) z(a, b), z(c, d), z(e,= f) -# define VIR_MOCK_GET_ARG8(z, a, b, c, d, e, f, g, h) z(a, b), z(c, d), z= (e, f), z(g, h) -# define VIR_MOCK_GET_ARG9(z, a, b, c, d, e, f, g, h, i) z(a, b), z(c, d)= , z(e, f), z(g, h) -# define VIR_MOCK_GET_ARG10(z, a, b, c, d, e, f, g, h, i, j) z(a, b), z(c= , d), z(e, f), z(g, h), z(i, j) -# define VIR_MOCK_GET_ARG11(z, a, b, c, d, e, f, g, h, i, j, k) z(a, b), = z(c, d), z(e, f), z(g, h), z(i, j) -# define VIR_MOCK_GET_ARG12(z, a, b, c, d, e, f, g, h, i, j, k, l) z(a, b)= , z(c, d), z(e, f), z(g, h), z(i, j), z(k, l) -# define VIR_MOCK_GET_ARG13(z, a, b, c, d, e, f, g, h, i, j, k, l, m) z(a,= b), z(c, d), z(e, f), z(g, h), z(i, j), z(k, l) -# define VIR_MOCK_GET_ARG14(z, a, b, c, d, e, f, g, h, i, j, k, l, m, n) z= (a, b), z(c, d), z(e, f), z(g, h), z(i, j), z(k, l), z(m, n) -# define VIR_MOCK_GET_ARG15(z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o= ) z(a, b), z(c, d), z(e, f), z(g, h), z(i, j), z(k, l), z(m, n) -# define VIR_MOCK_GET_ARG16(z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o= , p) z(a, b), z(c, d), z(e, f), z(g, h), z(i, j), z(k, l), z(m, n), z(o, p) -# define VIR_MOCK_GET_ARG17(z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o= , p, q) z(a, b), z(c, d), z(e, f), z(g, h), z(i, j), z(k, l), z(m, n), z(o= , p) -# define VIR_MOCK_GET_ARG18(z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o= , p, q, r) z(a, b), z(c, d), z(e, f), z(g, h), z(i, j), z(k, l), z(m, n), = z(o, p), z(q, r) -# define VIR_MOCK_GET_ARG19(z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o= , p, q, r, s) z(a, b), z(c, d), z(e, f), z(g, h), z(i, j), z(k, l), z(m, n= ), z(o, p), z(q, r) -# define VIR_MOCK_GET_ARG20(z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o= , p, q, r, s, t) z(a, b), z(c, d), z(e, f), z(g, h), z(i, j), z(k, l), z(m= , n), z(o, p), z(q, r), z(s, t) -# define VIR_MOCK_GET_ARG21(z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o= , p, q, r, s, t, u) z(a, b), z(c, d), z(e, f), z(g, h), z(i, j), z(k, l), = z(m, n), z(o, p), z(q, r), z(s, t) - - -# define VIR_MOCK_ARGNAMES_EXPAND(a, b, ...) VIR_MOCK_ARG_PASTE(a, b, __VA= _ARGS__) -# define VIR_MOCK_ARGNAMES(...) \ +#pragma once + +#if HAVE_DLFCN_H +# include +#endif + +#include "internal.h" + +#define VIR_MOCK_COUNT_ARGS(...) VIR_MOCK_ARG21(__VA_ARGS__, 20, 19, 18, 1= 7, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1) +#define VIR_MOCK_ARG21(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, = _13, _14, _15, _16, _17, _18, _19, _20, _21, ...) _21 +#define VIR_MOCK_ARG_PASTE(a, b, ...) a##b(__VA_ARGS__) + +#define VIR_MOCK_ARGNAME(a, b) b +#define VIR_MOCK_ARGTYPE(a, b) a +#define VIR_MOCK_ARGTYPENAME(a, b) a b +#define VIR_MOCK_ARGTYPENAME_UNUSED(a, b) a b ATTRIBUTE_UNUSED + +#define VIR_MOCK_GET_ARG2(z, a, b) z(a, b) +#define VIR_MOCK_GET_ARG3(z, a, b, c) z(a, b) +#define VIR_MOCK_GET_ARG4(z, a, b, c, d) z(a, b), z(c, d) +#define VIR_MOCK_GET_ARG5(z, a, b, c, d, e) z(a, b), z(c, d) +#define VIR_MOCK_GET_ARG6(z, a, b, c, d, e, f) z(a, b), z(c, d), z(e, f) +#define VIR_MOCK_GET_ARG7(z, a, b, c, d, e, f, g) z(a, b), z(c, d), z(e, = f) +#define VIR_MOCK_GET_ARG8(z, a, b, c, d, e, f, g, h) z(a, b), z(c, d), z(= e, f), z(g, h) +#define VIR_MOCK_GET_ARG9(z, a, b, c, d, e, f, g, h, i) z(a, b), z(c, d),= z(e, f), z(g, h) +#define VIR_MOCK_GET_ARG10(z, a, b, c, d, e, f, g, h, i, j) z(a, b), z(c,= d), z(e, f), z(g, h), z(i, j) +#define VIR_MOCK_GET_ARG11(z, a, b, c, d, e, f, g, h, i, j, k) z(a, b), z= (c, d), z(e, f), z(g, h), z(i, j) +#define VIR_MOCK_GET_ARG12(z, a, b, c, d, e, f, g, h, i, j, k, l) z(a, b),= z(c, d), z(e, f), z(g, h), z(i, j), z(k, l) +#define VIR_MOCK_GET_ARG13(z, a, b, c, d, e, f, g, h, i, j, k, l, m) z(a, = b), z(c, d), z(e, f), z(g, h), z(i, j), z(k, l) +#define VIR_MOCK_GET_ARG14(z, a, b, c, d, e, f, g, h, i, j, k, l, m, n) z(= a, b), z(c, d), z(e, f), z(g, h), z(i, j), z(k, l), z(m, n) +#define VIR_MOCK_GET_ARG15(z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)= z(a, b), z(c, d), z(e, f), z(g, h), z(i, j), z(k, l), z(m, n) +#define VIR_MOCK_GET_ARG16(z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o,= p) z(a, b), z(c, d), z(e, f), z(g, h), z(i, j), z(k, l), z(m, n), z(o, p) +#define VIR_MOCK_GET_ARG17(z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o,= p, q) z(a, b), z(c, d), z(e, f), z(g, h), z(i, j), z(k, l), z(m, n), z(o,= p) +#define VIR_MOCK_GET_ARG18(z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o,= p, q, r) z(a, b), z(c, d), z(e, f), z(g, h), z(i, j), z(k, l), z(m, n), z= (o, p), z(q, r) +#define VIR_MOCK_GET_ARG19(z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o,= p, q, r, s) z(a, b), z(c, d), z(e, f), z(g, h), z(i, j), z(k, l), z(m, n)= , z(o, p), z(q, r) +#define VIR_MOCK_GET_ARG20(z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o,= p, q, r, s, t) z(a, b), z(c, d), z(e, f), z(g, h), z(i, j), z(k, l), z(m,= n), z(o, p), z(q, r), z(s, t) +#define VIR_MOCK_GET_ARG21(z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o,= p, q, r, s, t, u) z(a, b), z(c, d), z(e, f), z(g, h), z(i, j), z(k, l), z= (m, n), z(o, p), z(q, r), z(s, t) + + +#define VIR_MOCK_ARGNAMES_EXPAND(a, b, ...) VIR_MOCK_ARG_PASTE(a, b, __VA_= ARGS__) +#define VIR_MOCK_ARGNAMES(...) \ VIR_MOCK_ARGNAMES_EXPAND(VIR_MOCK_GET_ARG, VIR_MOCK_COUNT_ARGS(__VA_AR= GS__), VIR_MOCK_ARGNAME, __VA_ARGS__) =20 -# define VIR_MOCK_ARGTYPES_EXPAND(a, b, ...) VIR_MOCK_ARG_PASTE(a, b, __VA= _ARGS__) -# define VIR_MOCK_ARGTYPES(...) \ +#define VIR_MOCK_ARGTYPES_EXPAND(a, b, ...) VIR_MOCK_ARG_PASTE(a, b, __VA_= ARGS__) +#define VIR_MOCK_ARGTYPES(...) \ VIR_MOCK_ARGTYPES_EXPAND(VIR_MOCK_GET_ARG, VIR_MOCK_COUNT_ARGS(__VA_AR= GS__), VIR_MOCK_ARGTYPE, __VA_ARGS__) =20 -# define VIR_MOCK_ARGTYPENAMES_EXPAND(a, b, ...) VIR_MOCK_ARG_PASTE(a, b, = __VA_ARGS__) -# define VIR_MOCK_ARGTYPENAMES(...) \ +#define VIR_MOCK_ARGTYPENAMES_EXPAND(a, b, ...) VIR_MOCK_ARG_PASTE(a, b, _= _VA_ARGS__) +#define VIR_MOCK_ARGTYPENAMES(...) \ VIR_MOCK_ARGTYPENAMES_EXPAND(VIR_MOCK_GET_ARG, VIR_MOCK_COUNT_ARGS(__V= A_ARGS__), VIR_MOCK_ARGTYPENAME, __VA_ARGS__) =20 -# define VIR_MOCK_ARGTYPENAMES_UNUSED_EXPAND(a, b, ...) VIR_MOCK_ARG_PASTE= (a, b, __VA_ARGS__) -# define VIR_MOCK_ARGTYPENAMES_UNUSED(...) \ +#define VIR_MOCK_ARGTYPENAMES_UNUSED_EXPAND(a, b, ...) VIR_MOCK_ARG_PASTE(= a, b, __VA_ARGS__) +#define VIR_MOCK_ARGTYPENAMES_UNUSED(...) \ VIR_MOCK_ARGTYPENAMES_UNUSED_EXPAND(VIR_MOCK_GET_ARG, VIR_MOCK_COUNT_A= RGS(__VA_ARGS__), VIR_MOCK_ARGTYPENAME_UNUSED, __VA_ARGS__) =20 =20 @@ -98,7 +97,7 @@ * Define a replacement for @name which invokes wrap_@name * forwarding on all args, and passing back the return value. */ -# define VIR_MOCK_LINK_RET_ARGS(name, rettype, ...) \ +#define VIR_MOCK_LINK_RET_ARGS(name, rettype, ...) \ rettype name(VIR_MOCK_ARGTYPENAMES(__VA_ARGS__)) \ { \ static rettype (*wrap_##name)(VIR_MOCK_ARGTYPES(__VA_ARGS__)); \ @@ -120,7 +119,7 @@ * Define a replacement for @name which invokes wrap_@name * with no arguments, and passing back the return value. */ -# define VIR_MOCK_LINK_RET_VOID(name, rettype) \ +#define VIR_MOCK_LINK_RET_VOID(name, rettype) \ rettype name(void) \ { \ static rettype (*wrap_##name)(void); \ @@ -142,7 +141,7 @@ * Define a replacement for @name which invokes wrap_@name * forwarding on all args, but with no return value. */ -# define VIR_MOCK_LINK_VOID_ARGS(name, ...) \ +#define VIR_MOCK_LINK_VOID_ARGS(name, ...) \ void name(VIR_MOCK_ARGTYPENAMES(__VA_ARGS__)) \ { \ static void (*wrap_##name)(VIR_MOCK_ARGTYPES(__VA_ARGS__)); \ @@ -176,7 +175,7 @@ * Define a replacement for @name which doesn't invoke anything, just * returns @retval. */ -# define VIR_MOCK_STUB_RET_ARGS(name, rettype, retval, ...) \ +#define VIR_MOCK_STUB_RET_ARGS(name, rettype, retval, ...) \ rettype name(VIR_MOCK_ARGTYPENAMES_UNUSED(__VA_ARGS__)) \ { \ return retval; \ @@ -191,7 +190,7 @@ * Define a replacement for @name which doesn't invoke anything, just * returns @retval. */ -# define VIR_MOCK_STUB_RET_VOID(name, rettype, retval) \ +#define VIR_MOCK_STUB_RET_VOID(name, rettype, retval) \ rettype name(void) \ { \ return retval; \ @@ -205,7 +204,7 @@ * Define a replacement for @name which doesn't invoke or return * anything. */ -# define VIR_MOCK_STUB_VOID_ARGS(name, ...) \ +#define VIR_MOCK_STUB_VOID_ARGS(name, ...) \ void name(VIR_MOCK_ARGTYPENAMES_UNUSED(__VA_ARGS__)) \ { \ } @@ -219,7 +218,7 @@ * Define a replacement for @name which doesn't invoke or return * anything. */ -# define VIR_MOCK_STUB_VOID_VOID(name) \ +#define VIR_MOCK_STUB_VOID_VOID(name) \ void name(void) \ { \ } @@ -232,22 +231,22 @@ * as the body of the method. */ =20 -# define VIR_MOCK_IMPL_RET_ARGS(name, rettype, ...) \ +#define VIR_MOCK_IMPL_RET_ARGS(name, rettype, ...) \ rettype name(VIR_MOCK_ARGTYPENAMES(__VA_ARGS__)); \ static rettype (*real_##name)(VIR_MOCK_ARGTYPES(__VA_ARGS__)); \ rettype name(VIR_MOCK_ARGTYPENAMES_UNUSED(__VA_ARGS__)) =20 -# define VIR_MOCK_IMPL_RET_VOID(name, rettype) \ +#define VIR_MOCK_IMPL_RET_VOID(name, rettype) \ rettype name(void); \ static rettype (*real_##name)(void); \ rettype name(void) =20 -# define VIR_MOCK_IMPL_VOID_ARGS(name, ...) \ +#define VIR_MOCK_IMPL_VOID_ARGS(name, ...) \ void name(VIR_MOCK_ARGTYPENAMES(__VA_ARGS__)); \ static void (*real_##name)(VIR_MOCK_ARGTYPES(__VA_ARGS__)); \ void name(VIR_MOCK_ARGTYPENAMES_UNUSED(__VA_ARGS__)) =20 -# define VIR_MOCK_IMPL_VOID_VOID(name) \ +#define VIR_MOCK_IMPL_VOID_VOID(name) \ void name(void); \ static void (*real_##name)(void); \ void name(void) @@ -259,28 +258,28 @@ * as the body of the method. */ =20 -# define VIR_MOCK_WRAP_RET_ARGS(name, rettype, ...) \ +#define VIR_MOCK_WRAP_RET_ARGS(name, rettype, ...) \ rettype wrap_##name(VIR_MOCK_ARGTYPENAMES(__VA_ARGS__)); \ static rettype (*real_##name)(VIR_MOCK_ARGTYPES(__VA_ARGS__)); \ rettype wrap_##name(VIR_MOCK_ARGTYPENAMES_UNUSED(__VA_ARGS__)) =20 -# define VIR_MOCK_WRAP_RET_VOID(name, rettype) \ +#define VIR_MOCK_WRAP_RET_VOID(name, rettype) \ rettype wrap_##name(void); \ static rettype (*real_##name)(void); \ rettype wrap_##name(void) =20 -# define VIR_MOCK_WRAP_VOID_ARGS(name, ...) \ +#define VIR_MOCK_WRAP_VOID_ARGS(name, ...) \ void wrap_##name(VIR_MOCK_ARGTYPENAMES(__VA_ARGS__)); \ static void (*real_##name)(VIR_MOCK_ARGTYPES(__VA_ARGS__)); \ void wrap_##name(VIR_MOCK_ARGTYPENAMES_UNUSED(__VA_ARGS__)) =20 -# define VIR_MOCK_WRAP_VOID_VOID(name) \ +#define VIR_MOCK_WRAP_VOID_VOID(name) \ void wrap_##name(void); \ static void (*real_##name)(void); \ void wrap_##name(void) =20 =20 -# define VIR_MOCK_REAL_INIT(name) \ +#define VIR_MOCK_REAL_INIT(name) \ do { \ if (real_##name =3D=3D NULL && \ !(real_##name =3D dlsym(RTLD_NEXT, \ @@ -289,5 +288,3 @@ abort(); \ } \ } while (0) - -#endif /* LIBVIRT_VIRMOCK_H */ diff --git a/tests/virnettlshelpers.h b/tests/virnettlshelpers.h index 3315a054e4..4c6f5e8c31 100644 --- a/tests/virnettlshelpers.h +++ b/tests/virnettlshelpers.h @@ -16,17 +16,16 @@ * . */ =20 -#ifndef LIBVIRT_VIRNETTLSHELPERS_H -# define LIBVIRT_VIRNETTLSHELPERS_H +#pragma once =20 -# include -# include +#include +#include =20 -# if !defined WIN32 && HAVE_LIBTASN1_H && LIBGNUTLS_VERSION_NUMBER >=3D 0x= 020600 +#if !defined WIN32 && HAVE_LIBTASN1_H && LIBGNUTLS_VERSION_NUMBER >=3D 0x0= 20600 =20 -# include +# include =20 -# include "rpc/virnettlscontext.h" +# include "rpc/virnettlscontext.h" =20 /* * This contains parameter about how to generate @@ -77,6 +76,4 @@ void testTLSDiscardCert(struct testTLSCertReq *req); void testTLSInit(const char *keyfile); void testTLSCleanup(const char *keyfile); =20 -# endif - -#endif /* LIBVIRT_VIRNETTLSHELPERS_H */ +#endif --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560874605; cv=none; d=zoho.com; s=zohoarc; b=G5mLy0jPuBCYyXgFEq5jSuTfdNfIlYaqNKfS4Bf+VMzISdXzMYPqauh+mcGOVJAaGJLovSblce8moWO6NIXei8Dc7WkGfBcJwYj8tqfMZZ6fXU+9K7PvwA8m9dtUQJ8Wio3UtqGj7Avm+ytEUwvn759qYQGrQf9R/CtBel/c9LA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560874605; 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=dRZqlgXSwLZexjS+HWTarjfeIqiUpJYfXVB33WzUtuw=; b=QvVOJN/GMi0YrG0TAQ5TgN6yYK4hAMqQYY9QC7c3qm8B8BuV6yW31rLIodK7+CyDSSRfiGWvrqGXCLQLU874e6LGwaYcrGCG0ilSWIBgkm66slpoBrbddoiqh7Yn5/HIB2lt4l8OGErIxldyzUugay75Z8TB9HlEoUtiTd4Rh+I= 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 1560874605169103.21319658873267; Tue, 18 Jun 2019 09:16:45 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8446930F1BCC; Tue, 18 Jun 2019 16:16:38 +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 5ADF11001E6F; Tue, 18 Jun 2019 16:16:37 +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 15C40206DB; Tue, 18 Jun 2019 16:16:36 +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 x5IGDgW6024462 for ; Tue, 18 Jun 2019 12:13:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id A3DAD8518; Tue, 18 Jun 2019 16:13:42 +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 66DFD60FAB for ; Tue, 18 Jun 2019 16:13:42 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:13:15 -0500 Message-Id: <20190618161316.1722-46-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 45/46] tools: 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.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Tue, 18 Jun 2019 16:16:44 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jonathon Jongsma Reviewed-by: J=C3=A1n Tomko --- tools/nss/libvirt_nss.h | 27 ++++----- tools/virsh-completer.h | 6 +- tools/virsh-console.h | 11 ++-- tools/virsh-domain-monitor.h | 7 +-- tools/virsh-domain.h | 7 +-- tools/virsh-host.h | 7 +-- tools/virsh-interface.h | 9 +-- tools/virsh-network.h | 9 +-- tools/virsh-nodedev.h | 7 +-- tools/virsh-nwfilter.h | 11 ++-- tools/virsh-pool.h | 9 +-- tools/virsh-secret.h | 7 +-- tools/virsh-snapshot.h | 7 +-- tools/virsh-util.h | 11 ++-- tools/virsh-volume.h | 9 +-- tools/virsh.h | 77 ++++++++++++------------ tools/virt-admin-completer.h | 6 +- tools/virt-admin.h | 11 ++-- tools/virt-host-validate-bhyve.h | 5 +- tools/virt-host-validate-common.h | 13 ++--- tools/virt-host-validate-lxc.h | 5 +- tools/virt-host-validate-qemu.h | 5 +- tools/vsh-table.h | 7 +-- tools/vsh.h | 87 ++++++++++++++-------------- tools/wireshark/src/packet-libvirt.h | 5 +- 25 files changed, 146 insertions(+), 219 deletions(-) diff --git a/tools/nss/libvirt_nss.h b/tools/nss/libvirt_nss.h index 4c7525a0d0..75a2e4fd93 100644 --- a/tools/nss/libvirt_nss.h +++ b/tools/nss/libvirt_nss.h @@ -23,17 +23,16 @@ * . */ =20 -#ifndef LIBVIRT_NSS_H -# define LIBVIRT_NSS_H +#pragma once =20 -# include -# include +#include +#include =20 -# if !defined(LIBVIRT_NSS_GUEST) -# define NSS_NAME(s) _nss_libvirt_##s##_r -# else -# define NSS_NAME(s) _nss_libvirt_guest_##s##_r -# endif +#if !defined(LIBVIRT_NSS_GUEST) +# define NSS_NAME(s) _nss_libvirt_##s##_r +#else +# define NSS_NAME(s) _nss_libvirt_guest_##s##_r +#endif =20 enum nss_status NSS_NAME(gethostbyname)(const char *name, struct hostent *result, @@ -48,17 +47,15 @@ enum nss_status NSS_NAME(gethostbyname3)(const char *name, int af, struct hostent *result, char *buffer, size_t buflen, int *errnop, int *herrnop, int32_t *ttlp, char **canonp); -# ifdef HAVE_STRUCT_GAIH_ADDRTUPLE +#ifdef HAVE_STRUCT_GAIH_ADDRTUPLE enum nss_status NSS_NAME(gethostbyname4)(const char *name, struct gaih_addrtuple **pat, char *buffer, size_t buflen, int *errnop, int *herrnop, int32_t *ttlp); -# endif /* HAVE_STRUCT_GAIH_ADDRTUPLE */ +#endif /* HAVE_STRUCT_GAIH_ADDRTUPLE */ =20 -# if defined(HAVE_BSD_NSS) +#if defined(HAVE_BSD_NSS) ns_mtab* nss_module_register(const char *name, unsigned int *size, nss_module_unregister_fn *unregister); -# endif /* HAVE_BSD_NSS */ - -#endif /* LIBVIRT_NSS_H */ +#endif /* HAVE_BSD_NSS */ diff --git a/tools/virsh-completer.h b/tools/virsh-completer.h index cd3cc9ecae..9b3951f4fd 100644 --- a/tools/virsh-completer.h +++ b/tools/virsh-completer.h @@ -18,10 +18,9 @@ * . */ =20 -#ifndef LIBVIRT_VIRSH_COMPLETER_H -# define LIBVIRT_VIRSH_COMPLETER_H +#pragma once =20 -# include "vsh.h" +#include "vsh.h" =20 char ** virshDomainNameCompleter(vshControl *ctl, const vshCmd *cmd, @@ -118,4 +117,3 @@ char ** virshCellnoCompleter(vshControl *ctl, char ** virshDomainShutdownModeCompleter(vshControl *ctl, const vshCmd *cmd, unsigned int flags); -#endif /* LIBVIRT_VIRSH_COMPLETER_H */ diff --git a/tools/virsh-console.h b/tools/virsh-console.h index bc1a70b518..e89484d24b 100644 --- a/tools/virsh-console.h +++ b/tools/virsh-console.h @@ -18,18 +18,15 @@ * . */ =20 -#ifndef LIBVIRT_VIRSH_CONSOLE_H -# define LIBVIRT_VIRSH_CONSOLE_H +#pragma once =20 -# ifndef WIN32 +#ifndef WIN32 =20 -# include +# include =20 int virshRunConsole(vshControl *ctl, virDomainPtr dom, const char *dev_name, unsigned int flags); =20 -# endif /* !WIN32 */ - -#endif /* LIBVIRT_VIRSH_CONSOLE_H */ +#endif /* !WIN32 */ diff --git a/tools/virsh-domain-monitor.h b/tools/virsh-domain-monitor.h index d24e0bbd40..77e83502db 100644 --- a/tools/virsh-domain-monitor.h +++ b/tools/virsh-domain-monitor.h @@ -18,15 +18,12 @@ * . */ =20 -#ifndef LIBVIRT_VIRSH_DOMAIN_MONITOR_H -# define LIBVIRT_VIRSH_DOMAIN_MONITOR_H +#pragma once =20 -# include "virsh.h" +#include "virsh.h" =20 char *virshGetDomainDescription(vshControl *ctl, virDomainPtr dom, bool title, unsigned int flags) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; =20 extern const vshCmdDef domMonitoringCmds[]; - -#endif /* LIBVIRT_VIRSH_DOMAIN_MONITOR_H */ diff --git a/tools/virsh-domain.h b/tools/virsh-domain.h index 119d4422a1..02996d51b1 100644 --- a/tools/virsh-domain.h +++ b/tools/virsh-domain.h @@ -18,10 +18,9 @@ * . */ =20 -#ifndef LIBVIRT_VIRSH_DOMAIN_H -# define LIBVIRT_VIRSH_DOMAIN_H +#pragma once =20 -# include "virsh.h" +#include "virsh.h" =20 struct virshDomainEventCallback { const char *name; @@ -32,5 +31,3 @@ typedef struct virshDomainEventCallback virshDomainEventC= allback; extern virshDomainEventCallback virshDomainEventCallbacks[]; =20 extern const vshCmdDef domManagementCmds[]; - -#endif /* LIBVIRT_VIRSH_DOMAIN_H */ diff --git a/tools/virsh-host.h b/tools/virsh-host.h index 395e39cd57..f4c2aa316d 100644 --- a/tools/virsh-host.h +++ b/tools/virsh-host.h @@ -18,11 +18,8 @@ * . */ =20 -#ifndef LIBVIRT_VIRSH_HOST_H -# define LIBVIRT_VIRSH_HOST_H +#pragma once =20 -# include "virsh.h" +#include "virsh.h" =20 extern const vshCmdDef hostAndHypervisorCmds[]; - -#endif /* LIBVIRT_VIRSH_HOST_H */ diff --git a/tools/virsh-interface.h b/tools/virsh-interface.h index e110e3a8e2..ad7bf36ab4 100644 --- a/tools/virsh-interface.h +++ b/tools/virsh-interface.h @@ -18,20 +18,17 @@ * . */ =20 -#ifndef LIBVIRT_VIRSH_INTERFACE_H -# define LIBVIRT_VIRSH_INTERFACE_H +#pragma once =20 -# include "virsh.h" +#include "virsh.h" =20 virInterfacePtr virshCommandOptInterfaceBy(vshControl *ctl, const vshCmd *= cmd, const char *optname, const char **name, unsigned int= flags); =20 /* default is lookup by Name and MAC */ -# define virshCommandOptInterface(_ctl, _cmd, _name) \ +#define virshCommandOptInterface(_ctl, _cmd, _name) \ virshCommandOptInterfaceBy(_ctl, _cmd, NULL, _name, \ VIRSH_BYMAC | VIRSH_BYNAME) =20 extern const vshCmdDef ifaceCmds[]; - -#endif /* LIBVIRT_VIRSH_INTERFACE_H */ diff --git a/tools/virsh-network.h b/tools/virsh-network.h index 18b8e4365f..3c786dd7a1 100644 --- a/tools/virsh-network.h +++ b/tools/virsh-network.h @@ -18,10 +18,9 @@ * . */ =20 -#ifndef LIBVIRT_VIRSH_NETWORK_H -# define LIBVIRT_VIRSH_NETWORK_H +#pragma once =20 -# include "virsh.h" +#include "virsh.h" =20 virNetworkPtr virshCommandOptNetworkBy(vshControl *ctl, const vshCmd *cmd, @@ -33,7 +32,7 @@ virshCommandOptNetworkPort(vshControl *ctl, const vshCmd = *cmd, const char **name); =20 /* default is lookup by Name and UUID */ -# define virshCommandOptNetwork(_ctl, _cmd, _name) \ +#define virshCommandOptNetwork(_ctl, _cmd, _name) \ virshCommandOptNetworkBy(_ctl, _cmd, _name, \ VIRSH_BYUUID | VIRSH_BYNAME) =20 @@ -46,5 +45,3 @@ typedef struct virshNetworkEventCallback virshNetworkEven= tCallback; extern virshNetworkEventCallback virshNetworkEventCallbacks[]; =20 extern const vshCmdDef networkCmds[]; - -#endif /* LIBVIRT_VIRSH_NETWORK_H */ diff --git a/tools/virsh-nodedev.h b/tools/virsh-nodedev.h index e58eedf6ea..9691b0db4d 100644 --- a/tools/virsh-nodedev.h +++ b/tools/virsh-nodedev.h @@ -18,10 +18,9 @@ * . */ =20 -#ifndef LIBVIRT_VIRSH_NODEDEV_H -# define LIBVIRT_VIRSH_NODEDEV_H +#pragma once =20 -# include "virsh.h" +#include "virsh.h" =20 struct virshNodedevEventCallback { const char *name; @@ -32,5 +31,3 @@ typedef struct virshNodedevEventCallback virshNodedevEven= tCallback; extern virshNodedevEventCallback virshNodedevEventCallbacks[]; =20 extern const vshCmdDef nodedevCmds[]; - -#endif /* LIBVIRT_VIRSH_NODEDEV_H */ diff --git a/tools/virsh-nwfilter.h b/tools/virsh-nwfilter.h index 2ac9bdff7f..e29a8903e5 100644 --- a/tools/virsh-nwfilter.h +++ b/tools/virsh-nwfilter.h @@ -18,10 +18,9 @@ * . */ =20 -#ifndef LIBVIRT_VIRSH_NWFILTER_H -# define LIBVIRT_VIRSH_NWFILTER_H +#pragma once =20 -# include "virsh.h" +#include "virsh.h" =20 virNWFilterPtr virshCommandOptNWFilterBy(vshControl *ctl, const vshCmd *cmd, @@ -32,14 +31,12 @@ virshCommandOptNWFilterBindingBy(vshControl *ctl, const= vshCmd *cmd, const char **name, unsigned int flags); =20 /* default is lookup by Name and UUID */ -# define virshCommandOptNWFilter(_ctl, _cmd, _name) \ +#define virshCommandOptNWFilter(_ctl, _cmd, _name) \ virshCommandOptNWFilterBy(_ctl, _cmd, _name, \ VIRSH_BYUUID | VIRSH_BYNAME) =20 /* default is lookup by port dev */ -# define virshCommandOptNWFilterBinding(_ctl, _cmd, _name) \ +#define virshCommandOptNWFilterBinding(_ctl, _cmd, _name) \ virshCommandOptNWFilterBindingBy(_ctl, _cmd, _name, 0) =20 extern const vshCmdDef nwfilterCmds[]; - -#endif /* LIBVIRT_VIRSH_NWFILTER_H */ diff --git a/tools/virsh-pool.h b/tools/virsh-pool.h index 458e843d3c..219f0eea42 100644 --- a/tools/virsh-pool.h +++ b/tools/virsh-pool.h @@ -18,17 +18,16 @@ * . */ =20 -#ifndef LIBVIRT_VIRSH_POOL_H -# define LIBVIRT_VIRSH_POOL_H +#pragma once =20 -# include "virsh.h" +#include "virsh.h" =20 virStoragePoolPtr virshCommandOptPoolBy(vshControl *ctl, const vshCmd *cmd, const char *optn= ame, const char **name, unsigned int flags); =20 /* default is lookup by Name and UUID */ -# define virshCommandOptPool(_ctl, _cmd, _optname, _name) \ +#define virshCommandOptPool(_ctl, _cmd, _optname, _name) \ virshCommandOptPoolBy(_ctl, _cmd, _optname, _name, \ VIRSH_BYUUID | VIRSH_BYNAME) =20 @@ -41,5 +40,3 @@ typedef struct virshPoolEventCallback virshPoolEventCallb= ack; extern virshPoolEventCallback virshPoolEventCallbacks[]; =20 extern const vshCmdDef storagePoolCmds[]; - -#endif /* LIBVIRT_VIRSH_POOL_H */ diff --git a/tools/virsh-secret.h b/tools/virsh-secret.h index 71271f7c80..6ebe573f87 100644 --- a/tools/virsh-secret.h +++ b/tools/virsh-secret.h @@ -18,10 +18,9 @@ * . */ =20 -#ifndef LIBVIRT_VIRSH_SECRET_H -# define LIBVIRT_VIRSH_SECRET_H +#pragma once =20 -# include "virsh.h" +#include "virsh.h" =20 struct virshSecretEventCallback { const char *name; @@ -32,5 +31,3 @@ typedef struct virshSecretEventCallback virshSecretEventC= allback; extern virshSecretEventCallback virshSecretEventCallbacks[]; =20 extern const vshCmdDef secretCmds[]; - -#endif /* LIBVIRT_VIRSH_SECRET_H */ diff --git a/tools/virsh-snapshot.h b/tools/virsh-snapshot.h index c9e706ded6..49517a4235 100644 --- a/tools/virsh-snapshot.h +++ b/tools/virsh-snapshot.h @@ -18,11 +18,8 @@ * . */ =20 -#ifndef LIBVIRT_VIRSH_SNAPSHOT_H -# define LIBVIRT_VIRSH_SNAPSHOT_H +#pragma once =20 -# include "virsh.h" +#include "virsh.h" =20 extern const vshCmdDef snapshotCmds[]; - -#endif /* LIBVIRT_VIRSH_SNAPSHOT_H */ diff --git a/tools/virsh-util.h b/tools/virsh-util.h index fb2ed277af..55520302ff 100644 --- a/tools/virsh-util.h +++ b/tools/virsh-util.h @@ -16,13 +16,12 @@ * . */ =20 -#ifndef LIBVIRT_VIRSH_UTIL_H -# define LIBVIRT_VIRSH_UTIL_H +#pragma once =20 -# include "virsh.h" +#include "virsh.h" =20 -# include -# include +#include +#include =20 virDomainPtr virshLookupDomainBy(vshControl *ctl, @@ -103,5 +102,3 @@ virshDomainGetXML(vshControl *ctl, xmlXPathContextPtr *ctxt) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5) ATTRIBUTE_RETURN_CHECK; - -#endif /* LIBVIRT_VIRSH_UTIL_H */ diff --git a/tools/virsh-volume.h b/tools/virsh-volume.h index 66cf9cfa54..15cab0fd8c 100644 --- a/tools/virsh-volume.h +++ b/tools/virsh-volume.h @@ -18,10 +18,9 @@ * . */ =20 -#ifndef LIBVIRT_VIRSH_VOLUME_H -# define LIBVIRT_VIRSH_VOLUME_H +#pragma once =20 -# include "virsh.h" +#include "virsh.h" =20 virStorageVolPtr virshCommandOptVolBy(vshControl *ctl, const vshCmd *cmd, const char *optname, @@ -29,10 +28,8 @@ virStorageVolPtr virshCommandOptVolBy(vshControl *ctl, c= onst vshCmd *cmd, const char **name, unsigned int flag= s); =20 /* default is lookup by Name and UUID */ -# define virshCommandOptVol(_ctl, _cmd, _optname, _pooloptname, _name) \ +#define virshCommandOptVol(_ctl, _cmd, _optname, _pooloptname, _name) \ virshCommandOptVolBy(_ctl, _cmd, _optname, _pooloptname, _name, \ VIRSH_BYUUID | VIRSH_BYNAME) =20 extern const vshCmdDef storageVolCmds[]; - -#endif /* LIBVIRT_VIRSH_VOLUME_H */ diff --git a/tools/virsh.h b/tools/virsh.h index 254ce3289e..847ed25151 100644 --- a/tools/virsh.h +++ b/tools/virsh.h @@ -18,46 +18,45 @@ * . */ =20 -#ifndef LIBVIRT_VIRSH_H -# define LIBVIRT_VIRSH_H +#pragma once =20 -# include -# include -# include -# include +#include +#include +#include +#include =20 -# include "internal.h" -# include "virerror.h" -# include "virthread.h" -# include "virpolkit.h" -# include "vsh.h" -# include "virsh-completer.h" +#include "internal.h" +#include "virerror.h" +#include "virthread.h" +#include "virpolkit.h" +#include "vsh.h" +#include "virsh-completer.h" =20 -# define VIRSH_PROMPT_RW "virsh # " -# define VIRSH_PROMPT_RO "virsh > " +#define VIRSH_PROMPT_RW "virsh # " +#define VIRSH_PROMPT_RO "virsh > " =20 -# define VIR_FROM_THIS VIR_FROM_NONE +#define VIR_FROM_THIS VIR_FROM_NONE =20 /* * Command group types */ -# define VIRSH_CMD_GRP_DOM_MANAGEMENT "Domain Management" -# define VIRSH_CMD_GRP_DOM_MONITORING "Domain Monitoring" -# define VIRSH_CMD_GRP_STORAGE_POOL "Storage Pool" -# define VIRSH_CMD_GRP_STORAGE_VOL "Storage Volume" -# define VIRSH_CMD_GRP_NETWORK "Networking" -# define VIRSH_CMD_GRP_NODEDEV "Node Device" -# define VIRSH_CMD_GRP_IFACE "Interface" -# define VIRSH_CMD_GRP_NWFILTER "Network Filter" -# define VIRSH_CMD_GRP_SECRET "Secret" -# define VIRSH_CMD_GRP_SNAPSHOT "Snapshot" -# define VIRSH_CMD_GRP_HOST_AND_HV "Host and Hypervisor" -# define VIRSH_CMD_GRP_VIRSH "Virsh itself" +#define VIRSH_CMD_GRP_DOM_MANAGEMENT "Domain Management" +#define VIRSH_CMD_GRP_DOM_MONITORING "Domain Monitoring" +#define VIRSH_CMD_GRP_STORAGE_POOL "Storage Pool" +#define VIRSH_CMD_GRP_STORAGE_VOL "Storage Volume" +#define VIRSH_CMD_GRP_NETWORK "Networking" +#define VIRSH_CMD_GRP_NODEDEV "Node Device" +#define VIRSH_CMD_GRP_IFACE "Interface" +#define VIRSH_CMD_GRP_NWFILTER "Network Filter" +#define VIRSH_CMD_GRP_SECRET "Secret" +#define VIRSH_CMD_GRP_SNAPSHOT "Snapshot" +#define VIRSH_CMD_GRP_HOST_AND_HV "Host and Hypervisor" +#define VIRSH_CMD_GRP_VIRSH "Virsh itself" =20 /* * Common command options */ -# define VIRSH_COMMON_OPT_POOL(_helpstr, cflags) \ +#define VIRSH_COMMON_OPT_POOL(_helpstr, cflags) \ {.name =3D "pool", \ .type =3D VSH_OT_DATA, \ .flags =3D VSH_OFLAG_REQ, \ @@ -66,7 +65,7 @@ .completer_flags =3D cflags, \ } =20 -# define VIRSH_COMMON_OPT_DOMAIN(_helpstr, cflags) \ +#define VIRSH_COMMON_OPT_DOMAIN(_helpstr, cflags) \ {.name =3D "domain", \ .type =3D VSH_OT_DATA, \ .flags =3D VSH_OFLAG_REQ, \ @@ -75,35 +74,35 @@ .completer_flags =3D cflags, \ } =20 -# define VIRSH_COMMON_OPT_DOMAIN_FULL(cflags) \ +#define VIRSH_COMMON_OPT_DOMAIN_FULL(cflags) \ VIRSH_COMMON_OPT_DOMAIN(N_("domain name, id or uuid"), cflags) =20 -# define VIRSH_COMMON_OPT_CONFIG(_helpstr) \ +#define VIRSH_COMMON_OPT_CONFIG(_helpstr) \ {.name =3D "config", \ .type =3D VSH_OT_BOOL, \ .help =3D _helpstr \ } =20 -# define VIRSH_COMMON_OPT_LIVE(_helpstr) \ +#define VIRSH_COMMON_OPT_LIVE(_helpstr) \ {.name =3D "live", \ .type =3D VSH_OT_BOOL, \ .help =3D _helpstr \ } =20 -# define VIRSH_COMMON_OPT_CURRENT(_helpstr) \ +#define VIRSH_COMMON_OPT_CURRENT(_helpstr) \ {.name =3D "current", \ .type =3D VSH_OT_BOOL, \ .help =3D _helpstr \ } =20 -# define VIRSH_COMMON_OPT_FILE(_helpstr) \ +#define VIRSH_COMMON_OPT_FILE(_helpstr) \ {.name =3D "file", \ .type =3D VSH_OT_DATA, \ .flags =3D VSH_OFLAG_REQ, \ .help =3D _helpstr \ } =20 -# define VIRSH_COMMON_OPT_DOMAIN_OT_STRING(_helpstr, oflags, cflags) \ +#define VIRSH_COMMON_OPT_DOMAIN_OT_STRING(_helpstr, oflags, cflags) \ {.name =3D "domain", \ .type =3D VSH_OT_STRING, \ .flags =3D oflags, \ @@ -112,11 +111,11 @@ .completer_flags =3D cflags, \ } =20 -# define VIRSH_COMMON_OPT_DOMAIN_OT_STRING_FULL(oflags, cflags) \ +#define VIRSH_COMMON_OPT_DOMAIN_OT_STRING_FULL(oflags, cflags) \ VIRSH_COMMON_OPT_DOMAIN_OT_STRING(N_("domain name, id or uuid"), \ oflags, cflags) =20 -# define VIRSH_COMMON_OPT_DOMAIN_OT_ARGV(_helpstr, cflags) \ +#define VIRSH_COMMON_OPT_DOMAIN_OT_ARGV(_helpstr, cflags) \ {.name =3D "domain", \ .type =3D VSH_OT_ARGV, \ .flags =3D VSH_OFLAG_NONE, \ @@ -125,7 +124,7 @@ .completer_flags =3D cflags, \ } =20 -# define VIRSH_COMMON_OPT_DOMAIN_OT_ARGV_FULL(cflags) \ +#define VIRSH_COMMON_OPT_DOMAIN_OT_ARGV_FULL(cflags) \ VIRSH_COMMON_OPT_DOMAIN_OT_ARGV(N_("domain name, id or uuid"), cflags) =20 typedef struct _virshControl virshControl; @@ -171,5 +170,3 @@ typedef enum { } virshLookupByFlags; =20 virConnectPtr virshConnect(vshControl *ctl, const char *uri, bool readonly= ); - -#endif /* LIBVIRT_VIRSH_H */ diff --git a/tools/virt-admin-completer.h b/tools/virt-admin-completer.h index a0b09f1ec9..b6f68ce205 100644 --- a/tools/virt-admin-completer.h +++ b/tools/virt-admin-completer.h @@ -18,13 +18,11 @@ * . */ =20 -#ifndef LIBVIRT_VIRT_ADMIN_COMPLETER_H -# define LIBVIRT_VIRT_ADMIN_COMPLETER_H +#pragma once =20 -# include "vsh.h" +#include "vsh.h" =20 char ** vshAdmServerCompleter(vshControl *ctl, const vshCmd *cmd, unsigned int flags); -#endif /* LIBVIRT_VIRT_ADMIN_COMPLETER_H */ diff --git a/tools/virt-admin.h b/tools/virt-admin.h index a58bb7bef2..9f9fdc503d 100644 --- a/tools/virt-admin.h +++ b/tools/virt-admin.h @@ -18,13 +18,12 @@ * . */ =20 -#ifndef LIBVIRT_VIRT_ADMIN_H -# define LIBVIRT_VIRT_ADMIN_H +#pragma once =20 -# include "internal.h" -# include "vsh.h" +#include "internal.h" +#include "vsh.h" =20 -# define VIR_FROM_THIS VIR_FROM_NONE +#define VIR_FROM_THIS VIR_FROM_NONE =20 /* * Command group types @@ -40,5 +39,3 @@ struct _vshAdmControl { virAdmConnectPtr conn; /* connection to a daemon's admin server */ bool wantReconnect; }; - -#endif /* LIBVIRT_VIRT_ADMIN_H */ diff --git a/tools/virt-host-validate-bhyve.h b/tools/virt-host-validate-bh= yve.h index c9a3f2b5b4..a5fd22c871 100644 --- a/tools/virt-host-validate-bhyve.h +++ b/tools/virt-host-validate-bhyve.h @@ -19,9 +19,6 @@ * */ =20 -#ifndef LIBVIRT_VIRT_HOST_VALIDATE_BHYVE_H -# define LIBVIRT_VIRT_HOST_VALIDATE_BHYVE_H +#pragma once =20 int virHostValidateBhyve(void); - -#endif /* LIBVIRT_VIRT_HOST_VALIDATE_BHYVE_H */ diff --git a/tools/virt-host-validate-common.h b/tools/virt-host-validate-c= ommon.h index 94a5005d5d..c4e4fa2175 100644 --- a/tools/virt-host-validate-common.h +++ b/tools/virt-host-validate-common.h @@ -19,13 +19,12 @@ * */ =20 -#ifndef LIBVIRT_VIRT_HOST_VALIDATE_COMMON_H -# define LIBVIRT_VIRT_HOST_VALIDATE_COMMON_H +#pragma once =20 -# include "internal.h" -# include "virutil.h" -# include "virbitmap.h" -# include "virenum.h" +#include "internal.h" +#include "virutil.h" +#include "virbitmap.h" +#include "virenum.h" =20 typedef enum { VIR_HOST_VALIDATE_FAIL, @@ -84,5 +83,3 @@ int virHostValidateCGroupControllers(const char *hvname, =20 int virHostValidateIOMMU(const char *hvname, virHostValidateLevel level); - -#endif /* LIBVIRT_VIRT_HOST_VALIDATE_COMMON_H */ diff --git a/tools/virt-host-validate-lxc.h b/tools/virt-host-validate-lxc.h index b8d3dd8eb0..fefab17552 100644 --- a/tools/virt-host-validate-lxc.h +++ b/tools/virt-host-validate-lxc.h @@ -19,9 +19,6 @@ * */ =20 -#ifndef LIBVIRT_VIRT_HOST_VALIDATE_LXC_H -# define LIBVIRT_VIRT_HOST_VALIDATE_LXC_H +#pragma once =20 int virHostValidateLXC(void); - -#endif /* LIBVIRT_VIRT_HOST_VALIDATE_LXC_H */ diff --git a/tools/virt-host-validate-qemu.h b/tools/virt-host-validate-qem= u.h index 031029dd61..ddb86aa52c 100644 --- a/tools/virt-host-validate-qemu.h +++ b/tools/virt-host-validate-qemu.h @@ -19,9 +19,6 @@ * */ =20 -#ifndef LIBVIRT_VIRT_HOST_VALIDATE_QEMU_H -# define LIBVIRT_VIRT_HOST_VALIDATE_QEMU_H +#pragma once =20 int virHostValidateQEMU(void); - -#endif /* LIBVIRT_VIRT_HOST_VALIDATE_QEMU_H */ diff --git a/tools/vsh-table.h b/tools/vsh-table.h index e5b8a9f480..ef0042ffcc 100644 --- a/tools/vsh-table.h +++ b/tools/vsh-table.h @@ -18,10 +18,9 @@ * . */ =20 -#ifndef LIBVIRT_VSH_TABLE_H -# define LIBVIRT_VSH_TABLE_H +#pragma once =20 -# include "vsh.h" +#include "vsh.h" =20 typedef struct _vshTable vshTable; typedef struct _vshTableRow vshTableRow; @@ -33,5 +32,3 @@ vshTablePtr vshTableNew(const char *format, ...); int vshTableRowAppend(vshTablePtr table, const char *arg, ...); void vshTablePrintToStdout(vshTablePtr table, vshControl *ctl); char *vshTablePrintToString(vshTablePtr table, bool header); - -#endif /* LIBVIRT_VSH_TABLE_H */ diff --git a/tools/vsh.h b/tools/vsh.h index 68fbe0a1f2..4e02bb177d 100644 --- a/tools/vsh.h +++ b/tools/vsh.h @@ -18,36 +18,35 @@ * . */ =20 -#ifndef LIBVIRT_VSH_H -# define LIBVIRT_VSH_H +#pragma once =20 -# include -# include -# include -# include +#include +#include +#include +#include =20 -# include "internal.h" -# include "virerror.h" -# include "virthread.h" +#include "internal.h" +#include "virerror.h" +#include "virthread.h" =20 -# define VIR_FROM_THIS VIR_FROM_NONE +#define VIR_FROM_THIS VIR_FROM_NONE =20 -# define GETTIMEOFDAY(T) gettimeofday(T, NULL) -# define VSH_MAX_XML_FILE (10*1024*1024) -# define VSH_MATCH(FLAG) (flags & (FLAG)) +#define GETTIMEOFDAY(T) gettimeofday(T, NULL) +#define VSH_MAX_XML_FILE (10*1024*1024) +#define VSH_MATCH(FLAG) (flags & (FLAG)) =20 /** * The log configuration */ -# define MSG_BUFFER 4096 -# define DIR_MODE (S_IWUSR | S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP | = S_IROTH | S_IXOTH) /* 0755 */ -# define FILE_MODE (S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH) = /* 0644 */ -# define LOCK_MODE (S_IWUSR | S_IRUSR) = /* 0600 */ -# define LVL_DEBUG "DEBUG" -# define LVL_INFO "INFO" -# define LVL_NOTICE "NOTICE" -# define LVL_WARNING "WARNING" -# define LVL_ERROR "ERROR" +#define MSG_BUFFER 4096 +#define DIR_MODE (S_IWUSR | S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP | S= _IROTH | S_IXOTH) /* 0755 */ +#define FILE_MODE (S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH) = /* 0644 */ +#define LOCK_MODE (S_IWUSR | S_IRUSR) = /* 0600 */ +#define LVL_DEBUG "DEBUG" +#define LVL_INFO "INFO" +#define LVL_NOTICE "NOTICE" +#define LVL_WARNING "WARNING" +#define LVL_ERROR "ERROR" =20 /** * vshErrorLevel: @@ -62,7 +61,7 @@ typedef enum { VSH_ERR_ERROR } vshErrorLevel; =20 -# define VSH_DEBUG_DEFAULT VSH_ERR_ERROR +#define VSH_DEBUG_DEFAULT VSH_ERR_ERROR =20 /* * virsh command line grammar: @@ -218,9 +217,9 @@ struct _vshControl { int keepalive_interval; /* Client keepalive interval */ int keepalive_count; /* Client keepalive count */ =20 -# ifndef WIN32 +#ifndef WIN32 struct termios termattr; /* settings of the tty terminal */ -# endif +#endif bool istty; /* is the terminal a tty */ =20 const vshClientHooks *hooks;/* mandatory client specific hooks */ @@ -313,7 +312,7 @@ void vshDebug(vshControl *ctl, int level, const char *f= ormat, ...) ATTRIBUTE_FMT_PRINTF(3, 4); =20 /* User visible sort, so we want locale-specific case comparison. */ -# define vshStrcasecmp(S1, S2) strcasecmp(S1, S2) +#define vshStrcasecmp(S1, S2) strcasecmp(S1, S2) int vshNameSorter(const void *a, const void *b); =20 virTypedParameterPtr vshFindTypedParamByName(const char *name, @@ -386,7 +385,7 @@ bool cmdQuit(vshControl *ctl, const vshCmd *cmd); bool cmdSelfTest(vshControl *ctl, const vshCmd *cmd); bool cmdComplete(vshControl *ctl, const vshCmd *cmd); =20 -# define VSH_CMD_CD \ +#define VSH_CMD_CD \ { \ .name =3D "cd", \ .handler =3D cmdCd, \ @@ -395,7 +394,7 @@ bool cmdComplete(vshControl *ctl, const vshCmd *cmd); .flags =3D VSH_CMD_FLAG_NOCONNECT \ } =20 -# define VSH_CMD_ECHO \ +#define VSH_CMD_ECHO \ { \ .name =3D "echo", \ .handler =3D cmdEcho, \ @@ -404,7 +403,7 @@ bool cmdComplete(vshControl *ctl, const vshCmd *cmd); .flags =3D VSH_CMD_FLAG_NOCONNECT \ } =20 -# define VSH_CMD_EXIT \ +#define VSH_CMD_EXIT \ { \ .name =3D "exit", \ .handler =3D cmdQuit, \ @@ -413,7 +412,7 @@ bool cmdComplete(vshControl *ctl, const vshCmd *cmd); .flags =3D VSH_CMD_FLAG_NOCONNECT \ } =20 -# define VSH_CMD_HELP \ +#define VSH_CMD_HELP \ { \ .name =3D "help", \ .handler =3D cmdHelp, \ @@ -422,7 +421,7 @@ bool cmdComplete(vshControl *ctl, const vshCmd *cmd); .flags =3D VSH_CMD_FLAG_NOCONNECT \ } =20 -# define VSH_CMD_PWD \ +#define VSH_CMD_PWD \ { \ .name =3D "pwd", \ .handler =3D cmdPwd, \ @@ -431,7 +430,7 @@ bool cmdComplete(vshControl *ctl, const vshCmd *cmd); .flags =3D VSH_CMD_FLAG_NOCONNECT \ } =20 -# define VSH_CMD_QUIT \ +#define VSH_CMD_QUIT \ { \ .name =3D "quit", \ .handler =3D cmdQuit, \ @@ -440,7 +439,7 @@ bool cmdComplete(vshControl *ctl, const vshCmd *cmd); .flags =3D VSH_CMD_FLAG_NOCONNECT \ } =20 -# define VSH_CMD_SELF_TEST \ +#define VSH_CMD_SELF_TEST \ { \ .name =3D "self-test", \ .handler =3D cmdSelfTest, \ @@ -450,7 +449,7 @@ bool cmdComplete(vshControl *ctl, const vshCmd *cmd); .alias =3D "self-test" \ } =20 -# define VSH_CMD_COMPLETE \ +#define VSH_CMD_COMPLETE \ { \ .name =3D "complete", \ .handler =3D cmdComplete, \ @@ -467,16 +466,16 @@ char * vshReadline(vshControl *ctl, const char *promp= t); =20 /* allocation wrappers */ void *_vshMalloc(vshControl *ctl, size_t sz, const char *filename, int lin= e); -# define vshMalloc(_ctl, _sz) _vshMalloc(_ctl, _sz, __FILE__, __LINE__) +#define vshMalloc(_ctl, _sz) _vshMalloc(_ctl, _sz, __FILE__, __LINE__) =20 void *_vshCalloc(vshControl *ctl, size_t nmemb, size_t sz, const char *filename, int line); -# define vshCalloc(_ctl, _nmemb, _sz) \ +#define vshCalloc(_ctl, _nmemb, _sz) \ _vshCalloc(_ctl, _nmemb, _sz, __FILE__, __LINE__) =20 char *_vshStrdup(vshControl *ctl, const char *s, const char *filename, int line); -# define vshStrdup(_ctl, _s) _vshStrdup(_ctl, _s, __FILE__, __LINE__) +#define vshStrdup(_ctl, _s) _vshStrdup(_ctl, _s, __FILE__, __LINE__) =20 /* Macros to help dealing with mutually exclusive options. */ =20 @@ -493,7 +492,7 @@ char *_vshStrdup(vshControl *ctl, const char *s, const = char *filename, * This helper does an early return and therefore it has to be called * before anything that would require cleanup. */ -# define VSH_EXCLUSIVE_OPTIONS_EXPR(NAME1, EXPR1, NAME2, EXPR2) \ +#define VSH_EXCLUSIVE_OPTIONS_EXPR(NAME1, EXPR1, NAME2, EXPR2) \ if ((EXPR1) && (EXPR2)) { \ vshError(ctl, _("Options --%s and --%s are mutually exclusive"), \ NAME1, NAME2); \ @@ -511,7 +510,7 @@ char *_vshStrdup(vshControl *ctl, const char *s, const = char *filename, * This helper does an early return and therefore it has to be called * before anything that would require cleanup. */ -# define VSH_EXCLUSIVE_OPTIONS(NAME1, NAME2) \ +#define VSH_EXCLUSIVE_OPTIONS(NAME1, NAME2) \ VSH_EXCLUSIVE_OPTIONS_EXPR(NAME1, vshCommandOptBool(cmd, NAME1), \ NAME2, vshCommandOptBool(cmd, NAME2)) =20 @@ -526,7 +525,7 @@ char *_vshStrdup(vshControl *ctl, const char *s, const = char *filename, * This helper does an early return and therefore it has to be called * before anything that would require cleanup. */ -# define VSH_EXCLUSIVE_OPTIONS_VAR(VARNAME1, VARNAME2) \ +#define VSH_EXCLUSIVE_OPTIONS_VAR(VARNAME1, VARNAME2) \ VSH_EXCLUSIVE_OPTIONS_EXPR(#VARNAME1, VARNAME1, #VARNAME2, VARNAME2) =20 /* Macros to help dealing with required options. */ @@ -544,7 +543,7 @@ char *_vshStrdup(vshControl *ctl, const char *s, const = char *filename, * This helper does an early return and therefore it has to be called * before anything that would require cleanup. */ -# define VSH_REQUIRE_OPTION_EXPR(NAME1, EXPR1, NAME2, EXPR2) \ +#define VSH_REQUIRE_OPTION_EXPR(NAME1, EXPR1, NAME2, EXPR2) \ do { \ if ((EXPR1) && !(EXPR2)) { \ vshError(ctl, _("Option --%s is required by option --%s"), \ @@ -564,7 +563,7 @@ char *_vshStrdup(vshControl *ctl, const char *s, const = char *filename, * This helper does an early return and therefore it has to be called * before anything that would require cleanup. */ -# define VSH_REQUIRE_OPTION(NAME1, NAME2) \ +#define VSH_REQUIRE_OPTION(NAME1, NAME2) \ VSH_REQUIRE_OPTION_EXPR(NAME1, vshCommandOptBool(cmd, NAME1), \ NAME2, vshCommandOptBool(cmd, NAME2)) =20 @@ -580,7 +579,5 @@ char *_vshStrdup(vshControl *ctl, const char *s, const = char *filename, * This helper does an early return and therefore it has to be called * before anything that would require cleanup. */ -# define VSH_REQUIRE_OPTION_VAR(VARNAME1, VARNAME2) \ +#define VSH_REQUIRE_OPTION_VAR(VARNAME1, VARNAME2) \ VSH_REQUIRE_OPTION_EXPR(#VARNAME1, VARNAME1, #VARNAME2, VARNAME2) - -#endif /* LIBVIRT_VSH_H */ diff --git a/tools/wireshark/src/packet-libvirt.h b/tools/wireshark/src/pac= ket-libvirt.h index 3b7a0f054d..14e6e13696 100644 --- a/tools/wireshark/src/packet-libvirt.h +++ b/tools/wireshark/src/packet-libvirt.h @@ -17,10 +17,7 @@ * . */ =20 -#ifndef LIBVIRT_PACKET_LIBVIRT_H -# define LIBVIRT_PACKET_LIBVIRT_H +#pragma once =20 void proto_register_libvirt(void); void proto_reg_handoff_libvirt(void); - -#endif /* LIBVIRT_PACKET_LIBVIRT_H */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 01:28:16 2024 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=1560876170; cv=none; d=zoho.com; s=zohoarc; b=GIDUyniDpacDcbYqjuy+iGG7nW/nDx7/INGe2txxJ3IvrL6cMKn8d5keuxMW7Scn0QhWwcebcPPf33B6c5PevBvPH5njyZk0iyiv1PZpRti/wJB4aXdV3UApnbPZ5acmFZkp2f5CjBOafgyQUqBAdQu6k0mzzKq8nb1J7oy5OrE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560876170; 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=RaxT4/ObpwLapJVaPVWqFxZS2ZCIbXBhMJgIhU5349U=; b=YcmP1vDkP/MP7HpJY+WePqc/D4tNAi+oaOFtHIEw/WLWYZxw8uWpAoOYEV++LmX8IQtPyQUHPG7nVEQK1b6F6SbyKLlr2hoGsPN/598rhh6c0O0fUET6/HBriIS6TZJJKyc2q5rRHK6yiq4hB9Jk65k5daFOsRkadR5/H5cUnRY= 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 1560876170320437.2759949748448; Tue, 18 Jun 2019 09:42:50 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1B5FF30872E6; Tue, 18 Jun 2019 16:42:48 +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 E051B5C2EB; Tue, 18 Jun 2019 16:42: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 998941806B1F; Tue, 18 Jun 2019 16:42:47 +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 x5IGDhn8024467 for ; Tue, 18 Jun 2019 12:13:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id 02AC560FAB; Tue, 18 Jun 2019 16:13:43 +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 C44D18518 for ; Tue, 18 Jun 2019 16:13:42 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Tue, 18 Jun 2019 11:13:16 -0500 Message-Id: <20190618161316.1722-47-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 46/46] syntax check: update header guard check 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.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Tue, 18 Jun 2019 16:42:48 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Internal headers should use #pragma once instead of the standard #ifndef guard. Public headers still require the existing header guard. Signed-off-by: Jonathon Jongsma --- build-aux/header-ifdef.pl | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/build-aux/header-ifdef.pl b/build-aux/header-ifdef.pl index 401f25fb81..d63aae779b 100644 --- a/build-aux/header-ifdef.pl +++ b/build-aux/header-ifdef.pl @@ -6,18 +6,26 @@ # ...copyright header... # */ # -# #ifndef SYMBOL -# # define SYMBOL +# #pragma once # ....content.... -# #endif /* SYMBOL */ # -# For any file ending priv.h, before the #ifndef +#--- +# +# For any file ending priv.h, before the #pragma once # We will have a further section # # #ifndef SYMBOL_ALLOW # # error .... # #endif /* SYMBOL_ALLOW */ # +# +#--- +# +# For public headers (files in include/), use the standard header guard in= stead of #pragma once: +# #ifndef SYMBOL +# # define SYMBOL +# ....content.... +# #endif /* SYMBOL */ =20 use strict; use warnings; @@ -38,6 +46,7 @@ my $file =3D " "; my $ret =3D 0; my $ifdef =3D ""; my $ifdefpriv =3D ""; +my $publicheader =3D 0; =20 my $state =3D $STATE_EOF; my $mistake =3D 0; @@ -83,6 +92,7 @@ while (<>) { $file =3D $ARGV; $state =3D $STATE_COPYRIGHT_COMMENT; $mistake =3D 0; + $publicheader =3D ($ARGV =3D~ /\/include\//); } =20 if ($mistake || @@ -133,12 +143,19 @@ while (<>) { } elsif ($state =3D=3D $STATE_GUARD_START) { if (/^$/) { &mistake("$file: too many blank lines after copyright header"); - } elsif(/#pragma once/) { - $state =3D $STATE_PRAGMA; - } elsif (/#ifndef $ifdef$/) { - $state =3D $STATE_GUARD_DEFINE; + } + if ($publicheader) { + if (/#ifndef $ifdef$/) { + $state =3D $STATE_GUARD_DEFINE; + } else { + &mistake("$file: missing '#ifndef $ifdef'"); + } } else { - &mistake("$file: missing '#ifndef $ifdef'"); + if(/#pragma once/) { + $state =3D $STATE_PRAGMA; + } else { + &mistake("$file: missing '#pragma once' header guard"); + } } } elsif ($state =3D=3D $STATE_GUARD_DEFINE) { if (/# define $ifdef$/) { --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list