Use #pragma once in driver headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Jonathon Jongsma 2019-06-07 15:20:12 -05:00 committed by Ján Tomko
parent e6635c626a
commit e97f8228b9
10 changed files with 53 additions and 92 deletions

View File

@ -18,12 +18,11 @@
* <http://www.gnu.org/licenses/>.
*/
#ifndef LIBVIRT_DRIVER_HYPERVISOR_H
# define LIBVIRT_DRIVER_HYPERVISOR_H
#pragma once
# ifndef __VIR_DRIVER_H_INCLUDES___
# error "Don't include this file directly, only use driver.h"
# endif
#ifndef __VIR_DRIVER_H_INCLUDES___
# error "Don't include this file directly, only use driver.h"
#endif
typedef int
(*virDrvConnectURIProbe)(char **uri);
@ -1581,6 +1580,3 @@ struct _virHypervisorDriver {
virDrvNodeGetSEVInfo nodeGetSEVInfo;
virDrvDomainGetLaunchSecurityInfo domainGetLaunchSecurityInfo;
};
#endif /* LIBVIRT_DRIVER_HYPERVISOR_H */

View File

@ -18,12 +18,11 @@
* <http://www.gnu.org/licenses/>.
*/
#ifndef LIBVIRT_DRIVER_INTERFACE_H
# define LIBVIRT_DRIVER_INTERFACE_H
#pragma once
# ifndef __VIR_DRIVER_H_INCLUDES___
# error "Don't include this file directly, only use driver.h"
# endif
#ifndef __VIR_DRIVER_H_INCLUDES___
# error "Don't include this file directly, only use driver.h"
#endif
typedef int
(*virDrvConnectNumOfInterfaces)(virConnectPtr conn);
@ -117,6 +116,3 @@ struct _virInterfaceDriver {
virDrvInterfaceChangeCommit interfaceChangeCommit;
virDrvInterfaceChangeRollback interfaceChangeRollback;
};
#endif /* LIBVIRT_DRIVER_INTERFACE_H */

View File

@ -18,12 +18,11 @@
* <http://www.gnu.org/licenses/>.
*/
#ifndef LIBVIRT_DRIVER_NETWORK_H
# define LIBVIRT_DRIVER_NETWORK_H
#pragma once
# ifndef __VIR_DRIVER_H_INCLUDES___
# error "Don't include this file directly, only use driver.h"
# endif
#ifndef __VIR_DRIVER_H_INCLUDES___
# error "Don't include this file directly, only use driver.h"
#endif
typedef int
(*virDrvConnectNumOfNetworks)(virConnectPtr conn);
@ -152,6 +151,3 @@ struct _virNetworkDriver {
virDrvNetworkIsPersistent networkIsPersistent;
virDrvNetworkGetDHCPLeases networkGetDHCPLeases;
};
#endif /* LIBVIRT_DRIVER_NETWORK_H */

View File

