]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Disallow inclusion of files from src/conf into src/utils
authorPeter Krempa <pkrempa@redhat.com>
Mon, 20 Feb 2017 13:54:12 +0000 (14:54 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 20 Feb 2017 14:12:07 +0000 (15:12 +0100)
The utils code should stay separated from other code (except for very
well justified cases). Unfortunately commit 272769beccd7479c75e700a6cb
made it trivial to break the separation (and not get slapped by the
syntax-check rule) by adding -I src/conf to the CFLAGS for utils.

Remove this shortcut and except the two offenders from the syntax check
so that the codebase can be kept separated.

cfg.mk
src/Makefile.am
src/util/virclosecallbacks.h
src/util/virhostdev.h

diff --git a/cfg.mk b/cfg.mk
index 69e3f3a1afab2ecd8586bc604a47c451a22eb372..aaba61f1dcdfebc0c1511c6eed3716f27daf2a4a 100644 (file)
--- a/cfg.mk
+++ b/cfg.mk
@@ -1242,3 +1242,6 @@ exclude_file_name_regexp--sc_prohibit_always-defined_macros = \
 
 exclude_file_name_regexp--sc_prohibit_readdir = \
   ^tests/.*mock\.c$$
+
+exclude_file_name_regexp--sc_prohibit_cross_inclusion = \
+  ^(src/util/virclosecallbacks\.h|src/util/virhostdev\.h)$$
index 46ca272eb9bf673f0fac6e92c535130064a9a543..4f3f8f0bdade3a1555aa184339ccb400dbfa28b8 100644 (file)
@@ -1137,8 +1137,7 @@ libvirt_util_la_SOURCES =                                 \
 libvirt_util_la_CFLAGS = $(CAPNG_CFLAGS) $(YAJL_CFLAGS) $(LIBNL_CFLAGS) \
                $(AM_CFLAGS) $(AUDIT_CFLAGS) $(DEVMAPPER_CFLAGS) \
                $(DBUS_CFLAGS) $(LDEXP_LIBM) $(NUMACTL_CFLAGS)  \
-               $(POLKIT_CFLAGS) $(GNUTLS_CFLAGS) $(ACL_CFLAGS) \
-               -I$(srcdir)/conf
+               $(POLKIT_CFLAGS) $(GNUTLS_CFLAGS) $(ACL_CFLAGS)
 libvirt_util_la_LIBADD = $(CAPNG_LIBS) $(YAJL_LIBS) $(LIBNL_LIBS) \
                $(THREAD_LIBS) $(AUDIT_LIBS) $(DEVMAPPER_LIBS) \
                $(LIB_CLOCK_GETTIME) $(DBUS_LIBS) $(WIN32_EXTRA_LIBS) $(LIBXML_LIBS) \
index 4df0a00602157a1a38e3ec4946241f9875dd1211..d489971810509a1f1c0adfb2cff4894e3775935e 100644 (file)
@@ -25,7 +25,7 @@
 #ifndef __VIR_CLOSE_CALLBACKS__
 # define __VIR_CLOSE_CALLBACKS__
 
-# include "virdomainobjlist.h"
+# include "conf/virdomainobjlist.h"
 
 typedef struct _virCloseCallbacks virCloseCallbacks;
 typedef virCloseCallbacks *virCloseCallbacksPtr;
index 4c1fea3ef1e14c6e4a9ffa5a5c885a642a0f2bcd..1202136c29f0aab17fe44adb7dedcace6e47fbc7 100644 (file)
@@ -31,7 +31,7 @@
 # include "virusb.h"
 # include "virscsi.h"
 # include "virscsivhost.h"
-# include "domain_conf.h"
+# include "conf/domain_conf.h"
 
 typedef enum {
     VIR_HOSTDEV_STRICT_ACS_CHECK     = (1 << 0), /* strict acs check */