autotest/virt-test — pull request #1071 by lmr (2013-11-14 22:17:02+00:00)
Title: virttest: Add new environment methods to start/stop tcpdump

There is a background tcpdump thread that records DHCP leases
in the env["address_cache"] dictionary. Sometimes, this thread
might write to this dictionary while the environment object is
being saved, triggering a RuntimeError in virt-test.

After discussing for a while and drafting solutions for the
problem, we came to the conclusion that just stopping the
tcpdump thread at the end of test postprocessing is fine,
and significantly simpler than introducing locking to the
environment file.

The decision I made of moving the tcpdump handling to the
env class is because this should be mostly transparent to
test writers, while giving them the option to stop the
thread in special tests that would require it so (netperf
is one example). In fact, the tests in the tree that need
to do that were changed to use the new methods.

I am not 100% happy with how the code turned out, what do you say @ehabkost and @Antique ?