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 <mpriv...@redhat.com>
---
 build-aux/syntax-check.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk
index 2f4f932a5b..c71b608e66 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:
-- 
2.26.2

Reply via email to