From: Michal Privoznik Date: Thu, 11 Mar 2021 07:29:42 +0000 (+0100) Subject: syntax-check: Fix and rename virSecurity rule X-Git-Tag: v7.2.0-rc1~128 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec5b4ba8f5cdb58b2d78addf54042e5986e194fc;p=thirdparty%2Flibvirt.git syntax-check: Fix and rename virSecurity rule The aim of virSecurity rule is to discourage from using plain virSecurityManager*() APIs within QEMU driver in favor of their qemuSecurity*() counterparts. The reason is simple: namespaces; virSecurityManager*() needs additional virSecurityManagerTransactionCommit() call to enter given namespace and do its work from there. And that's exactly what those qemuSecurity*() wrappers do. To help us ensure correctness (from this POV), we have a syntax-check rule that forbids any occurrence of "virSecurityManager" string under src/qemu/ (except for qemu_security of course). But with if we want to remove virSecurityManagerPtr type, then we have to allow "virSecurityManager *". Therefore, change the rule so that no call of a function with "virSecurityManager" prefix is allowed. And also change the name to better reflect what is going on. Signed-off-by: Michal Privoznik Reviewed-by: Ján Tomko --- diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index 794ec326e4..249e43fa52 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -1049,10 +1049,10 @@ sc_prohibit_sysconf_pagesize: halt='use virGetSystemPageSize[KB] instead of sysconf(_SC_PAGESIZE)' \ $(_sc_search_regexp) -sc_prohibit_virSecurity: +sc_prohibit_virSecurityManager: @$(VC_LIST_EXCEPT) | $(GREP) 'src/qemu/' | \ $(GREP) -v 'src/qemu/qemu_security' | \ - xargs $(GREP) -Pn 'virSecurityManager(?!Ptr)' /dev/null && \ + xargs $(GREP) -Pn 'virSecurityManager\S*\(' /dev/null && \ { echo '$(ME): prefer qemuSecurity wrappers' 1>&2; exit 1; } || : sc_prohibit_pthread_create: