
On Wed, Dec 03, 2008 at 07:44:02PM +0000, Daniel P. Berrange wrote:
Its fairly easy to extend to track other rules we define. eg validate that you lock the 'qemud_driver *' object before locking the virDomainObjPtr instance.
It can now also do - Check that you lock the driver before an object - Check that no objects are locked when locking the driver - Check for use of driver while unlocked - Check for use of objects while unlocked and takes into account access to global variables. eg, a report for the storage driver autostart bug DV identified earlier Function: storageDriverAutostart - Total exit points with locked vars: 0 - Total blocks with lock ordering mistakes: 7 - Object used while unlocked on #line 66 "storage_driver.c" tmp___5 = virStoragePoolObjIsActive(pool); - Object used while unlocked on #line 69 backend = virStorageBackendForType((pool->def)->type); - Object used while unlocked on #line 70 fprintf((FILE */* __restrict */)stderr, (char const */* __restrict */)"Missing backend %d", (pool->def)->type); - Object used while unlocked on #line 75 tmp___1 = (*(backend->startPool))((virConnect *)((void *)0), pool); - Object used while unlocked on #line 78 fprintf((FILE */* __restrict */)stderr, (char const */* __restrict */)"Failed to autostart storage pool \'%s\': %s", (pool->def)->name, tmp___0); - Object used while unlocked on #line 83 tmp___4 = (*(backend->refreshPool))((virConnect *)((void *)0), pool); - Object used while unlocked on #line 87 fprintf((FILE */* __restrict */)stderr, (char const */* __restrict */)"Failed to autostart storage pool \'%s\': %s", (pool->def)->name, tmp___3); Or a bugs I missed before Function: umlInotifyEvent - Total exit points with locked vars: 3 - Object locked while driver is unlocked on #line 246 dom = virDomainFindByName(& driver->domains, (char const *)name); 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 :|