On 05/17/2010 04:35 PM, Lucas Meneghel Rodrigues wrote: > On Mon, 2010-05-17 at 16:29 +0300, Michael Goldish wrote: >> To disable tcpdump, set 'run_tcpdump = no' in a config file. >> If 'run_tcpdump' isn't set at all, it defaults to 'yes'. >> >> (Currently TAP mode cannot be used without tcpdump.) > > Maybe we can just tie tcpdump execution to tap mode - if running on tap > mode, enable tcpdump, else, disable it. I'd rather prefer this > approach. Checking for nic_mode == 'tap' is incorrect IMO, because nic_mode is a VM parameter, not a global parameter. There can be several VMs, some with nic_mode == 'user' and some with nic_mode == 'tap', e.g. nic_mode = user # default value for all VMs nic_mode_vm2 = tap # specific to vm2 (overrides nic_mode) so if we went by nic_mode, we wouldn't run tcpdump, which is required by vm2. Also, a test is free to start its own VMs. Consider this (somewhat unlikely) scenario: nic_mode=user, so vm1 uses user mode, and the test clones it, changes the clone's mode to tap, and starts the clone. If we went by nic_mode, we wouldn't start tcpdump even though the clone needs it. >> Signed-off-by: Michael Goldish <mgoldish@xxxxxxxxxx> >> --- >> client/tests/kvm/kvm_preprocessing.py | 2 +- >> client/tests/kvm/tests_base.cfg.sample | 1 + >> 2 files changed, 2 insertions(+), 1 deletions(-) >> >> diff --git a/client/tests/kvm/kvm_preprocessing.py b/client/tests/kvm/kvm_preprocessing.py >> index 50db65c..e11207a 100644 >> --- a/client/tests/kvm/kvm_preprocessing.py >> +++ b/client/tests/kvm/kvm_preprocessing.py >> @@ -196,7 +196,7 @@ def preprocess(test, params, env): >> if "tcpdump" in env and not env["tcpdump"].is_alive(): >> env["tcpdump"].close() >> del env["tcpdump"] >> - if "tcpdump" not in env: >> + if "tcpdump" not in env and params.get("run_tcpdump", "yes") == "yes": >> command = "/usr/sbin/tcpdump -npvi any 'dst port 68'" >> logging.debug("Starting tcpdump (%s)...", command) >> env["tcpdump"] = kvm_subprocess.kvm_tail( >> diff --git a/client/tests/kvm/tests_base.cfg.sample b/client/tests/kvm/tests_base.cfg.sample >> index c9dfd0b..1276267 100644 >> --- a/client/tests/kvm/tests_base.cfg.sample >> +++ b/client/tests/kvm/tests_base.cfg.sample >> @@ -46,6 +46,7 @@ nic_mode = user >> #nic_mode = tap >> nic_script = scripts/qemu-ifup >> address_index = 0 >> +run_tcpdump = yes >> >> # Misc >> run_kvm_stat = yes > > > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@xxxxxxxxxxxxxxx > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html