@ -18,12 +18,11 @@
* <http://www.gnu.org/licenses/>.
*/
#ifndef LIBVIRT_DRIVER_NODEDEV_H
# define LIBVIRT_DRIVER_NODEDEV_H
#pragma once
# ifndef __VIR_DRIVER_H_INCLUDES___
# error "Don't include this file directly, only use driver.h"
# endif
#ifndef __VIR_DRIVER_H_INCLUDES___
# error "Don't include this file directly, only use driver.h"
#endif
typedef int
(*virDrvNodeNumOfDevices)(virConnectPtr conn,
@ -115,6 +114,3 @@ struct _virNodeDeviceDriver {
virDrvNodeDeviceCreateXML nodeDeviceCreateXML;
virDrvNodeDeviceDestroy nodeDeviceDestroy;
};
#endif /* LIBVIRT_DRIVER_NODEDEV_H */

View File

@ -18,12 +18,11 @@
* <http://www.gnu.org/licenses/>.
*/
#ifndef LIBVIRT_DRIVER_NWFILTER_H
# define LIBVIRT_DRIVER_NWFILTER_H
#pragma once
# ifndef __VIR_DRIVER_H_INCLUDES___
# error "Don't include this file directly, only use driver.h"
# endif
#ifndef __VIR_DRIVER_H_INCLUDES___
# error "Don't include this file directly, only use driver.h"
#endif
typedef int
(*virDrvConnectNumOfNWFilters)(virConnectPtr conn);
@ -108,6 +107,3 @@ struct _virNWFilterDriver {
virDrvNWFilterBindingDelete nwfilterBindingDelete;
virDrvNWFilterBindingGetXMLDesc nwfilterBindingGetXMLDesc;
};
#endif /* LIBVIRT_DRIVER_NWFILTER_H */

View File

@ -18,12 +18,11 @@
* <http://www.gnu.org/licenses/>.
*/
#ifndef LIBVIRT_DRIVER_SECRET_H
# define LIBVIRT_DRIVER_SECRET_H
#pragma once
# ifndef __VIR_DRIVER_H_INCLUDES___
# error "Don't include this file directly, only use driver.h"
# endif
#ifndef __VIR_DRIVER_H_INCLUDES___
# error "Don't include this file directly, only use driver.h"
#endif
enum {
/* This getValue call is inside libvirt, override the "private" flag.
@ -113,6 +112,3 @@ struct _virSecretDriver {
virDrvConnectSecretEventRegisterAny connectSecretEventRegisterAny;
virDrvConnectSecretEventDeregisterAny connectSecretEventDeregisterAny;
};
#endif /* LIBVIRT_DRIVER_SECRET_H */

View File

@ -18,12 +18,11 @@
* <http://www.gnu.org/licenses/>.
*/
#ifndef LIBVIRT_DRIVER_STATE_H
# define LIBVIRT_DRIVER_STATE_H
#pragma once
# ifndef __VIR_DRIVER_H_INCLUDES___
# error "Don't include this file directly, only use driver.h"
# endif
#ifndef __VIR_DRIVER_H_INCLUDES___
# error "Don't include this file directly, only use driver.h"
#endif
typedef int
(*virDrvStateInitialize)(bool privileged,
@ -49,6 +48,3 @@ struct _virStateDriver {
virDrvStateReload stateReload;
virDrvStateStop stateStop;
};
#endif /* LIBVIRT_DRIVER_STATE_H */

View File

@ -18,12 +18,11 @@
* <http://www.gnu.org/licenses/>.
*/
#ifndef LIBVIRT_DRIVER_STORAGE_H
# define LIBVIRT_DRIVER_STORAGE_H
#pragma once
# ifndef __VIR_DRIVER_H_INCLUDES___
# error "Don't include this file directly, only use driver.h"
# endif
#ifndef __VIR_DRIVER_H_INCLUDES___
# error "Don't include this file directly, only use driver.h"
#endif
typedef int
(*virDrvConnectNumOfStoragePools)(virConnectPtr conn);
@ -279,6 +278,3 @@ struct _virStorageDriver {
virDrvStoragePoolIsActive storagePoolIsActive;
virDrvStoragePoolIsPersistent storagePoolIsPersistent;
};
#endif /* LIBVIRT_DRIVER_STORAGE_H */

View File

@ -18,12 +18,11 @@
* <http://www.gnu.org/licenses/>.
*/
#ifndef LIBVIRT_DRIVER_STREAM_H
# define LIBVIRT_DRIVER_STREAM_H
#pragma once
# ifndef __VIR_DRIVER_H_INCLUDES___
# error "Don't include this file directly, only use driver.h"
# endif
#ifndef __VIR_DRIVER_H_INCLUDES___
# error "Don't include this file directly, only use driver.h"
#endif
typedef int
(*virDrvStreamSend)(virStreamPtr st,
@ -92,6 +91,3 @@ struct _virStreamDriver {
virDrvStreamFinish streamFinish;
virDrvStreamAbort streamAbort;
};
#endif /* LIBVIRT_DRIVER_STREAM_H */

View File

@ -19,14 +19,13 @@
* <http://www.gnu.org/licenses/>.
*/
#ifndef LIBVIRT_DRIVER_H
# define LIBVIRT_DRIVER_H
#pragma once
# include <unistd.h>
#include <unistd.h>
# include "internal.h"
# include "libvirt_internal.h"
# include "viruri.h"
#include "internal.h"
#include "libvirt_internal.h"
#include "viruri.h"
/* Status codes returned from driver open call. */
@ -56,24 +55,24 @@ typedef enum {
* != 0 Feature is supported.
* 0 Feature is not supported.
*/
# define VIR_DRV_SUPPORTS_FEATURE(drv, conn, feature) \
#define VIR_DRV_SUPPORTS_FEATURE(drv, conn, feature) \
((drv)->connectSupportsFeature ? \
(drv)->connectSupportsFeature((conn), (feature)) > 0 : 0)
# define __VIR_DRIVER_H_INCLUDES___
#define __VIR_DRIVER_H_INCLUDES___
# include "driver-hypervisor.h"
# include "driver-interface.h"
# include "driver-network.h"
# include "driver-nodedev.h"
# include "driver-nwfilter.h"
# include "driver-secret.h"
# include "driver-state.h"
# include "driver-stream.h"
# include "driver-storage.h"
#include "driver-hypervisor.h"
#include "driver-interface.h"
#include "driver-network.h"
#include "driver-nodedev.h"
#include "driver-nwfilter.h"
#include "driver-secret.h"
#include "driver-state.h"
#include "driver-stream.h"
#include "driver-storage.h"
# undef __VIR_DRIVER_H_INCLUDES___
#undef __VIR_DRIVER_H_INCLUDES___
typedef struct _virConnectDriver virConnectDriver;
typedef virConnectDriver *virConnectDriverPtr;
@ -126,5 +125,3 @@ int virSetConnectNWFilter(virConnectPtr conn);
int virSetConnectNodeDev(virConnectPtr conn);
int virSetConnectSecret(virConnectPtr conn);
int virSetConnectStorage(virConnectPtr conn);
#endif /* LIBVIRT_DRIVER_H */