[PATCH v3 02/30] syntax-check: prohibit_virXXXFree: skip strings

Victor Toso victortoso at redhat.com
Thu Apr 21 18:15:15 UTC 2022


Hi,

On Thu, Apr 21, 2022 at 02:02:25PM +0200, Peter Krempa wrote:
> On Wed, Apr 20, 2022 at 21:07:51 +0200, Victor Toso wrote:
> > We should allow strings (not the functions) in the format of
> > "virDomainFree" and friends.
> > 
> > This fixes an error in latter commit "scripts: apibuild: parse
> > 'Since' for functions" as it uses this function names as keys
> > in a dictionary.
> > 
> > Fixes:
> >  |  ...
> >  |  prohibit_virXXXFree
> >  |  libvirt/scripts/apibuild.py:163:        'virDomainFree': '0.0.1',
> >  |  make: Leaving directory '/home/toso/src/libvirt/build/build-aux'
> >  |  stderr:
> >  |  build-aux/syntax-check.mk: avoid using virXXXFree, use virObjectUnref instead
> >  |  make: *** [libvirt/build-aux/syntax-check.mk:829: sc_prohibit_virXXXFree] Error 1
> > 
> > Signed-off-by: Victor Toso <victortoso at redhat.com>
> > ---
> 
> This patch should not be needed once we will not need to have an
> override for 'virDomainFree'.

Yes, I'll be able to drop this one.

> 
> >  build-aux/syntax-check.mk | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk
> > index eb403f3d3f..07e0295995 100644
> > --- a/build-aux/syntax-check.mk
> > +++ b/build-aux/syntax-check.mk
> > @@ -827,7 +827,7 @@ sc_prohibit_system_error_with_vir_err:
> >  # docs, examples, tools, src/libvirt-*.c, and include/libvirt/libvirt-*.h
> >  sc_prohibit_virXXXFree:
> >  	@prohibit='\bvir(Domain|Network|NodeDevice|StorageVol|StoragePool|Stream|Secret|NWFilter|Interface|DomainSnapshot)Free\b' \
> > -	exclude='sc_prohibit_virXXXFree' \
> > +	exclude="sc_prohibit_virXXXFree|'vir.*?Free'" \
> 
> IMO a better solution would be to exclude python files from the check.

I guess that would be in another parameter?

Cheers,
Victor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20220421/7075bdaf/attachment-0001.sig>


More information about the libvir-list mailing list