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

[libvirt] [PATCH 09/10] syntax-check: Include libvirt-{qemu, lxc}.h in <> form only in external tools



Including libvirt-{qemu,lxc}.h in "" form is only allowed for "internal.h"
now, and <> form is only allowed for external tools.
---
 cfg.mk        | 38 ++++++++++++++++++++++++++++++--------
 tools/virsh.c |  4 ++--
 2 files changed, 32 insertions(+), 10 deletions(-)

diff --git a/cfg.mk b/cfg.mk
index 4b84bde..4736d75 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -760,34 +760,50 @@ sc_prohibit_include_virterror_h:
 
 # Don't include "libvirt/libvirt-qemu.h" in "" form.
 sc_prohibit_include_libvirt_qemu_h:
-	@prohibit='^# *include *"libvirt/libvirt-qemu\.h"'			\
+	@prohibit='^# *include *"libvirt/libvirt-qemu\.h"'		\
 	in_vc_files='\.[ch]$$'						\
 	halt='Do not include libvirt/libvirt-qemu.h in internal source'	\
 	  $(_sc_search_regexp)
 
 # Don't include "libvirt/libvirt-lxc.h" in "" form.
 sc_prohibit_include_libvirt_lxc_h:
-	@prohibit='^# *include *"libvirt/libvirt-lxc\.h"'			\
+	@prohibit='^# *include *"libvirt/libvirt-lxc\.h"'		\
 	in_vc_files='\.[ch]$$'						\
 	halt='Do not include libvirt/libvirt-lxc.h in internal source'	\
 	  $(_sc_search_regexp)
 
-# Don't include "libvirt/libvirt.h" in <> form. Except external tools, e.g.
-# python binding, examples and tools subdirectories.
+# Don't include "libvirt/libvirt.h" in <> form. Except for external tools,
+# e.g. python binding, examples and tools subdirectories.
 sc_prohibit_include_libvirt_h_1:
 	@prohibit='^# *include *<libvirt/libvirt\.h>'			\
 	in_vc_files='\.[ch]$$'						\
 	halt='Do not include libvirt/libvirt.h in internal source'	\
 	  $(_sc_search_regexp)
 
-# Don't include "libvirt/virterror.h" in <> form. Except external tools, e.g.
-# python binding, examples and tools subdirectories.
+# Don't include "libvirt/virterror.h" in <> form. Except for external tools,
+# e.g. python binding, examples and tools subdirectories.
 sc_prohibit_include_virterror_h_1:
 	@prohibit='^# *include *<libvirt/virterror\.h>'			\
 	in_vc_files='\.[ch]$$'						\
 	halt='Do not include libvirt/virterror.h in internal source'	\
 	  $(_sc_search_regexp)
 
+# Don't include "libvirt/libvirt-qemu.h" in <> form. Except external tools,
+# e.g. python binding, examples and tools subdirectories.
+sc_prohibit_include_libvirt_qemu_h_1:
+	@prohibit='^# *include *<libvirt/libvirt-qemu\.h>'			\
+	in_vc_files='\.[ch]$$'						\
+	halt='Do not include libvirt/libvirt-qemu.h in internal source'	\
+	  $(_sc_search_regexp)
+
+# Don't include "libvirt/libvirt-lxc.h" in <> form. Except external tools,
+# e.g. python binding, examples and tools subdirectories.
+sc_prohibit_include_libvirt_lxc_h_1:
+	@prohibit='^# *include *<libvirt/libvirt-lxc\.h>'			\
+	in_vc_files='\.[ch]$$'						\
+	halt='Do not include libvirt/libvirt-lxc.h in internal source'	\
+	  $(_sc_search_regexp)
+
 # We don't use this feature of maint.mk.
 prev_version_file = /dev/null
 
@@ -955,7 +971,13 @@ exclude_file_name_regexp--sc_prohibit_include_virterror_h_1 = \
   ^(examples/|tools/|python/|include/libvirt/)
 
 exclude_file_name_regexp--sc_prohibit_include_libvirt_qemu_h = \
-  ^(src/internal\.h$$|tools/)
+  ^src/internal\.h$$
 
 exclude_file_name_regexp--sc_prohibit_include_libvirt_lxc_h = \
-  ^(src/internal\.h$$|tools/)
+  ^src/internal\.h$$
+
+exclude_file_name_regexp--sc_prohibit_include_libvirt_qemu_h_1 = \
+  ^(examples/|tools/|python/|include/libvirt/)
+
+exclude_file_name_regexp--sc_prohibit_include_libvirt_lxc_h_1 = \
+  ^(examples/|tools/|python/|include/libvirt/)
diff --git a/tools/virsh.c b/tools/virsh.c
index b7a5cc1..4cd93ca 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -60,8 +60,8 @@
 #include "virutil.h"
 #include "viralloc.h"
 #include "virxml.h"
-#include "libvirt/libvirt-qemu.h"
-#include "libvirt/libvirt-lxc.h"
+#include <libvirt/libvirt-qemu.h>
+#include <libvirt/libvirt-lxc.h>
 #include "virfile.h"
 #include "configmake.h"
 #include "virthread.h"
-- 
1.8.1.4


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