]> xenbits.xensource.com Git - libvirt.git/commit
test: fix potential lock corruption in test driver
authorLaine Stump <laine@redhat.com>
Wed, 7 Dec 2011 18:52:01 +0000 (13:52 -0500)
committerLaine Stump <laine@laine.org>
Thu, 8 Dec 2011 21:20:31 +0000 (16:20 -0500)
commitf21d49144fadf6fbe2fa0d846228a4f7e3713953
treeef645968825967b33eafc5332d84e25e8f41cb0d
parent3b95f284f19d2e43daa32a87cd10eaf42ea8bb4e
test: fix potential lock corruption in test driver

In some error situations, the function testDomainRestoreFlags() could
unlock the test driver mutex without first locking it. This patch
moves the lock operation earlier, so that it occurs before any
potential jump down to the unlock call.

I found this problem while auditing the test driver lock usage to
determine the cause of a hang while running the following test:

  cd tests; while true; do printf x; ./undefine; done

This patch *does not* solve that problem, but we now understand its
actual source, and danpb is working on a patch.
src/test/test_driver.c