]> xenbits.xensource.com Git - libvirt.git/commitdiff
maint: ensure src/ directory includes are clean
authorEric Blake <eblake@redhat.com>
Tue, 25 Mar 2014 20:04:12 +0000 (14:04 -0600)
committerEric Blake <eblake@redhat.com>
Tue, 1 Apr 2014 16:38:12 +0000 (10:38 -0600)
In 'make syntax-check', we have a rule that prevents layering
violations between the various files in src.  However, we
forgot to treat conf/ and the more recently-added access/ as
lower-level directories, and were not detecting cases where
they might have used a driver file.  Also, it's not nice that
qemu can use storage/ but none of the other drivers could do so.

* cfg.mk (sc_prohibit_cross_inclusion): Tighten rules for conf/
and access/, let all other drivers use storage/.

Signed-off-by: Eric Blake <eblake@redhat.com>
cfg.mk

diff --git a/cfg.mk b/cfg.mk
index 117584ceb2a8b4ed63b80f36144ae3f64712f418..4a53f2bb2832d3490fa87a24ed4ba065118fe04e 100644 (file)
--- a/cfg.mk
+++ b/cfg.mk
@@ -760,17 +760,17 @@ sc_prohibit_gettext_markup:
 # lower-level code must not include higher-level headers.
 cross_dirs=$(patsubst $(srcdir)/src/%.,%,$(wildcard $(srcdir)/src/*/.))
 cross_dirs_re=($(subst / ,/|,$(cross_dirs)))
+mid_dirs=access|conf|cpu|locking|network|node_device|rpc|security|storage
 sc_prohibit_cross_inclusion:
        @for dir in $(cross_dirs); do                                   \
          case $$dir in                                                 \
            util/) safe="util";;                                        \
-           locking/)                                                   \
-             safe="($$dir|util|conf|rpc)";;                            \
-           cpu/ | locking/ | network/ | rpc/ | security/)              \
+           access/ | conf/) safe="($$dir|conf|util)";;                 \
+           locking/) safe="($$dir|util|conf|rpc)";;                    \
+           cpu/| network/| node_device/| rpc/| security/| storage/)    \
              safe="($$dir|util|conf)";;                                \
            xenapi/ | xenxs/ ) safe="($$dir|util|conf|xen)";;           \
-           qemu/ ) safe="($$dir|util|conf|cpu|network|locking|rpc|security|storage)";; \
-           *) safe="($$dir|util|conf|cpu|network|locking|rpc|security)";; \
+           *) safe="($$dir|$(mid_dirs)|util)";;                        \
          esac;                                                         \
          in_vc_files="^src/$$dir"                                      \
          prohibit='^# *include .$(cross_dirs_re)'                      \