[libvirt] PATCH: 0/28: Thread safety for libvirtd daemon and drivers

Daniel P. Berrange berrange at redhat.com
Thu Dec 4 20:28:38 UTC 2008


On Wed, Dec 03, 2008 at 04:15:05PM -0800, Chris Wright wrote:
> * Daniel P. Berrange (berrange at redhat.com) wrote:
> > (*
> >  * This is the list of all libvirt methods which return
> >  * pointers to locked objects
> >  *)
> > let lockedObjMethods = [
> >    "virDomainFindByID";
> >    "virDomainFindByUUID";
> >    "virDomainFindByName";
> >    "virDomainAssignDef";
> ...
> 
> All quite cool.  Anyway to annotate the source so these tables don't get
> out of date?

We'd have to invent some annotation for parameters and return types to
indicate whether they expect / return a locked object.

Although actually thinking about it, in domain_conf.c, every single func
which takes a virDomainObjPtr as a param expects it to be locked, and all
which return such an object give it to you pre-locked. So I could just
have it parse domain_conf.h and extract the list of APIs in that header.

Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|




More information about the libvir-list mailing list