--- /dev/null
+#!/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;
ifneq ($(_gl-Makefile),)
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
# Don't include duplicate header in the source (either *.c or *.h)
$(AM_V_GEN)files=`$(VC_LIST) | grep '\.[ch]$$'`; \
$(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:
$(AM_V_GEN)files=`$(VC_LIST) | grep -E '\.(ldargs|args)'`; \
$(PERL) $(top_srcdir)/tests/test-wrap-argv.pl --check $$files
int virBhyveProbeGrubCaps(virBhyveGrubCapsFlags *caps);
int virBhyveProbeCaps(unsigned int *caps);
-#endif
+#endif /* _BHYVE_CAPABILITIES */
unsigned caps,
virDomainXMLOptionPtr xmlopt);
-#endif /* __BHYVE_PARSE_COMMAND_H__*/
+#endif /* __BHYVE_PARSE_COMMAND_H__ */
* <http://www.gnu.org/licenses/>.
*/
-#include "internal.h"
-
#ifndef __DOMAIN_EVENT_H__
# define __DOMAIN_EVENT_H__
+# include "internal.h"
# include "object_event.h"
# include "domain_conf.h"
const char *details)
ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4);
-#endif
+#endif /* __DOMAIN_EVENT_H__ */
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
+
#ifndef DOMAIN_NWFILTER_H
# define DOMAIN_NWFILTER_H
int virNetDevVlanParse(xmlNodePtr node, xmlXPathContextPtr ctxt, virNetDevVlanPtr def);
int virNetDevVlanFormat(const virNetDevVlan *def, virBufferPtr buf);
-#endif /* __VIR_NETDEV_VPORT_PROFILE_CONF_H__ */
+#endif /* __VIR_NETDEV_VLAN_CONF_H__ */
* <http://www.gnu.org/licenses/>.
*/
-#include "internal.h"
-#include "object_event.h"
-#include "object_event_private.h"
-
#ifndef __NETWORK_EVENT_H__
# define __NETWORK_EVENT_H__
+# include "internal.h"
+# include "object_event.h"
+# include "object_event_private.h"
+
int
virNetworkEventStateRegisterID(virConnectPtr conn,
virObjectEventStatePtr state,
int type,
int detail);
-#endif
+#endif /* __NETWORK_EVENT_H__ */
* <http://www.gnu.org/licenses/>.
*/
-#include "internal.h"
-#include "object_event.h"
-#include "object_event_private.h"
-
#ifndef __NODE_DEVICE_EVENT_H__
# define __NODE_DEVICE_EVENT_H__
+# include "internal.h"
+# include "object_event.h"
+# include "object_event_private.h"
+
int
virNodeDeviceEventStateRegisterID(virConnectPtr conn,
virObjectEventStatePtr state,
virObjectEventPtr
virNodeDeviceEventUpdateNew(const char *name);
-#endif
+#endif /* __NODE_DEVICE_EVENT_H__ */
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
+
#ifndef NWFILTER_CONF_H
# define NWFILTER_CONF_H
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
+
#ifndef NWFILTER_PARAMS_H
# define NWFILTER_PARAMS_H
* <http://www.gnu.org/licenses/>.
*/
-#include "internal.h"
-
-#include "virobject.h"
-
#ifndef __OBJECT_EVENT_H__
# define __OBJECT_EVENT_H__
+# include "internal.h"
+
+# include "virobject.h"
+
/**
* Dispatching domain events that come in while
* in a call / response rpc
int remoteID)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
-#endif
+#endif /* __OBJECT_EVENT_H__ */
* <http://www.gnu.org/licenses/>.
*/
-#include "datatypes.h"
-
#ifndef __OBJECT_EVENT_PRIVATE_H__
# define __OBJECT_EVENT_PRIVATE_H__
+# include "datatypes.h"
+
struct _virObjectMeta {
int id;
char *name;
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(5)
ATTRIBUTE_NONNULL(7);
-#endif
+#endif /* __OBJECT_EVENT_PRIVATE_H__ */
(VIR_CONNECT_LIST_SECRETS_FILTERS_EPHEMERAL | \
VIR_CONNECT_LIST_SECRETS_FILTERS_PRIVATE)
-
-#endif
+#endif /* __VIR_SECRET_CONF_H__ */
* <http://www.gnu.org/licenses/>.
*/
-#include "internal.h"
-#include "object_event.h"
-#include "object_event_private.h"
-
#ifndef __SECRET_EVENT_H__
# define __SECRET_EVENT_H__
+# include "internal.h"
+# include "object_event.h"
+# include "object_event_private.h"
+
int
virSecretEventStateRegisterID(virConnectPtr conn,
virObjectEventStatePtr state,
int usage_type,
const char *usage_id);
-#endif
+#endif /* __SECRET_EVENT_H__ */
* <http://www.gnu.org/licenses/>.
*/
-#include "internal.h"
-#include "object_event.h"
-#include "object_event_private.h"
-
#ifndef __STORAGE_EVENT_H__
# define __STORAGE_EVENT_H__
+# include "internal.h"
+# include "object_event.h"
+# include "object_event_private.h"
+
int
virStoragePoolEventStateRegisterID(virConnectPtr conn,
virObjectEventStatePtr state,
virStoragePoolEventRefreshNew(const char *name,
const unsigned char *uuid);
-#endif
+#endif /* __STORAGE_EVENT_H__ */
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
+
#ifndef __VIR_CHRDEV_H__
# define __VIR_CHRDEV_H__
int virChrdevOpen(virChrdevsPtr devs, virDomainChrSourceDefPtr source,
virStreamPtr st, bool force);
-#endif /*__VIR_CHRDEV_H__*/
+
+#endif /* __VIR_CHRDEV_H__ */
* <http://www.gnu.org/licenses/>.
*
*/
+
#ifndef VIR_NWFILTER_BINDING_DEF_H
# define VIR_NWFILTER_BINDING_DEF_H
* <http://www.gnu.org/licenses/>.
*
*/
+
#ifndef VIR_NWFILTER_BINDING_OBJ_H
# define VIR_NWFILTER_BINDING_OBJ_H
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
+
#ifndef VIRNWFILTEROBJ_H
# define VIRNWFILTEROBJ_H
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
+
#ifndef __VIR_SAVE_COOKIE_H__
# define __VIR_SAVE_COOKIE_H__
virSaveCookieFormat(virObjectPtr obj,
virSaveCookieCallbacksPtr saveCookie);
-#endif /*__VIR_SAVE_COOKIE_H__ */
+#endif /* __VIR_SAVE_COOKIE_H__ */
int virAdmConnectCloseCallbackDataUnregister(virAdmConnectCloseCallbackDataPtr cbdata,
virAdmConnectCloseFunc cb);
-#endif /* __VIR_DATATYPES_H__ */
+#endif /* __VIR_DATATYPES_H_ */
* <http://www.gnu.org/licenses/>.
*/
-
#ifndef __VIR_INTERFACE__DRIVER_H
# define __VIR_INTERFACE__DRIVER_H
# define ENODATA EIO
# endif
-#endif /* __VIR_INTERNAL_H__ */
+#endif /* __VIR_INTERNAL_H__ */
int *data,
long long *length);
-#endif
+#endif /* __LIBVIRT_H_ */
unsigned int flags,
int cancelled);
-#endif /* LIBXL_DRIVER_H */
+#endif /* LIBXL_MIGRATION_H */
const char *filename,
bool allow_missing);
-#endif /* __LIBVIRTD_CONFIG_H__ */
+#endif /* __VIR_LOCK_DAEMON_CONFIG_H__ */
const char *filename,
bool allow_missing);
-#endif /* __LIBVIRTD_CONFIG_H__ */
+#endif /* __VIR_LOG_DAEMON_CONFIG_H__ */
virJSONValuePtr virLogHandlerPreExecRestart(virLogHandlerPtr handler);
-#endif /** __VIR_LOG_HANDLER_H__ */
+#endif /* __VIR_LOG_HANDLER_H__ */
* <http://www.gnu.org/licenses/>.
*/
-
#ifndef __VIR_LOG_MANAGER_H__
# define __VIR_LOG_MANAGER_H__
* <http://www.gnu.org/licenses/>.
*/
-
#ifndef __LXC_DOMAIN_H__
# define __LXC_DOMAIN_H__
* <http://www.gnu.org/licenses/>.
*/
-
#ifndef __VIR_NETWORK__DRIVER_H
# define __VIR_NETWORK__DRIVER_H
* <http://www.gnu.org/licenses/>.
*/
-#include <libudev.h>
+#ifndef __NODE_DEVICE_UDEV_H__
+# define __NODE_DEVICE_UDEV_H__
-#define SYSFS_DATA_SIZE 4096
-#define DMI_DEVPATH "/sys/devices/virtual/dmi/id"
-#define DMI_DEVPATH_FALLBACK "/sys/class/dmi/id"
+# include <libudev.h>
+
+# 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__ */
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
+
#ifndef VIR_NWFILTER_EBTABLES_DRIVER_H__
# define VIR_NWFILTER_EBTABLES_DRIVER_H__
# define IPTABLES_MAX_COMMENT_LENGTH 256
-#endif
+#endif /* VIR_NWFILTER_EBTABLES_DRIVER_H__ */
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
+
#ifndef __NWFILTER_GENTECH_DRIVER_H
# define __NWFILTER_GENTECH_DRIVER_H
int virNWFilterBuildAll(virNWFilterDriverStatePtr driver,
bool newFilters);
-#endif
+#endif /* __NWFILTER_GENTECH_DRIVER_H */
* <http://www.gnu.org/licenses/>.
*/
-
#ifndef OPENVZ_DRIVER_H
# define OPENVZ_DRIVER_H
int openvzRegister(void);
-#endif
+#endif /* OPENVZ_DRIVER_H */
*
*/
-
#ifndef OPENVZ_UTIL_H
# define OPENVZ_UTIL_H
long openvzKBPerPages(void);
char *openvzVEGetStringParam(virDomainPtr dom, const char *param);
-#endif
+#endif /* OPENVZ_UTIL_H */
* <http://www.gnu.org/licenses/>.
*/
-
#ifndef __QEMU_AGENT_H__
# define __QEMU_AGENT_H__
char *qemuDomainGetUnmanagedPRAlias(const char *parentalias);
-#endif /* __QEMU_ALIAS_H__*/
+#endif /* __QEMU_ALIAS_H__ */
virSEVCapabilityPtr
virQEMUCapsGetSEVCapabilities(virQEMUCapsPtr qemuCaps);
-#endif /* __QEMU_CAPABILITIES_H__*/
+#endif /* __QEMU_CAPABILITIES_H__ */
#ifndef __QEMU_CAPSPRIV_H_ALLOW__
# 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__
# define __QEMU_CAPSPRIV_H__
void
virQEMUCapsStripMachineAliases(virQEMUCapsPtr qemuCaps);
-#endif
+
+#endif /* __QEMU_CAPSPRIV_H__ */
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
ATTRIBUTE_NONNULL(4);
-#endif /* __QEMU_COMMAND_H__*/
+#endif /* __QEMU_COMMAND_H__ */
*/
#ifndef __QEMU_DOMAIN_ADDRESS_H__
+# define __QEMU_DOMAIN_ADDRESS_H__
# include "domain_addr.h"
# include "domain_conf.h"
virDomainDeviceDefPtr dev,
const char *devicename);
-# define __QEMU_DOMAIN_ADDRESS_H__
-
#endif /* __QEMU_DOMAIN_ADDRESS_H__ */
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
+
#ifndef __QEMU_EXTDEVICE_H__
# define __QEMU_EXTDEVICE_H__
#include <config.h>
#include "qemu_hotplug.h"
+#define __QEMU_HOTPLUGPRIV_H_ALLOW__
#include "qemu_hotplugpriv.h"
#include "qemu_alias.h"
#include "qemu_capabilities.h"
*
*/
+#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__
# define __QEMU_HOTPLUGPRIV_H__
#include "qemu_hotplug.h"
#include "qemu_migration.h"
#include "qemu_migration_params.h"
+#define __QEMU_MIGRATION_PARAMSPRIV_H_ALLOW__
#include "qemu_migration_paramspriv.h"
#include "qemu_monitor.h"
*
*/
+#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__
# define __QEMU_MIGRATION_PARAMSPRIV_H__
* <http://www.gnu.org/licenses/>.
*/
-
#ifndef QEMU_MONITOR_H
# define QEMU_MONITOR_H
* <http://www.gnu.org/licenses/>.
*/
-
#ifndef QEMU_MONITOR_JSON_H
# define QEMU_MONITOR_JSON_H
#ifndef __QEMU_MONITOR_PRIV_H_ALLOW__
# 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__
# define __QEMU_MONITOR_PRIV_H__
void
qemuMonitorResetCommandID(qemuMonitorPtr mon);
-#endif
+#endif /* __QEMU_MONITOR_PRIV_H__ */
* <http://www.gnu.org/licenses/>.
*/
-
#ifndef QEMU_MONITOR_TEXT_H
# define QEMU_MONITOR_TEXT_H
int *retnkeywords,
int allowEmptyValue);
-#endif /* __QEMU_PARSE_COMMAND_H__*/
+#endif /* __QEMU_PARSE_COMMAND_H__ */
#include <sys/utsname.h>
#include "qemu_process.h"
+#define __QEMU_PROCESS_PRIV_H_ALLOW__
#include "qemu_processpriv.h"
#include "qemu_alias.h"
#include "qemu_block.h"
*
*/
+#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__
# define __QEMU_PROCESSPRIV_H__
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
+
#ifndef __QEMU_TPM_H__
# define __QEMU_TPM_H__
* <http://www.gnu.org/licenses/>.
*/
-
#ifndef __REMOTE_DAEMON_H__
# define __REMOTE_DAEMON_H__
* <http://www.gnu.org/licenses/>.
*/
-
#ifndef __REMOTE_DAEMON_STREAM_H__
# define __REMOTE_DAEMON_STREAM_H__
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
+
#ifndef __VIR_NET_LIBSSH_SESSION_H__
# define __VIR_NET_LIBSSH_SESSION_H__
bool virNetLibsshSessionHasCachedData(virNetLibsshSessionPtr sess);
-#endif /* ___VIR_NET_LIBSSH_SESSION_H_ */
+#endif /* __VIR_NET_LIBSSH_SESSION_H__ */
void virNetServerServiceClose(virNetServerServicePtr svc);
-#endif
+#endif /* __VIR_NET_SERVER_SERVICE_H__ */
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
+
#ifndef __VIR_NET_SSH_SESSION_H__
# define __VIR_NET_SSH_SESSION_H__
bool virNetSSHSessionHasCachedData(virNetSSHSessionPtr sess);
-#endif /* ___VIR_NET_SSH_SESSION_H_ */
+#endif /* __VIR_NET_SSH_SESSION_H__ */
const char *virNetTLSSessionGetX509DName(virNetTLSSessionPtr sess);
-#endif
+#endif /* __VIR_NET_TLS_CONTEXT_H__ */
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
+
#ifndef __VIR_SECURITY_APPARMOR_H__
# define __VIR_SECURITY_APPARMOR_H__
* POSIX DAC security driver
*/
-#include "security_driver.h"
-
#ifndef __VIR_SECURITY_DAC
# define __VIR_SECURITY_DAC
+# include "security_driver.h"
+
extern virSecurityDriver virSecurityDriverDAC;
int virSecurityDACSetUserAndGroup(virSecurityManagerPtr mgr,
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
+
#ifndef __VIR_SECURITY_H__
# define __VIR_SECURITY_H__
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
+
#ifndef __VIR_SECURITY_SELINUX_H__
# define __VIR_SECURITY_SELINUX_H__
* Stacked security driver
*/
-#include "security_driver.h"
-
#ifndef __VIR_SECURITY_STACK
# define __VIR_SECURITY_STACK
+# include "security_driver.h"
+
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__
# define __VIR_STORAGE_BACKEND_ISCSI_H__
#include "virerror.h"
#include "storage_backend_sheepdog.h"
+#define __VIR_STORAGE_BACKEND_SHEEPDOG_PRIV_ALLOW_H__
#include "storage_backend_sheepdog_priv.h"
#include "storage_conf.h"
#include "vircommand.h"
* <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__
# define __VIR_STORAGE_BACKEND_SHEEPDOG_PRIV_H__
* <http://www.gnu.org/licenses/>.
*/
-
#ifndef UML_DRIVER_H
# define UML_DRIVER_H
*
*/
-
#ifndef __VIR_MEMORY_H_
# define __VIR_MEMORY_H_
# endif
-#endif /* __VIR_ATOMIC_H */
+#endif /* __VIR_ATOMIC_H__ */
*
*/
-
#ifndef __LIBVIRT_AUDIT_H__
# define __LIBVIRT_AUDIT_H__
VIR_DEFINE_AUTOPTR_FUNC(virBitmap, virBitmapFree)
-#endif
+#endif /* __BITMAP_H__ */
#ifndef __VIR_CGROUP_ALLOW_INCLUDE_PRIV_H__
# 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__
# define __VIR_CGROUP_PRIV_H__
#ifndef __VIR_COMMAND_PRIV_H_ALLOW__
# 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__
# define __VIR_COMMAND_PRIV_H__
#include <config.h>
+#define __VIR_DBUS_PRIV_H_ALLOW__
#include "virdbuspriv.h"
#include "viralloc.h"
#include "virerror.h"
*
*/
+#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__
# define __VIR_DBUS_PRIV_H__
int ebtablesAddForwardPolicyReject(ebtablesContext *ctx);
-#endif /* __QEMUD_ebtabLES_H__ */
+#endif /* __QEMUD_EBTABLES_H__ */
VIR_DEFINE_AUTOPTR_FUNC(virError, virFreeError)
-#endif
+#endif /* __VIRT_ERROR_H_ */
int virEventPollInterrupt(void);
-#endif /* __VIRTD_EVENT_H__ */
+#endif /* __VIR_EVENT_POLL_H__ */
const char *entry,
char **result);
-#endif
+#endif /* __VIR_FCP_H__ */
*
*/
-
#ifndef __VIR_FDSTREAM_H_
# define __VIR_FDSTREAM_H_
*
*/
-
#ifndef __VIR_FILE_H_
# define __VIR_FILE_H_
VIR_DEFINE_AUTOPTR_FUNC(virFileWrapperFd, virFileWrapperFdFree)
-#endif /* __VIR_FILE_H */
+#endif /* __VIR_FILE_H_ */
#ifndef __VIR_FIREWALL_PRIV_H_ALLOW__
# 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__
# define __VIR_FIREWALL_PRIV_H__
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
+
#ifndef __VIR_GETTEXT_H__
# define __VIR_GETTEXT_H__
VIR_DEFINE_AUTOPTR_FUNC(virHashTable, virHashFree)
-#endif /* ! __VIR_HASH_H__ */
+#endif /* __VIR_HASH_H__ */
#include "c-ctype.h"
#include "viralloc.h"
+#define __VIR_HOSTCPU_PRIV_H_ALLOW__
#include "virhostcpupriv.h"
#include "physmem.h"
#include "virerror.h"
unsigned int virHostCPUGetMicrocodeVersion(void);
-#endif /* __VIR_HOSTCPU_H__*/
+#endif /* __VIR_HOSTCPU_H__ */
*
*/
+#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__
# define __VIR_HOSTCPU_PRIV_H__
unsigned int cellCount,
bool add);
-#endif /* __VIR_HOSTMEM_H__*/
+#endif /* __VIR_HOSTMEM_H__ */
int virInitctlSetRunLevel(virInitctlRunLevel level);
-#endif
+#endif /* __VIR_INITCTL_H__ */
const char *value)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
-#endif
+
+#endif /* __VIR_ISCSI_H__ */
*
*/
-
#ifndef __VIR_JSON_H_
# define __VIR_JSON_H_
virKeycodeSet to_offset,
int key_value);
-#endif
+#endif /* __VIR_UTIL_VIRTKEYCODE_H__ */
const char *hostname,
const char *iaid,
const char *server_duid);
-#endif /* __VIR_LEASE_H */
+
+#endif /* __VIR_LEASE_H_ */
int virLogParseFilters(const char *src,
virLogFilterPtr **filters) ATTRIBUTE_NONNULL(1);
-#endif
+#endif /* __VIRTLOG_H_ */
int virMacMapDumpStr(virMacMapPtr mgr,
char **str);
-#endif /* __VIR_MACMAPPING_H__ */
+
+#endif /* __VIR_MACMAP_H__ */
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
+
#ifndef __VIR_NETDEV_VLAN_H__
# define __VIR_NETDEV_VLAN_H__
*
*/
-
#ifndef __VIR_NODE_SUSPEND_H__
# define __VIR_NODE_SUSPEND_H__
virObjectListFreeCount(void *list,
size_t count);
-#endif /* __VIR_OBJECT_H */
+#endif /* __VIR_OBJECT_H__ */
*
*/
-
#ifndef __VIR_QEMU_H_
# define __VIR_QEMU_H_
#include <sys/stat.h>
#include <fcntl.h>
+#define __VIR_RESCTRL_PRIV_H_ALLOW__
#include "virresctrlpriv.h"
#include "viralloc.h"
#include "virfile.h"
void
virResctrlMonitorFreeStats(virResctrlMonitorStatsPtr *stats,
size_t nstats);
-#endif /* __VIR_RESCTRL_H__ */
+#endif /* __VIR_RESCTRL_H__ */
* <http://www.gnu.org/licenses/>.
*/
+#ifndef __VIR_RESCTRL_PRIV_H_ALLOW__
+# error "virresctrlpriv.h may only be included by virresctrl.c or test suites"
+#endif /* __VIR_RESCTRL_PRIV_H_ALLOW__ */
+
#ifndef __VIR_RESCTRL_PRIV_H__
# define __VIR_RESCTRL_PRIV_H__
double sexpr_float(const struct sexpr *sexpr, const char *name);
uint64_t sexpr_u64(const struct sexpr *sexpr, const char *name);
-#endif
+#endif /* _LIBVIR_SEXPR_H_ */
#ifndef __VIR_SYSINFO_PRIV_H_ALLOW__
# error "virsysinfopriv.h may only be included by virsysinfo.c or test suites"
-#endif
+#endif /* __VIR_SYSINFO_PRIV_H_ALLOW__ */
#ifndef __VIR_SYSINFO_PRIV_H__
# define __VIR_SYSINFO_PRIV_H__
#ifndef __VIR_SYSTEMD_PRIV_H_ALLOW__
# error "virsystemdpriv.h may only be included by virsystemd.c or test suites"
-#endif
+#endif /* __VIR_SYSTEMD_PRIV_H_ALLOW__ */
#ifndef __VIR_SYSTEMD_PRIV_H__
# define __VIR_SYSTEMD_PRIV_H__
return 0; \
}
-#endif
+#endif /* __THREADS_H_ */
void virThreadJobSet(const char *caller);
void virThreadJobClear(int rv);
-#endif
+#endif /* __VIR_THREAD_JOB_H__ */
long long int maxWorkers,
long long int prioWorkers);
-#endif
+#endif /* __VIR_THREADPOOL_H__ */
bool virTimeBackOffWait(virTimeBackOffVar *var);
-#endif
+#endif /* __VIR_TIME_H__ */
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
+
#ifndef __VIR_TPM_H__
# define __VIR_TPM_H__
*
*/
-
#ifndef __VIR_TYPED_PARAM_H_
# define __VIR_TYPED_PARAM_H_
} \
} while (0)
-#endif /* __VIR_TYPED_PARAM_H */
+#endif /* __VIR_TYPED_PARAM_H_ */
const char *fabric_wwn)
ATTRIBUTE_NONNULL(2);
-#endif /* __VIR_VBHA_H__ */
+#endif /* __VIR_VHBA_H__ */
virBufferPtr attrBuf,
virBufferPtr childBuf);
-#endif /* __VIR_XML_H__ */
+#endif /* __VIR_XML_H__ */
-/** @file vbox_driver.h
- * Core driver methods for managing VirtualBox VM's
- */
-
/*
* Copyright (C) 2008-2009 Sun Microsystems, Inc.
*
int vboxRegister(void);
# endif
-#endif
+#endif /* VBOX_DRIVER_H */
virVBoxSnapshotConfSnapshotByName(virVBoxSnapshotConfSnapshotPtr snapshot,
const char *snapshotName);
-#endif /*VBOX_SNAPSHOT_CONF_H*/
+#endif /* VBOX_SNAPSHOT_CONF_H */
-/*---------------------------------------------------------------------------*/
/*
* Copyright (C) 2014 Red Hat, Inc.
* Copyright 2010, diateam (www.diateam.net)
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
-/*---------------------------------------------------------------------------*/
#ifndef VMWARE_CONF_H
# define VMWARE_CONF_H
char *vmwareCopyVMXFileName(const char *datastorePath, void *opaque);
-#endif
+#endif /* VMWARE_CONF_H */
-/*---------------------------------------------------------------------------*/
-/* Copyright 2010, diateam (www.diateam.net)
+/*
+ * Copyright 2010, diateam (www.diateam.net)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
-/*---------------------------------------------------------------------------*/
#ifndef VMWARE_DRIVER_H
# define VMWARE_DRIVER_H
int vmwareRegister(void);
-#endif
+#endif /* VMWARE_DRIVER_H */
int vzRegister(void);
-#endif
+#endif /* PARALLELS_DRIVER_H */
*
*/
-#include <Parallels.h>
+#ifndef __VZ_SDK_H__
+# define __VZ_SDK_H__
-#include "vz_utils.h"
+# include <Parallels.h>
+
+# include "vz_utils.h"
int prlsdkInit(void);
void prlsdkDeinit(void);
prlsdkSdkDomainLookupByName(vzDriverPtr driver, const char *name);
int prlsdkCancelJob(virDomainObjPtr dom);
int prlsdkResizeImage(virDomainObjPtr dom, virDomainDiskDefPtr disk, unsigned long long newsize);
+
+#endif /* __VZ_SDK_H__ */
OP(wr_req, VIR_DOMAIN_BLOCK_STATS_WRITE_REQ, "write_requests") \
OP(wr_bytes, VIR_DOMAIN_BLOCK_STATS_WRITE_BYTES, "write_total")
-#endif
-
int
vzDomainObjBeginJob(virDomainObjPtr dom);
void
vzDomainObjEndJob(virDomainObjPtr dom);
int
vzDomainJobUpdateTime(vzDomainJobObjPtr job);
+
+#endif /* PARALLELS_UTILS_H */
* <http://www.gnu.org/licenses/>.
*/
-
#ifndef __VIR_XENAPI_PRIV_H__
# define __VIR_XENAPI_PRIV_H__
* <http://www.gnu.org/licenses/>.
*/
-
#ifndef __VIR_XENAPI_H__
# define __VIR_XENAPI_H__
#include "qemu/qemu_alias.h"
#include "qemu/qemu_conf.h"
#include "qemu/qemu_hotplug.h"
+#define __QEMU_HOTPLUGPRIV_H_ALLOW__
#include "qemu/qemu_hotplugpriv.h"
#include "qemumonitortestutils.h"
#include "testutils.h"
#include "testutilsqemu.h"
#include "qemumonitortestutils.h"
#include "qemu/qemu_migration_params.h"
+#define __QEMU_MIGRATION_PARAMSPRIV_H_ALLOW__
#include "qemu/qemu_migration_paramspriv.h"
#include "qemu/qemu_monitor.h"
#include "cpu/cpu.h"
#include "qemu/qemu_monitor.h"
#include "qemu/qemu_migration_params.h"
+#define __QEMU_MIGRATION_PARAMSPRIV_H_ALLOW__
#include "qemu/qemu_migration_paramspriv.h"
#define VIR_FROM_THIS VIR_FROM_NONE
#include "qemumonitortestutils.h"
#include "virthread.h"
+#define __QEMU_PROCESS_PRIV_H_ALLOW__
#include "qemu/qemu_processpriv.h"
#include "qemu/qemu_monitor.h"
#include "qemu/qemu_agent.h"
#include "internal.h"
#include "testutils.h"
+#define __VIR_STORAGE_BACKEND_SHEEPDOG_PRIV_ALLOW_H__
#include "storage/storage_backend_sheepdog_priv.h"
#include "virstring.h"
-#include "conf/cpu_conf.h"
-#include "internal.h"
-#include "util/virarch.h"
+/*
+ * 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 TESTUTILSHOSTCPUS_H
+# define TESTUTILSHOSTCPUS_H
+
+# include "conf/cpu_conf.h"
+# include "internal.h"
+# include "util/virarch.h"
static virCPUFeatureDef cpuDefaultFeatures[] = {
{ (char *) "ds", -1 },
return NULL;
}
+
+#endif /* TESTUTILSHOSTCPUS_H */
-#include "capabilities.h"
+/*
+ * 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/>.
+ */
-#define FAKEDEVDIR0 "/fakedevdir0/bla/fasl"
-#define FAKEDEVDIR1 "/fakedevdir1/bla/fasl"
+#ifndef TESTUTILSLXC_H
+# define TESTUTILSLXC_H
+
+# include "capabilities.h"
+
+# define FAKEDEVDIR0 "/fakedevdir0/bla/fasl"
+# define FAKEDEVDIR1 "/fakedevdir1/bla/fasl"
virCapsPtr testLXCCapsInit(void);
+
+#endif /* TESTUTILSLXC_H */
-#ifdef WITH_QEMU
+/*
+ * 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/>.
+ */
-# include "capabilities.h"
-# include "virfilecache.h"
-# include "domain_conf.h"
-# include "qemu/qemu_capabilities.h"
-# include "qemu/qemu_conf.h"
+#ifndef TESTUTILSQEMU_H
+# define TESTUTILSQEMU_H
+
+# ifdef WITH_QEMU
+
+# include "capabilities.h"
+# include "virfilecache.h"
+# include "domain_conf.h"
+# include "qemu/qemu_capabilities.h"
+# include "qemu/qemu_conf.h"
enum {
GIC_NONE = 0,
const char *arch,
const char *suffix);
-#endif
+# endif
+
+#endif /* TESTUTILSQEMU_H */
* <http://www.gnu.org/licenses/>.
*/
-#include "virhash.h"
-#include "virjson.h"
-#include "virbuffer.h"
+#ifndef __TESTUTILSQEMUSCHEMA_H__
+# define __TESTUTILSQEMUSCHEMA_H__
+
+# include "virhash.h"
+# include "virjson.h"
+# include "virbuffer.h"
int
testQEMUSchemaValidate(virJSONValuePtr obj,
virHashTablePtr
testQEMUSchemaLoad(void);
+
+#endif /* __TESTUTILSQEMUSCHEMA_H__ */
+/*
+ * 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 _TESTUTILSXEN_H_
# define _TESTUTILSXEN_H_
#include <config.h>
-
+#define __VIR_DBUS_PRIV_H_ALLOW__
#include "virdbuspriv.h"
#include "virlog.h"
#include "testutils.h"
*/
#ifndef __VIR_FILE_MOCK_H__
+# define __VIR_FILE_MOCK_H__
int
virFileWrapperAddPrefix(const char *prefix,
#define __VIR_FIREWALL_PRIV_H_ALLOW__
#define __VIR_COMMAND_PRIV_H_ALLOW__
+#define __VIR_DBUS_PRIV_H_ALLOW__
#include "testutils.h"
+/*
+ * 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 VIRHASHDATA_H
+# define VIRHASHDATA_H
+
const char *uuids[] = {
/* [ 2] */ "a9b02f96-e430-4f7c-a7ff-a647d080447a",
/* [ 4] */ "202e32ca-f82c-4f13-9266-28dc8d002074",
"5920cc9d-62a3-4772-9e73-eb97f0bc483c",
"53c215dd-bdba-4fdc-887a-86ab6f860df4",
};
+
+#endif /* VIRHASHDATA_H */
#include "testutils.h"
#include "internal.h"
+#define __VIR_HOSTCPU_PRIV_H_ALLOW__
#include "virhostcpupriv.h"
#include "virfile.h"
#include "virstring.h"
* <http://www.gnu.org/licenses/>.
*/
-#include <gnutls/gnutls.h>
-#include <gnutls/x509.h>
+#ifndef VIRNETTLSHELPERS_H
+# define VIRNETTLSHELPERS_H
-#if !defined WIN32 && HAVE_LIBTASN1_H && LIBGNUTLS_VERSION_NUMBER >= 0x020600
+# include <gnutls/gnutls.h>
+# include <gnutls/x509.h>
-# include <libtasn1.h>
+# if !defined WIN32 && HAVE_LIBTASN1_H && LIBGNUTLS_VERSION_NUMBER >= 0x020600
-# include "rpc/virnettlscontext.h"
+# include <libtasn1.h>
+
+# include "rpc/virnettlscontext.h"
/*
* This contains parameter about how to generate
void testTLSInit(const char *keyfile);
void testTLSCleanup(const char *keyfile);
-#endif
+# endif
+
+#endif /* VIRNETTLSHELPERS_H */
#include "testutils.h"
#include "virfilewrapper.h"
+#define __VIR_RESCTRL_PRIV_H_ALLOW__
#include "virresctrlpriv.h"
char ** virshCellnoCompleter(vshControl *ctl,
const vshCmd *cmd,
unsigned int flags);
-#endif
+#endif /* VIRSH_COMPLETER */
vshAdmServerCompleter(vshControl *ctl,
const vshCmd *cmd,
unsigned int flags);
-#endif
+#endif /* VIRT_ADMIN_COMPLETER */
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
+
#ifndef _PACKET_LIBVIRT_H_
# define _PACKET_LIBVIRT_H_