On Tue, Apr 11, 2017 at 05:53:49PM +0200, Peter Krempa wrote:
virDomainFree has it's quirks (does not like NULL pointers, resets
*its
libvirt errors). Replace it by a virsh helper which will allow us to
centrally fix issues with it.
The syntax-check rule will prohibit new uses of virDomainFree.
---
cfg.mk | 8 ++
tools/virsh-domain-monitor.c | 36 ++++----
tools/virsh-domain.c | 216 ++++++++++++++++++++-----------------------
tools/virsh-snapshot.c | 24 ++---
tools/virsh-util.c | 10 ++
tools/virsh-util.h | 3 +
6 files changed, 149 insertions(+), 148 deletions(-)
diff --git a/cfg.mk b/cfg.mk
index cc174a3cc..1ff87f445 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -1014,6 +1014,14 @@ sc_gettext_init:
halt='the above files do not call virGettextInitialize' \
$(_sc_search_regexp)
+#Ensure that virsh uses the wrappers on top of the object freeing
APIs
This comment is missing a space after the opening fence. Please drop it,
as the human-readable error message should be self-evident.
+sc_prohibit_obj_free_apis_in_virsh:
+ @prohibit='\virDomainFree\b' \
There's no need to escape 'v'. Did you mean \bvirDomainFree\b?
+ in_vc_files='\virsh.*\.[ch]$$'
\
The backslash can be dropped here.
+ exclude='sc_prohibit_obj_free_apis_in_virsh' \
+ halt='avoid using virDomainFree in virsh, use virsh-prefixed wrappers instead'
\
+ $(_sc_search_regexp)
+
# We don't use this feature of maint.mk.
prev_version_file = /dev/null
ACK
Jan