]> xenbits.xensource.com Git - libvirt.git/commitdiff
virsh: Prohibit virConnectOpen* functions in virsh
authorMartin Kletzander <mkletzan@redhat.com>
Fri, 7 Mar 2014 10:15:39 +0000 (11:15 +0100)
committerMartin Kletzander <mkletzan@redhat.com>
Tue, 18 Mar 2014 07:27:30 +0000 (08:27 +0100)
Addition of vshConnect() makes virConnectOpen() functions obsolete in
virsh.  Thus all virsh-*.[ch] files should be left only with
vshConnect() in the case of need.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
cfg.mk

diff --git a/cfg.mk b/cfg.mk
index f52295982c4964857b064b6bcf4516b1ccebee86..a2fed1107729488f37c1c0e4d506a288813a89c4 100644 (file)
--- a/cfg.mk
+++ b/cfg.mk
@@ -892,6 +892,12 @@ sc_prohibit_wrong_filename_in_comment:
            'actual file name' 1>&2; exit 1; }                         \
        fi;
 
+sc_prohibit_virConnectOpen_in_virsh:
+       @prohibit='\bvirConnectOpen[a-zA-Z]* *\('                       \
+       in_vc_files='^tools/virsh-.*\.[ch]$$'                            \
+       halt='Use vshConnect() in virsh instead of virConnectOpen*'     \
+         $(_sc_search_regexp)
+
 
 # We don't use this feature of maint.mk.
 prev_version_file = /dev/null