[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 1/3] syntax-check: Don't include public headers in internal source



Directories python/tools/examples should include them in <> form,
though this patch allows "" form in these directories by excluding
them, a later patch will do the cleanup.
---
 cfg.mk             | 10 ++++++++++
 daemon/remote.c    |  2 --
 src/libvirt-qemu.c |  1 -
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/cfg.mk b/cfg.mk
index dd67816..5f422de 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -746,6 +746,13 @@ sc_prohibit_duplicate_header:
 	  { echo "$(ME)": avoid duplicate headers >&2; exit 1; }	\
 	fi;
 
+# Don't include "libvirt/*.h" in "" form.
+sc_prohibit_include_public_headers:
+	@prohibit='# *include *"libvirt/.*\.h"'				\
+	in_vc_files='\.[chx]$$'						\
+	halt='Do not include libvirt/*.h in internal source'		\
+	  $(_sc_search_regexp)
+
 # We don't use this feature of maint.mk.
 prev_version_file = /dev/null
 
@@ -899,3 +906,6 @@ exclude_file_name_regexp--sc_correct_id_types = \
   (^src/locking/lock_protocol.x$$)
 
 exclude_file_name_regexp--sc_m4_quote_check = m4/virt-lib.m4
+
+exclude_file_name_regexp--sc_prohibit_include_public_headers = \
+  ^(src/internal\.h$$|python/|tools/|examples/|include/libvirt/libvirt-(qemu|lxc)\.h$$)
diff --git a/daemon/remote.c b/daemon/remote.c
index 45c50f3..c559d6f 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -38,8 +38,6 @@
 #include "virutil.h"
 #include "stream.h"
 #include "viruuid.h"
-#include "libvirt/libvirt-qemu.h"
-#include "libvirt/libvirt-lxc.h"
 #include "vircommand.h"
 #include "intprops.h"
 #include "virnetserverservice.h"
diff --git a/src/libvirt-qemu.c b/src/libvirt-qemu.c
index 11da2f3..fb19584 100644
--- a/src/libvirt-qemu.c
+++ b/src/libvirt-qemu.c
@@ -26,7 +26,6 @@
 #include "virerror.h"
 #include "virlog.h"
 #include "datatypes.h"
-#include "libvirt/libvirt-qemu.h"
 
 #define VIR_FROM_THIS VIR_FROM_NONE
 
-- 
1.8.1.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]