提交 4cfd7090 编写于 作者: D Daniel P. Berrangé

Fix many mistakes & inconsistencies in header file layout

This introduces a syntax-check script that validates header files use a
common layout:

  /*
   ...copyright header...
   */
  <one blank line>
  #ifndef SYMBOL
  # define SYMBOL
  ....content....
  #endif /* SYMBOL */

For any file ending priv.h, before the #ifndef, we will require a
guard to prevent bogus imports:

  #ifndef SYMBOL_ALLOW
  # error ....
  #endif /* SYMBOL_ALLOW */
  <one blank line>

The many mistakes this script identifies are then fixed.
Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 76ddd01e
#!/usr/bin/perl
#
# Validate that header files follow a standard layout:
#
# /*
# ...copyright header...
# */
# <one blank line>
# #ifndef SYMBOL
# # define SYMBOL
# ....content....
# #endif /* SYMBOL */
#
# For any file ending priv.h, before the #ifndef
# We will have a further section
#
# #ifndef SYMBOL_ALLOW
# # error ....
# #endif /* SYMBOL_ALLOW */
# <one blank line>
use strict;
use warnings;
my $STATE_COPYRIGHT_COMMENT = 0;
my $STATE_COPYRIGHT_BLANK = 1;
my $STATE_PRIV_START = 2;
my $STATE_PRIV_ERROR = 3;
my $STATE_PRIV_END = 4;
my $STATE_PRIV_BLANK = 5;
my $STATE_GUARD_START = 6;
my $STATE_GUARD_DEFINE = 7;
my $STATE_GUARD_END = 8;
my $STATE_EOF = 9;
my $file = " ";
my $ret = 0;
my $ifdef = "";
my $ifdefpriv = "";
my $state = $STATE_EOF;
my $mistake = 0;
sub mistake {
my $msg = shift;
warn $msg;
$mistake = 1;
$ret = 1;
}
while (<>) {
if (not $file eq $ARGV) {
if ($state == $STATE_COPYRIGHT_COMMENT) {
&mistake("$file: missing copyright comment");
} elsif ($state == $STATE_COPYRIGHT_BLANK) {
&mistake("$file: missing blank line after copyright header");
} elsif ($state == $STATE_PRIV_START) {
&mistake("$file: missing '#ifndef $ifdefpriv'");
} elsif ($state == $STATE_PRIV_ERROR) {
&mistake("$file: missing '# error ...priv allow...'");
} elsif ($state == $STATE_PRIV_END) {
&mistake("$file: missing '#endif /* $ifdefpriv */'");
} elsif ($state == $STATE_PRIV_BLANK) {
&mistake("$file: missing blank line after priv header check");
} elsif ($state == $STATE_GUARD_START) {
&mistake("$file: missing '#ifndef $ifdef'");
} elsif ($state == $STATE_GUARD_DEFINE) {
&mistake("$file: missing '# define $ifdef'");
} elsif ($state == $STATE_GUARD_END) {
&mistake("$file: missing '#endif /* $ifdef */'");
}
$file = $ARGV;
$state = $STATE_COPYRIGHT_COMMENT;
$mistake = 0;
}
if ($mistake ||
$ARGV eq "config-post.h" ||
$ARGV =~ /vbox_(CAPI|XPCOM)/) {
$state = $STATE_EOF;
next;
}
if ($state == $STATE_COPYRIGHT_COMMENT) {
if (m,\*/,) {
$state = $STATE_COPYRIGHT_BLANK;
}
} elsif ($state == $STATE_COPYRIGHT_BLANK) {
if (! /^$/) {
&mistake("$file: missing blank line after copyright header");
}
if ($ARGV =~ /priv\.h$/) {
$state = $STATE_PRIV_START;
} else {
$state = $STATE_GUARD_START;
}
} elsif ($state == $STATE_PRIV_START) {
if (/^$/) {
&mistake("$file: too many blank lines after coyright header");
} elsif (/#ifndef\s(.*ALLOW.*)/) {
$ifdefpriv = $1;
$state = $STATE_PRIV_ERROR;
} else {
&mistake("$file: missing '#ifndef SYMBOL_ALLOW'");
}
} elsif ($state == $STATE_PRIV_ERROR) {
if (/# error ".*"$/) {
$state = $STATE_PRIV_END;
} else {
&mistake("$file: missing '#error ...priv allow...'");
}
} elsif ($state == $STATE_PRIV_END) {
if (m,#endif /\* $ifdefpriv \*/,) {
$state = $STATE_PRIV_BLANK;
} else {
&mistake("$file: missing '#endif /* $ifdefpriv */'");
}
} elsif ($state == $STATE_PRIV_BLANK) {
if (! /^$/) {
&mistake("$file: missing blank line after priv guard");
}
$state = $STATE_GUARD_START;
} elsif ($state == $STATE_GUARD_START) {
if (/^$/) {
&mistake("$file: too many blank lines after coyright header");
} elsif (/#ifndef\s(.*)$/) {
$ifdef = $1;
$state = $STATE_GUARD_DEFINE;
} else {
&mistake("$file: missing '#ifndef SYMBOL'");
}
} elsif ($state == $STATE_GUARD_DEFINE) {
if (/# define $ifdef$/) {
$state = $STATE_GUARD_END;
} else {
&mistake("$file: missing '# define $ifdef'");
}
} elsif ($state == $STATE_GUARD_END) {
if (m,#endif /\* $ifdef \*/$,) {
$state = $STATE_EOF;
}
} elsif ($state == $STATE_EOF) {
die "$file: unexpected content after '#endif /* $ifdef */'";
} else {
die "$file: unexpected state $state";
}
}
exit $ret;
...@@ -1122,7 +1122,8 @@ _autogen_error: ...@@ -1122,7 +1122,8 @@ _autogen_error:
ifneq ($(_gl-Makefile),) ifneq ($(_gl-Makefile),)
syntax-check: spacing-check test-wrap-argv \ syntax-check: spacing-check test-wrap-argv \
prohibit-duplicate-header mock-noinline group-qemu-caps prohibit-duplicate-header mock-noinline group-qemu-caps \
header-ifdef
endif endif
# Don't include duplicate header in the source (either *.c or *.h) # Don't include duplicate header in the source (either *.c or *.h)
...@@ -1139,6 +1140,10 @@ mock-noinline: ...@@ -1139,6 +1140,10 @@ mock-noinline:
$(AM_V_GEN)files=`$(VC_LIST) | grep '\.[ch]$$'`; \ $(AM_V_GEN)files=`$(VC_LIST) | grep '\.[ch]$$'`; \
$(PERL) $(top_srcdir)/build-aux/mock-noinline.pl $$files $(PERL) $(top_srcdir)/build-aux/mock-noinline.pl $$files
header-ifdef:
$(AM_V_GEN)files=`$(VC_LIST) | grep '\.[h]$$'`; \
$(PERL) $(top_srcdir)/build-aux/header-ifdef.pl $$files
test-wrap-argv: test-wrap-argv:
$(AM_V_GEN)files=`$(VC_LIST) | grep -E '\.(ldargs|args)'`; \ $(AM_V_GEN)files=`$(VC_LIST) | grep -E '\.(ldargs|args)'`; \
$(PERL) $(top_srcdir)/tests/test-wrap-argv.pl --check $$files $(PERL) $(top_srcdir)/tests/test-wrap-argv.pl --check $$files
......
...@@ -55,4 +55,4 @@ typedef enum { ...@@ -55,4 +55,4 @@ typedef enum {
int virBhyveProbeGrubCaps(virBhyveGrubCapsFlags *caps); int virBhyveProbeGrubCaps(virBhyveGrubCapsFlags *caps);
int virBhyveProbeCaps(unsigned int *caps); int virBhyveProbeCaps(unsigned int *caps);
#endif #endif /* _BHYVE_CAPABILITIES */
...@@ -25,4 +25,4 @@ virDomainDefPtr bhyveParseCommandLineString(const char* nativeConfig, ...@@ -25,4 +25,4 @@ virDomainDefPtr bhyveParseCommandLineString(const char* nativeConfig,
unsigned caps, unsigned caps,
virDomainXMLOptionPtr xmlopt); virDomainXMLOptionPtr xmlopt);
#endif /* __BHYVE_PARSE_COMMAND_H__*/ #endif /* __BHYVE_PARSE_COMMAND_H__ */
...@@ -20,11 +20,10 @@ ...@@ -20,11 +20,10 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#include "internal.h"
#ifndef __DOMAIN_EVENT_H__ #ifndef __DOMAIN_EVENT_H__
# define __DOMAIN_EVENT_H__ # define __DOMAIN_EVENT_H__
# include "internal.h"
# include "object_event.h" # include "object_event.h"
# include "domain_conf.h" # include "domain_conf.h"
...@@ -325,4 +324,4 @@ virDomainQemuMonitorEventNew(int id, ...@@ -325,4 +324,4 @@ virDomainQemuMonitorEventNew(int id,
const char *details) const char *details)
ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4); ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4);
#endif #endif /* __DOMAIN_EVENT_H__ */
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
* License along with this library. If not, see * License along with this library. If not, see
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef DOMAIN_NWFILTER_H #ifndef DOMAIN_NWFILTER_H
# define DOMAIN_NWFILTER_H # define DOMAIN_NWFILTER_H
......
...@@ -27,4 +27,4 @@ ...@@ -27,4 +27,4 @@
int virNetDevVlanParse(xmlNodePtr node, xmlXPathContextPtr ctxt, virNetDevVlanPtr def); int virNetDevVlanParse(xmlNodePtr node, xmlXPathContextPtr ctxt, virNetDevVlanPtr def);
int virNetDevVlanFormat(const virNetDevVlan *def, virBufferPtr buf); int virNetDevVlanFormat(const virNetDevVlan *def, virBufferPtr buf);
#endif /* __VIR_NETDEV_VPORT_PROFILE_CONF_H__ */ #endif /* __VIR_NETDEV_VLAN_CONF_H__ */
...@@ -19,13 +19,13 @@ ...@@ -19,13 +19,13 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#include "internal.h"
#include "object_event.h"
#include "object_event_private.h"
#ifndef __NETWORK_EVENT_H__ #ifndef __NETWORK_EVENT_H__
# define __NETWORK_EVENT_H__ # define __NETWORK_EVENT_H__
# include "internal.h"
# include "object_event.h"
# include "object_event_private.h"
int int
virNetworkEventStateRegisterID(virConnectPtr conn, virNetworkEventStateRegisterID(virConnectPtr conn,
virObjectEventStatePtr state, virObjectEventStatePtr state,
...@@ -56,4 +56,4 @@ virNetworkEventLifecycleNew(const char *name, ...@@ -56,4 +56,4 @@ virNetworkEventLifecycleNew(const char *name,
int type, int type,
int detail); int detail);
#endif #endif /* __NETWORK_EVENT_H__ */
...@@ -20,13 +20,13 @@ ...@@ -20,13 +20,13 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#include "internal.h"
#include "object_event.h"
#include "object_event_private.h"
#ifndef __NODE_DEVICE_EVENT_H__ #ifndef __NODE_DEVICE_EVENT_H__
# define __NODE_DEVICE_EVENT_H__ # define __NODE_DEVICE_EVENT_H__
# include "internal.h"
# include "object_event.h"
# include "object_event_private.h"
int int
virNodeDeviceEventStateRegisterID(virConnectPtr conn, virNodeDeviceEventStateRegisterID(virConnectPtr conn,
virObjectEventStatePtr state, virObjectEventStatePtr state,
...@@ -59,4 +59,4 @@ virNodeDeviceEventLifecycleNew(const char *name, ...@@ -59,4 +59,4 @@ virNodeDeviceEventLifecycleNew(const char *name,
virObjectEventPtr virObjectEventPtr
virNodeDeviceEventUpdateNew(const char *name); virNodeDeviceEventUpdateNew(const char *name);
#endif #endif /* __NODE_DEVICE_EVENT_H__ */
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
* License along with this library. If not, see * License along with this library. If not, see
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef NWFILTER_CONF_H #ifndef NWFILTER_CONF_H
# define NWFILTER_CONF_H # define NWFILTER_CONF_H
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
* License along with this library. If not, see * License along with this library. If not, see
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef NWFILTER_PARAMS_H #ifndef NWFILTER_PARAMS_H
# define NWFILTER_PARAMS_H # define NWFILTER_PARAMS_H
......
...@@ -20,13 +20,13 @@ ...@@ -20,13 +20,13 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#include "internal.h"
#include "virobject.h"
#ifndef __OBJECT_EVENT_H__ #ifndef __OBJECT_EVENT_H__
# define __OBJECT_EVENT_H__ # define __OBJECT_EVENT_H__
# include "internal.h"
# include "virobject.h"
/** /**
* Dispatching domain events that come in while * Dispatching domain events that come in while
* in a call / response rpc * in a call / response rpc
...@@ -89,4 +89,4 @@ virObjectEventStateSetRemote(virConnectPtr conn, ...@@ -89,4 +89,4 @@ virObjectEventStateSetRemote(virConnectPtr conn,
int remoteID) int remoteID)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
#endif #endif /* __OBJECT_EVENT_H__ */
...@@ -20,11 +20,11 @@ ...@@ -20,11 +20,11 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#include "datatypes.h"
#ifndef __OBJECT_EVENT_PRIVATE_H__ #ifndef __OBJECT_EVENT_PRIVATE_H__
# define __OBJECT_EVENT_PRIVATE_H__ # define __OBJECT_EVENT_PRIVATE_H__
# include "datatypes.h"
struct _virObjectMeta { struct _virObjectMeta {
int id; int id;
char *name; char *name;
...@@ -106,4 +106,4 @@ virObjectEventNew(virClassPtr klass, ...@@ -106,4 +106,4 @@ virObjectEventNew(virClassPtr klass,
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(5) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(5)
ATTRIBUTE_NONNULL(7); ATTRIBUTE_NONNULL(7);
#endif #endif /* __OBJECT_EVENT_PRIVATE_H__ */
...@@ -52,5 +52,4 @@ char *virSecretDefFormat(const virSecretDef *def); ...@@ -52,5 +52,4 @@ char *virSecretDefFormat(const virSecretDef *def);
(VIR_CONNECT_LIST_SECRETS_FILTERS_EPHEMERAL | \ (VIR_CONNECT_LIST_SECRETS_FILTERS_EPHEMERAL | \
VIR_CONNECT_LIST_SECRETS_FILTERS_PRIVATE) VIR_CONNECT_LIST_SECRETS_FILTERS_PRIVATE)
#endif /* __VIR_SECRET_CONF_H__ */
#endif
...@@ -20,13 +20,13 @@ ...@@ -20,13 +20,13 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#include "internal.h"
#include "object_event.h"
#include "object_event_private.h"
#ifndef __SECRET_EVENT_H__ #ifndef __SECRET_EVENT_H__
# define __SECRET_EVENT_H__ # define __SECRET_EVENT_H__
# include "internal.h"
# include "object_event.h"
# include "object_event_private.h"
int int
virSecretEventStateRegisterID(virConnectPtr conn, virSecretEventStateRegisterID(virConnectPtr conn,
virObjectEventStatePtr state, virObjectEventStatePtr state,
...@@ -62,4 +62,4 @@ virSecretEventValueChangedNew(const unsigned char *uuid, ...@@ -62,4 +62,4 @@ virSecretEventValueChangedNew(const unsigned char *uuid,
int usage_type, int usage_type,
const char *usage_id); const char *usage_id);
#endif #endif /* __SECRET_EVENT_H__ */
...@@ -20,13 +20,13 @@ ...@@ -20,13 +20,13 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#include "internal.h"
#include "object_event.h"
#include "object_event_private.h"
#ifndef __STORAGE_EVENT_H__ #ifndef __STORAGE_EVENT_H__
# define __STORAGE_EVENT_H__ # define __STORAGE_EVENT_H__
# include "internal.h"
# include "object_event.h"
# include "object_event_private.h"
int int
virStoragePoolEventStateRegisterID(virConnectPtr conn, virStoragePoolEventStateRegisterID(virConnectPtr conn,
virObjectEventStatePtr state, virObjectEventStatePtr state,
...@@ -61,4 +61,4 @@ virObjectEventPtr ...@@ -61,4 +61,4 @@ virObjectEventPtr
virStoragePoolEventRefreshNew(const char *name, virStoragePoolEventRefreshNew(const char *name,
const unsigned char *uuid); const unsigned char *uuid);
#endif #endif /* __STORAGE_EVENT_H__ */
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
* License along with this library. If not, see * License along with this library. If not, see
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef __VIR_CHRDEV_H__ #ifndef __VIR_CHRDEV_H__
# define __VIR_CHRDEV_H__ # define __VIR_CHRDEV_H__
...@@ -32,4 +33,5 @@ void virChrdevFree(virChrdevsPtr devs); ...@@ -32,4 +33,5 @@ void virChrdevFree(virChrdevsPtr devs);
int virChrdevOpen(virChrdevsPtr devs, virDomainChrSourceDefPtr source, int virChrdevOpen(virChrdevsPtr devs, virDomainChrSourceDefPtr source,
virStreamPtr st, bool force); virStreamPtr st, bool force);
#endif /*__VIR_CHRDEV_H__*/
#endif /* __VIR_CHRDEV_H__ */
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
* *
*/ */
#ifndef VIR_NWFILTER_BINDING_DEF_H #ifndef VIR_NWFILTER_BINDING_DEF_H
# define VIR_NWFILTER_BINDING_DEF_H # define VIR_NWFILTER_BINDING_DEF_H
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
* *
*/ */
#ifndef VIR_NWFILTER_BINDING_OBJ_H #ifndef VIR_NWFILTER_BINDING_OBJ_H
# define VIR_NWFILTER_BINDING_OBJ_H # define VIR_NWFILTER_BINDING_OBJ_H
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
* License along with this library. If not, see * License along with this library. If not, see
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef VIRNWFILTEROBJ_H #ifndef VIRNWFILTEROBJ_H
# define VIRNWFILTEROBJ_H # define VIRNWFILTEROBJ_H
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
* License along with this library. If not, see * License along with this library. If not, see
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef __VIR_SAVE_COOKIE_H__ #ifndef __VIR_SAVE_COOKIE_H__
# define __VIR_SAVE_COOKIE_H__ # define __VIR_SAVE_COOKIE_H__
...@@ -59,4 +60,4 @@ char * ...@@ -59,4 +60,4 @@ char *
virSaveCookieFormat(virObjectPtr obj, virSaveCookieFormat(virObjectPtr obj,
virSaveCookieCallbacksPtr saveCookie); virSaveCookieCallbacksPtr saveCookie);
#endif /*__VIR_SAVE_COOKIE_H__ */ #endif /* __VIR_SAVE_COOKIE_H__ */
...@@ -777,4 +777,4 @@ int virAdmConnectCloseCallbackDataRegister(virAdmConnectCloseCallbackDataPtr cbd ...@@ -777,4 +777,4 @@ int virAdmConnectCloseCallbackDataRegister(virAdmConnectCloseCallbackDataPtr cbd
int virAdmConnectCloseCallbackDataUnregister(virAdmConnectCloseCallbackDataPtr cbdata, int virAdmConnectCloseCallbackDataUnregister(virAdmConnectCloseCallbackDataPtr cbdata,
virAdmConnectCloseFunc cb); virAdmConnectCloseFunc cb);
#endif /* __VIR_DATATYPES_H__ */ #endif /* __VIR_DATATYPES_H_ */
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef __VIR_INTERFACE__DRIVER_H #ifndef __VIR_INTERFACE__DRIVER_H
# define __VIR_INTERFACE__DRIVER_H # define __VIR_INTERFACE__DRIVER_H
......
...@@ -513,4 +513,4 @@ enum { ...@@ -513,4 +513,4 @@ enum {
# define ENODATA EIO # define ENODATA EIO
# endif # endif
#endif /* __VIR_INTERNAL_H__ */ #endif /* __VIR_INTERNAL_H__ */
...@@ -298,4 +298,4 @@ int virStreamInData(virStreamPtr stream, ...@@ -298,4 +298,4 @@ int virStreamInData(virStreamPtr stream,
int *data, int *data,
long long *length); long long *length);
#endif #endif /* __LIBVIRT_H_ */
...@@ -98,4 +98,4 @@ libxlDomainMigrationSrcConfirm(libxlDriverPrivatePtr driver, ...@@ -98,4 +98,4 @@ libxlDomainMigrationSrcConfirm(libxlDriverPrivatePtr driver,
unsigned int flags, unsigned int flags,
int cancelled); int cancelled);
#endif /* LIBXL_DRIVER_H */ #endif /* LIBXL_MIGRATION_H */
...@@ -43,4 +43,4 @@ int virLockDaemonConfigLoadFile(virLockDaemonConfigPtr data, ...@@ -43,4 +43,4 @@ int virLockDaemonConfigLoadFile(virLockDaemonConfigPtr data,
const char *filename, const char *filename,
bool allow_missing); bool allow_missing);
#endif /* __LIBVIRTD_CONFIG_H__ */ #endif /* __VIR_LOCK_DAEMON_CONFIG_H__ */
...@@ -46,4 +46,4 @@ int virLogDaemonConfigLoadFile(virLogDaemonConfigPtr data, ...@@ -46,4 +46,4 @@ int virLogDaemonConfigLoadFile(virLogDaemonConfigPtr data,
const char *filename, const char *filename,
bool allow_missing); bool allow_missing);
#endif /* __LIBVIRTD_CONFIG_H__ */ #endif /* __VIR_LOG_DAEMON_CONFIG_H__ */
...@@ -77,4 +77,4 @@ int virLogHandlerDomainAppendLogFile(virLogHandlerPtr handler, ...@@ -77,4 +77,4 @@ int virLogHandlerDomainAppendLogFile(virLogHandlerPtr handler,
virJSONValuePtr virLogHandlerPreExecRestart(virLogHandlerPtr handler); virJSONValuePtr virLogHandlerPreExecRestart(virLogHandlerPtr handler);
#endif /** __VIR_LOG_HANDLER_H__ */ #endif /* __VIR_LOG_HANDLER_H__ */
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef __VIR_LOG_MANAGER_H__ #ifndef __VIR_LOG_MANAGER_H__
# define __VIR_LOG_MANAGER_H__ # define __VIR_LOG_MANAGER_H__
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef __LXC_DOMAIN_H__ #ifndef __LXC_DOMAIN_H__
# define __LXC_DOMAIN_H__ # define __LXC_DOMAIN_H__
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef __VIR_NETWORK__DRIVER_H #ifndef __VIR_NETWORK__DRIVER_H
# define __VIR_NETWORK__DRIVER_H # define __VIR_NETWORK__DRIVER_H
......
...@@ -18,8 +18,13 @@ ...@@ -18,8 +18,13 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#include <libudev.h> #ifndef __NODE_DEVICE_UDEV_H__
# define __NODE_DEVICE_UDEV_H__
#define SYSFS_DATA_SIZE 4096 # include <libudev.h>
#define DMI_DEVPATH "/sys/devices/virtual/dmi/id"
#define DMI_DEVPATH_FALLBACK "/sys/class/dmi/id" # define SYSFS_DATA_SIZE 4096
# define DMI_DEVPATH "/sys/devices/virtual/dmi/id"
# define DMI_DEVPATH_FALLBACK "/sys/class/dmi/id"
#endif /* __NODE_DEVICE_UDEV_H__ */
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
* License along with this library. If not, see * License along with this library. If not, see
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef VIR_NWFILTER_EBTABLES_DRIVER_H__ #ifndef VIR_NWFILTER_EBTABLES_DRIVER_H__
# define VIR_NWFILTER_EBTABLES_DRIVER_H__ # define VIR_NWFILTER_EBTABLES_DRIVER_H__
...@@ -31,4 +32,4 @@ extern virNWFilterTechDriver ebiptables_driver; ...@@ -31,4 +32,4 @@ extern virNWFilterTechDriver ebiptables_driver;
# define IPTABLES_MAX_COMMENT_LENGTH 256 # define IPTABLES_MAX_COMMENT_LENGTH 256
#endif #endif /* VIR_NWFILTER_EBTABLES_DRIVER_H__ */
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
* License along with this library. If not, see * License along with this library. If not, see
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef __NWFILTER_GENTECH_DRIVER_H #ifndef __NWFILTER_GENTECH_DRIVER_H
# define __NWFILTER_GENTECH_DRIVER_H # define __NWFILTER_GENTECH_DRIVER_H
...@@ -55,4 +56,4 @@ virHashTablePtr virNWFilterCreateVarHashmap(const char *macaddr, ...@@ -55,4 +56,4 @@ virHashTablePtr virNWFilterCreateVarHashmap(const char *macaddr,
int virNWFilterBuildAll(virNWFilterDriverStatePtr driver, int virNWFilterBuildAll(virNWFilterDriverStatePtr driver,
bool newFilters); bool newFilters);
#endif #endif /* __NWFILTER_GENTECH_DRIVER_H */
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef OPENVZ_DRIVER_H #ifndef OPENVZ_DRIVER_H
# define OPENVZ_DRIVER_H # define OPENVZ_DRIVER_H
...@@ -38,4 +37,4 @@ ...@@ -38,4 +37,4 @@
int openvzRegister(void); int openvzRegister(void);
#endif #endif /* OPENVZ_DRIVER_H */
...@@ -19,11 +19,10 @@ ...@@ -19,11 +19,10 @@
* *
*/ */
#ifndef OPENVZ_UTIL_H #ifndef OPENVZ_UTIL_H
# define OPENVZ_UTIL_H # define OPENVZ_UTIL_H
long openvzKBPerPages(void); long openvzKBPerPages(void);
char *openvzVEGetStringParam(virDomainPtr dom, const char *param); char *openvzVEGetStringParam(virDomainPtr dom, const char *param);
#endif #endif /* OPENVZ_UTIL_H */
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef __QEMU_AGENT_H__ #ifndef __QEMU_AGENT_H__
# define __QEMU_AGENT_H__ # define __QEMU_AGENT_H__
......
...@@ -97,4 +97,4 @@ const char *qemuDomainGetManagedPRAlias(void); ...@@ -97,4 +97,4 @@ const char *qemuDomainGetManagedPRAlias(void);
char *qemuDomainGetUnmanagedPRAlias(const char *parentalias); char *qemuDomainGetUnmanagedPRAlias(const char *parentalias);
#endif /* __QEMU_ALIAS_H__*/ #endif /* __QEMU_ALIAS_H__ */
...@@ -636,4 +636,4 @@ bool virQEMUCapsCPUFilterFeatures(const char *name, ...@@ -636,4 +636,4 @@ bool virQEMUCapsCPUFilterFeatures(const char *name,
virSEVCapabilityPtr virSEVCapabilityPtr
virQEMUCapsGetSEVCapabilities(virQEMUCapsPtr qemuCaps); virQEMUCapsGetSEVCapabilities(virQEMUCapsPtr qemuCaps);
#endif /* __QEMU_CAPABILITIES_H__*/ #endif /* __QEMU_CAPABILITIES_H__ */
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#ifndef __QEMU_CAPSPRIV_H_ALLOW__ #ifndef __QEMU_CAPSPRIV_H_ALLOW__
# error "qemu_capspriv.h may only be included by qemu_capabilities.c or test suites" # error "qemu_capspriv.h may only be included by qemu_capabilities.c or test suites"
#endif #endif /* __QEMU_CAPSPRIV_H_ALLOW__ */
#ifndef __QEMU_CAPSPRIV_H__ #ifndef __QEMU_CAPSPRIV_H__
# define __QEMU_CAPSPRIV_H__ # define __QEMU_CAPSPRIV_H__
...@@ -98,4 +98,5 @@ virQEMUCapsSetMicrocodeVersion(virQEMUCapsPtr qemuCaps, ...@@ -98,4 +98,5 @@ virQEMUCapsSetMicrocodeVersion(virQEMUCapsPtr qemuCaps,
void void
virQEMUCapsStripMachineAliases(virQEMUCapsPtr qemuCaps); virQEMUCapsStripMachineAliases(virQEMUCapsPtr qemuCaps);
#endif
#endif /* __QEMU_CAPSPRIV_H__ */
...@@ -227,4 +227,4 @@ qemuBuildTPMOpenBackendFDs(const char *tpmdev, ...@@ -227,4 +227,4 @@ qemuBuildTPMOpenBackendFDs(const char *tpmdev,
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
ATTRIBUTE_NONNULL(4); ATTRIBUTE_NONNULL(4);
#endif /* __QEMU_COMMAND_H__*/ #endif /* __QEMU_COMMAND_H__ */
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
*/ */
#ifndef __QEMU_DOMAIN_ADDRESS_H__ #ifndef __QEMU_DOMAIN_ADDRESS_H__
# define __QEMU_DOMAIN_ADDRESS_H__
# include "domain_addr.h" # include "domain_addr.h"
# include "domain_conf.h" # include "domain_conf.h"
...@@ -65,6 +66,4 @@ int qemuDomainEnsureVirtioAddress(bool *releaseAddr, ...@@ -65,6 +66,4 @@ int qemuDomainEnsureVirtioAddress(bool *releaseAddr,
virDomainDeviceDefPtr dev, virDomainDeviceDefPtr dev,
const char *devicename); const char *devicename);
# define __QEMU_DOMAIN_ADDRESS_H__
#endif /* __QEMU_DOMAIN_ADDRESS_H__ */ #endif /* __QEMU_DOMAIN_ADDRESS_H__ */
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
* License along with this library. If not, see * License along with this library. If not, see
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef __QEMU_EXTDEVICE_H__ #ifndef __QEMU_EXTDEVICE_H__
# define __QEMU_EXTDEVICE_H__ # define __QEMU_EXTDEVICE_H__
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <config.h> #include <config.h>
#include "qemu_hotplug.h" #include "qemu_hotplug.h"
#define __QEMU_HOTPLUGPRIV_H_ALLOW__
#include "qemu_hotplugpriv.h" #include "qemu_hotplugpriv.h"
#include "qemu_alias.h" #include "qemu_alias.h"
#include "qemu_capabilities.h" #include "qemu_capabilities.h"
......
...@@ -19,6 +19,10 @@ ...@@ -19,6 +19,10 @@
* *
*/ */
#ifndef __QEMU_HOTPLUGPRIV_H_ALLOW__
# error "qemu_hotplugpriv.h may only be included by qemu_hotplug.c or test suites"
#endif /* __QEMU_HOTPLUGPRIV_H_ALLOW__ */
#ifndef __QEMU_HOTPLUGPRIV_H__ #ifndef __QEMU_HOTPLUGPRIV_H__
# define __QEMU_HOTPLUGPRIV_H__ # define __QEMU_HOTPLUGPRIV_H__
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "qemu_hotplug.h" #include "qemu_hotplug.h"
#include "qemu_migration.h" #include "qemu_migration.h"
#include "qemu_migration_params.h" #include "qemu_migration_params.h"
#define __QEMU_MIGRATION_PARAMSPRIV_H_ALLOW__
#include "qemu_migration_paramspriv.h" #include "qemu_migration_paramspriv.h"
#include "qemu_monitor.h" #include "qemu_monitor.h"
......
...@@ -19,6 +19,10 @@ ...@@ -19,6 +19,10 @@
* *
*/ */
#ifndef __QEMU_MIGRATION_PARAMSPRIV_H_ALLOW__
# error "qemu_migration_paramspriv.h may only be included by qemu_migration_params.c or test suites"
#endif /* __QEMU_MIGRATION_PARAMSPRIV_H_ALLOW__ */
#ifndef __QEMU_MIGRATION_PARAMSPRIV_H__ #ifndef __QEMU_MIGRATION_PARAMSPRIV_H__
# define __QEMU_MIGRATION_PARAMSPRIV_H__ # define __QEMU_MIGRATION_PARAMSPRIV_H__
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef QEMU_MONITOR_H #ifndef QEMU_MONITOR_H
# define QEMU_MONITOR_H # define QEMU_MONITOR_H
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef QEMU_MONITOR_JSON_H #ifndef QEMU_MONITOR_JSON_H
# define QEMU_MONITOR_JSON_H # define QEMU_MONITOR_JSON_H
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#ifndef __QEMU_MONITOR_PRIV_H_ALLOW__ #ifndef __QEMU_MONITOR_PRIV_H_ALLOW__
# error "qemu_monitor_priv.h may only be included by qemu_monitor.c or test suites" # error "qemu_monitor_priv.h may only be included by qemu_monitor.c or test suites"
#endif #endif /* __QEMU_MONITOR_PRIV_H_ALLOW__ */
#ifndef __QEMU_MONITOR_PRIV_H__ #ifndef __QEMU_MONITOR_PRIV_H__
# define __QEMU_MONITOR_PRIV_H__ # define __QEMU_MONITOR_PRIV_H__
...@@ -28,4 +28,4 @@ ...@@ -28,4 +28,4 @@
void void
qemuMonitorResetCommandID(qemuMonitorPtr mon); qemuMonitorResetCommandID(qemuMonitorPtr mon);
#endif #endif /* __QEMU_MONITOR_PRIV_H__ */
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef QEMU_MONITOR_TEXT_H #ifndef QEMU_MONITOR_TEXT_H
# define QEMU_MONITOR_TEXT_H # define QEMU_MONITOR_TEXT_H
......
...@@ -57,4 +57,4 @@ qemuParseKeywords(const char *str, ...@@ -57,4 +57,4 @@ qemuParseKeywords(const char *str,
int *retnkeywords, int *retnkeywords,
int allowEmptyValue); int allowEmptyValue);
#endif /* __QEMU_PARSE_COMMAND_H__*/ #endif /* __QEMU_PARSE_COMMAND_H__ */
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include <sys/utsname.h> #include <sys/utsname.h>
#include "qemu_process.h" #include "qemu_process.h"
#define __QEMU_PROCESS_PRIV_H_ALLOW__
#include "qemu_processpriv.h" #include "qemu_processpriv.h"
#include "qemu_alias.h" #include "qemu_alias.h"
#include "qemu_block.h" #include "qemu_block.h"
......
...@@ -19,6 +19,10 @@ ...@@ -19,6 +19,10 @@
* *
*/ */
#ifndef __QEMU_PROCESS_PRIV_H_ALLOW__
# error "qemu_process_priv.h may only be included by qemu_process.c or test suites"
#endif /* __QEMU_PROCESS_PRIV_H_ALLOW__ */
#ifndef __QEMU_PROCESSPRIV_H__ #ifndef __QEMU_PROCESSPRIV_H__
# define __QEMU_PROCESSPRIV_H__ # define __QEMU_PROCESSPRIV_H__
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
* License along with this library. If not, see * License along with this library. If not, see
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef __QEMU_TPM_H__ #ifndef __QEMU_TPM_H__
# define __QEMU_TPM_H__ # define __QEMU_TPM_H__
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef __REMOTE_DAEMON_H__ #ifndef __REMOTE_DAEMON_H__
# define __REMOTE_DAEMON_H__ # define __REMOTE_DAEMON_H__
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef __REMOTE_DAEMON_STREAM_H__ #ifndef __REMOTE_DAEMON_STREAM_H__
# define __REMOTE_DAEMON_STREAM_H__ # define __REMOTE_DAEMON_STREAM_H__
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
* License along with this library. If not, see * License along with this library. If not, see
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef __VIR_NET_LIBSSH_SESSION_H__ #ifndef __VIR_NET_LIBSSH_SESSION_H__
# define __VIR_NET_LIBSSH_SESSION_H__ # define __VIR_NET_LIBSSH_SESSION_H__
...@@ -72,4 +73,4 @@ ssize_t virNetLibsshChannelWrite(virNetLibsshSessionPtr sess, ...@@ -72,4 +73,4 @@ ssize_t virNetLibsshChannelWrite(virNetLibsshSessionPtr sess,
bool virNetLibsshSessionHasCachedData(virNetLibsshSessionPtr sess); bool virNetLibsshSessionHasCachedData(virNetLibsshSessionPtr sess);
#endif /* ___VIR_NET_LIBSSH_SESSION_H_ */ #endif /* __VIR_NET_LIBSSH_SESSION_H__ */
...@@ -88,4 +88,4 @@ void virNetServerServiceToggle(virNetServerServicePtr svc, ...@@ -88,4 +88,4 @@ void virNetServerServiceToggle(virNetServerServicePtr svc,
void virNetServerServiceClose(virNetServerServicePtr svc); void virNetServerServiceClose(virNetServerServicePtr svc);
#endif #endif /* __VIR_NET_SERVER_SERVICE_H__ */
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
* License along with this library. If not, see * License along with this library. If not, see
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef __VIR_NET_SSH_SESSION_H__ #ifndef __VIR_NET_SSH_SESSION_H__
# define __VIR_NET_SSH_SESSION_H__ # define __VIR_NET_SSH_SESSION_H__
...@@ -84,4 +85,4 @@ ssize_t virNetSSHChannelWrite(virNetSSHSessionPtr sess, ...@@ -84,4 +85,4 @@ ssize_t virNetSSHChannelWrite(virNetSSHSessionPtr sess,
bool virNetSSHSessionHasCachedData(virNetSSHSessionPtr sess); bool virNetSSHSessionHasCachedData(virNetSSHSessionPtr sess);
#endif /* ___VIR_NET_SSH_SESSION_H_ */ #endif /* __VIR_NET_SSH_SESSION_H__ */
...@@ -100,4 +100,4 @@ int virNetTLSSessionGetKeySize(virNetTLSSessionPtr sess); ...@@ -100,4 +100,4 @@ int virNetTLSSessionGetKeySize(virNetTLSSessionPtr sess);
const char *virNetTLSSessionGetX509DName(virNetTLSSessionPtr sess); const char *virNetTLSSessionGetX509DName(virNetTLSSessionPtr sess);
#endif #endif /* __VIR_NET_TLS_CONTEXT_H__ */
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
* License along with this library. If not, see * License along with this library. If not, see
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef __VIR_SECURITY_APPARMOR_H__ #ifndef __VIR_SECURITY_APPARMOR_H__
# define __VIR_SECURITY_APPARMOR_H__ # define __VIR_SECURITY_APPARMOR_H__
......
...@@ -18,11 +18,11 @@ ...@@ -18,11 +18,11 @@
* POSIX DAC security driver * POSIX DAC security driver
*/ */
#include "security_driver.h"
#ifndef __VIR_SECURITY_DAC #ifndef __VIR_SECURITY_DAC
# define __VIR_SECURITY_DAC # define __VIR_SECURITY_DAC
# include "security_driver.h"
extern virSecurityDriver virSecurityDriverDAC; extern virSecurityDriver virSecurityDriverDAC;
int virSecurityDACSetUserAndGroup(virSecurityManagerPtr mgr, int virSecurityDACSetUserAndGroup(virSecurityManagerPtr mgr,
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
* License along with this library. If not, see * License along with this library. If not, see
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef __VIR_SECURITY_H__ #ifndef __VIR_SECURITY_H__
# define __VIR_SECURITY_H__ # define __VIR_SECURITY_H__
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
* License along with this library. If not, see * License along with this library. If not, see
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef __VIR_SECURITY_SELINUX_H__ #ifndef __VIR_SECURITY_SELINUX_H__
# define __VIR_SECURITY_SELINUX_H__ # define __VIR_SECURITY_SELINUX_H__
......
...@@ -18,11 +18,11 @@ ...@@ -18,11 +18,11 @@
* Stacked security driver * Stacked security driver
*/ */
#include "security_driver.h"
#ifndef __VIR_SECURITY_STACK #ifndef __VIR_SECURITY_STACK
# define __VIR_SECURITY_STACK # define __VIR_SECURITY_STACK
# include "security_driver.h"
extern virSecurityDriver virSecurityDriverStack; extern virSecurityDriver virSecurityDriverStack;
......
/*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef __VIR_STORAGE_BACKEND_ISCSI_H__ #ifndef __VIR_STORAGE_BACKEND_ISCSI_H__
# define __VIR_STORAGE_BACKEND_ISCSI_H__ # define __VIR_STORAGE_BACKEND_ISCSI_H__
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include "virerror.h" #include "virerror.h"
#include "storage_backend_sheepdog.h" #include "storage_backend_sheepdog.h"
#define __VIR_STORAGE_BACKEND_SHEEPDOG_PRIV_ALLOW_H__
#include "storage_backend_sheepdog_priv.h" #include "storage_backend_sheepdog_priv.h"
#include "storage_conf.h" #include "storage_conf.h"
#include "vircommand.h" #include "vircommand.h"
......
...@@ -16,6 +16,10 @@ ...@@ -16,6 +16,10 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef __VIR_STORAGE_BACKEND_SHEEPDOG_PRIV_ALLOW_H__
# error "storage_backend_sheepdog_priv.h may only be included by storage_backend_sheepdog.c or test suites"
#endif /* __VIR_STORAGE_BACKEND_SHEEPDOG_PRIV_ALLOW_H__ */
#ifndef __VIR_STORAGE_BACKEND_SHEEPDOG_PRIV_H__ #ifndef __VIR_STORAGE_BACKEND_SHEEPDOG_PRIV_H__
# define __VIR_STORAGE_BACKEND_SHEEPDOG_PRIV_H__ # define __VIR_STORAGE_BACKEND_SHEEPDOG_PRIV_H__
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef UML_DRIVER_H #ifndef UML_DRIVER_H
# define UML_DRIVER_H # define UML_DRIVER_H
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
* *
*/ */
#ifndef __VIR_MEMORY_H_ #ifndef __VIR_MEMORY_H_
# define __VIR_MEMORY_H_ # define __VIR_MEMORY_H_
......
...@@ -451,4 +451,4 @@ virAtomicIntXor(volatile unsigned int *atomic, ...@@ -451,4 +451,4 @@ virAtomicIntXor(volatile unsigned int *atomic,
# endif # endif
#endif /* __VIR_ATOMIC_H */ #endif /* __VIR_ATOMIC_H__ */
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
* *
*/ */
#ifndef __LIBVIRT_AUDIT_H__ #ifndef __LIBVIRT_AUDIT_H__
# define __LIBVIRT_AUDIT_H__ # define __LIBVIRT_AUDIT_H__
......
...@@ -156,4 +156,4 @@ void virBitmapShrink(virBitmapPtr map, size_t b); ...@@ -156,4 +156,4 @@ void virBitmapShrink(virBitmapPtr map, size_t b);
VIR_DEFINE_AUTOPTR_FUNC(virBitmap, virBitmapFree) VIR_DEFINE_AUTOPTR_FUNC(virBitmap, virBitmapFree)
#endif #endif /* __BITMAP_H__ */
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#ifndef __VIR_CGROUP_ALLOW_INCLUDE_PRIV_H__ #ifndef __VIR_CGROUP_ALLOW_INCLUDE_PRIV_H__
# error "vircgrouppriv.h may only be included by vircgroup.c or its test suite" # error "vircgrouppriv.h may only be included by vircgroup.c or its test suite"
#endif #endif /* __VIR_CGROUP_ALLOW_INCLUDE_PRIV_H__ */
#ifndef __VIR_CGROUP_PRIV_H__ #ifndef __VIR_CGROUP_PRIV_H__
# define __VIR_CGROUP_PRIV_H__ # define __VIR_CGROUP_PRIV_H__
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#ifndef __VIR_COMMAND_PRIV_H_ALLOW__ #ifndef __VIR_COMMAND_PRIV_H_ALLOW__
# error "vircommandpriv.h may only be included by vircommand.c or test suites" # error "vircommandpriv.h may only be included by vircommand.c or test suites"
#endif #endif /* __VIR_COMMAND_PRIV_H_ALLOW__ */
#ifndef __VIR_COMMAND_PRIV_H__ #ifndef __VIR_COMMAND_PRIV_H__
# define __VIR_COMMAND_PRIV_H__ # define __VIR_COMMAND_PRIV_H__
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <config.h> #include <config.h>
#define __VIR_DBUS_PRIV_H_ALLOW__
#include "virdbuspriv.h" #include "virdbuspriv.h"
#include "viralloc.h" #include "viralloc.h"
#include "virerror.h" #include "virerror.h"
......
...@@ -19,6 +19,10 @@ ...@@ -19,6 +19,10 @@
* *
*/ */
#ifndef __VIR_DBUS_PRIV_H_ALLOW__
# error "virdbuspriv.h may only be included by virdbus.c or test suites"
#endif /* __VIR_DBUS_PRIV_H_ALLOW__ */
#ifndef __VIR_DBUS_PRIV_H__ #ifndef __VIR_DBUS_PRIV_H__
# define __VIR_DBUS_PRIV_H__ # define __VIR_DBUS_PRIV_H__
......
...@@ -38,4 +38,4 @@ int ebtablesRemoveForwardAllowIn (ebtablesContext *ctx, ...@@ -38,4 +38,4 @@ int ebtablesRemoveForwardAllowIn (ebtablesContext *ctx,
int ebtablesAddForwardPolicyReject(ebtablesContext *ctx); int ebtablesAddForwardPolicyReject(ebtablesContext *ctx);
#endif /* __QEMUD_ebtabLES_H__ */ #endif /* __QEMUD_EBTABLES_H__ */
...@@ -208,4 +208,4 @@ void virErrorRestore(virErrorPtr *savederr); ...@@ -208,4 +208,4 @@ void virErrorRestore(virErrorPtr *savederr);
VIR_DEFINE_AUTOPTR_FUNC(virError, virFreeError) VIR_DEFINE_AUTOPTR_FUNC(virError, virFreeError)
#endif #endif /* __VIRT_ERROR_H_ */
...@@ -127,4 +127,4 @@ int virEventPollToNativeEvents(int events); ...@@ -127,4 +127,4 @@ int virEventPollToNativeEvents(int events);
int virEventPollInterrupt(void); int virEventPollInterrupt(void);
#endif /* __VIRTD_EVENT_H__ */ #endif /* __VIR_EVENT_POLL_H__ */
...@@ -29,4 +29,4 @@ virFCReadRportValue(const char *rport, ...@@ -29,4 +29,4 @@ virFCReadRportValue(const char *rport,
const char *entry, const char *entry,
char **result); char **result);
#endif #endif /* __VIR_FCP_H__ */
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
* *
*/ */
#ifndef __VIR_FDSTREAM_H_ #ifndef __VIR_FDSTREAM_H_
# define __VIR_FDSTREAM_H_ # define __VIR_FDSTREAM_H_
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
* *
*/ */
#ifndef __VIR_FILE_H_ #ifndef __VIR_FILE_H_
# define __VIR_FILE_H_ # define __VIR_FILE_H_
...@@ -383,4 +382,4 @@ int virFileInData(int fd, ...@@ -383,4 +382,4 @@ int virFileInData(int fd,
VIR_DEFINE_AUTOPTR_FUNC(virFileWrapperFd, virFileWrapperFdFree) VIR_DEFINE_AUTOPTR_FUNC(virFileWrapperFd, virFileWrapperFdFree)
#endif /* __VIR_FILE_H */ #endif /* __VIR_FILE_H_ */
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#ifndef __VIR_FIREWALL_PRIV_H_ALLOW__ #ifndef __VIR_FIREWALL_PRIV_H_ALLOW__
# error "virfirewallpriv.h may only be included by virfirewall.c or test suites" # error "virfirewallpriv.h may only be included by virfirewall.c or test suites"
#endif #endif /* __VIR_FIREWALL_PRIV_H_ALLOW__ */
#ifndef __VIR_FIREWALL_PRIV_H__ #ifndef __VIR_FIREWALL_PRIV_H__
# define __VIR_FIREWALL_PRIV_H__ # define __VIR_FIREWALL_PRIV_H__
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
* License along with this library. If not, see * License along with this library. If not, see
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef __VIR_GETTEXT_H__ #ifndef __VIR_GETTEXT_H__
# define __VIR_GETTEXT_H__ # define __VIR_GETTEXT_H__
......
...@@ -199,4 +199,4 @@ void virHashValueFree(void *value, const void *name); ...@@ -199,4 +199,4 @@ void virHashValueFree(void *value, const void *name);
VIR_DEFINE_AUTOPTR_FUNC(virHashTable, virHashFree) VIR_DEFINE_AUTOPTR_FUNC(virHashTable, virHashFree)
#endif /* ! __VIR_HASH_H__ */ #endif /* __VIR_HASH_H__ */
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include "c-ctype.h" #include "c-ctype.h"
#include "viralloc.h" #include "viralloc.h"
#define __VIR_HOSTCPU_PRIV_H_ALLOW__
#include "virhostcpupriv.h" #include "virhostcpupriv.h"
#include "physmem.h" #include "physmem.h"
#include "virerror.h" #include "virerror.h"
......
...@@ -66,4 +66,4 @@ int virHostCPUGetOnline(unsigned int cpu, bool *online); ...@@ -66,4 +66,4 @@ int virHostCPUGetOnline(unsigned int cpu, bool *online);
unsigned int virHostCPUGetMicrocodeVersion(void); unsigned int virHostCPUGetMicrocodeVersion(void);
#endif /* __VIR_HOSTCPU_H__*/ #endif /* __VIR_HOSTCPU_H__ */
...@@ -19,6 +19,10 @@ ...@@ -19,6 +19,10 @@
* *
*/ */
#ifndef __VIR_HOSTCPU_PRIV_H_ALLOW__
# error "virhostcpupriv.h may only be included by virhostcpu.c or test suites"
#endif /* __VIR_HOSTCPU_PRIV_H_ALLOW__ */
#ifndef __VIR_HOSTCPU_PRIV_H__ #ifndef __VIR_HOSTCPU_PRIV_H__
# define __VIR_HOSTCPU_PRIV_H__ # define __VIR_HOSTCPU_PRIV_H__
......
...@@ -55,4 +55,4 @@ int virHostMemAllocPages(unsigned int npages, ...@@ -55,4 +55,4 @@ int virHostMemAllocPages(unsigned int npages,
unsigned int cellCount, unsigned int cellCount,
bool add); bool add);
#endif /* __VIR_HOSTMEM_H__*/ #endif /* __VIR_HOSTMEM_H__ */
...@@ -35,4 +35,4 @@ typedef enum { ...@@ -35,4 +35,4 @@ typedef enum {
int virInitctlSetRunLevel(virInitctlRunLevel level); int virInitctlSetRunLevel(virInitctlRunLevel level);
#endif #endif /* __VIR_INITCTL_H__ */
...@@ -68,4 +68,5 @@ virISCSINodeUpdate(const char *portal, ...@@ -68,4 +68,5 @@ virISCSINodeUpdate(const char *portal,
const char *value) const char *value)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK; ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
#endif
#endif /* __VIR_ISCSI_H__ */
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
* *
*/ */
#ifndef __VIR_JSON_H_ #ifndef __VIR_JSON_H_
# define __VIR_JSON_H_ # define __VIR_JSON_H_
......
...@@ -30,4 +30,4 @@ int virKeycodeValueTranslate(virKeycodeSet from_codeset, ...@@ -30,4 +30,4 @@ int virKeycodeValueTranslate(virKeycodeSet from_codeset,
virKeycodeSet to_offset, virKeycodeSet to_offset,
int key_value); int key_value);
#endif #endif /* __VIR_UTIL_VIRTKEYCODE_H__ */
...@@ -41,4 +41,5 @@ int virLeaseNew(virJSONValuePtr *lease_ret, ...@@ -41,4 +41,5 @@ int virLeaseNew(virJSONValuePtr *lease_ret,
const char *hostname, const char *hostname,
const char *iaid, const char *iaid,
const char *server_duid); const char *server_duid);
#endif /* __VIR_LEASE_H */
#endif /* __VIR_LEASE_H_ */
...@@ -239,4 +239,4 @@ int virLogParseOutputs(const char *src, ...@@ -239,4 +239,4 @@ int virLogParseOutputs(const char *src,
int virLogParseFilters(const char *src, int virLogParseFilters(const char *src,
virLogFilterPtr **filters) ATTRIBUTE_NONNULL(1); virLogFilterPtr **filters) ATTRIBUTE_NONNULL(1);
#endif #endif /* __VIRTLOG_H_ */
...@@ -46,4 +46,5 @@ int virMacMapWriteFile(virMacMapPtr mgr, ...@@ -46,4 +46,5 @@ int virMacMapWriteFile(virMacMapPtr mgr,
int virMacMapDumpStr(virMacMapPtr mgr, int virMacMapDumpStr(virMacMapPtr mgr,
char **str); char **str);
#endif /* __VIR_MACMAPPING_H__ */
#endif /* __VIR_MACMAP_H__ */
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
* License along with this library. If not, see * License along with this library. If not, see
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef __VIR_NETDEV_VLAN_H__ #ifndef __VIR_NETDEV_VLAN_H__
# define __VIR_NETDEV_VLAN_H__ # define __VIR_NETDEV_VLAN_H__
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册