
On Mon, Dec 01, 2008 at 12:09:21AM +0000, Daniel P. Berrange wrote:
This patch fills in the previous stub methods for locking/unlocking internal objects.
With the following methods return a locked object
virDomainFindByID virDomainFindByName virDomainFindByUUID virDomainAssignDef
All the other methods accepting a virDomainObjPtr instance, require that the object first be locked.
For virDomainDefPtr objects, if they are standalone, no locking is required (hence why the Xen driver isn't touched in any of these patches). If they are associated with a virDomainObjPtr though, this parent object must be locked.
The same applies for virNetworkObjPtr, virStoragePoolObjPtr and the virNodeDeviceObjPtr objects & their methods.
I've just realized my first posting of this code http://www.redhat.com/archives/libvir-list/2008-October/msg00419.html actually added documentation comments against each method specifying the locking rules, but I've missed that this time. I will write an additional patch to document this for these internal APIs. 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 :|