From nobody Mon Feb 9 19:04:57 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=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