Skip to content

TAP support (and a few other small things)

Michael Goldish kvm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest12 patches 15 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12KVM test: add some MAC/IP address utilities to kvm_utilsclient/tests/kvm/kvm_utils.py+108 -20 replies
2/12KVM test: add basic TAP support with static MAC-IP mappingclient/tests/kvm/kvm_preprocessing.py client/tests/kvm/kvm_tests.cfg.sample client/tests/kvm/kvm_vm.py+79 -300 replies
3/12KVM test: add sample 'qemu-ifup' scriptclient/tests/kvm/qemu-ifup+8 -04 replies
4/12KVM test: add host-specific MAC-IP pool configurationclient/tests/kvm/control client/tests/kvm/kvm_address_pools.cfg.sample+76 -50 replies
5/12KVM test: specify installation cdkeys in a dedicated fileclient/tests/kvm/kvm_cdkeys.cfg.sample client/tests/kvm/kvm_tests.cfg.sample+19 -72 replies
6/12KVM test: minor style changes to kvm_config.pyclient/tests/kvm/kvm_config.py+18 -161 reply
7/12KVM test: kvm_config.py: do not fail when including a nonexistent fileclient/tests/kvm/kvm_config.py+11 -103 replies
8/12KVM test: kvm_subprocess: send user specified parameters to kvm_tail callbacksclient/tests/kvm/kvm_subprocess.py+49 -50 replies
9/12KVM test: dynamically detect and cache MAC-IP pairs using tcpdumpclient/tests/kvm/kvm_preprocessing.py+41 -00 replies
10/12KVM test: kvm_utils.py: small fix for format_str_for_message()client/tests/kvm/kvm_utils.py+3 -10 replies
11/12KVM test: make VMs use a dynamic MAC-IP mapping generated by tcpdumpclient/tests/kvm/kvm_address_pools.cfg.sample client/tests/kvm/kvm_preprocessing.py client/tests/kvm/kvm_utils.py +1 more+81 -200 replies
12/12KVM test: make stress_boot work properly with TAP networkingclient/tests/kvm/kvm_tests.cfg.sample client/tests/kvm/kvm_tests.py+12 -91 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [KVM-AUTOTEST PATCH 0/12] TAP support (and a few other small things)

Here's my proposed TAP solution:
- The user specifies MAC ranges and may or may not specify corresponding IP ranges.
- VMs are always given MAC addresses from the user specified MAC ranges.
- MAC address ranges must be unique to each host running KVM tests -- there must be no overlap between them.
- If corresponding IP ranges are specified as well, the system will use them when trying to communicate with guests.
- If corresponding IP ranges are not specified, tcpdump will be used to listen to DHCP traffic and dynamically detect the right IP addresses. There's also a flag that can force this behavior.
- tcpdump will run in the background at all times, and collect MAC-IP pairs as soon as they are assigned by the DHCP server. This is useful for NIC hotplugging (where IP addresses are assigned during the test itself) and generally for misbehaving guests or DHCP servers (restarting network services during the test, using very short lease times).
- It is up to the user to create the actual bridge for TAP devices; the qemu-ifup script included in one of the patches only adds the TAP interface to an existing bridge. The user should modify this script or create a bridge some other way.

This works very well on two hosts I tried, but I'm not entirely sure it will work in all cases -- please let me know what you think.

(I remember Jason Wang mentioned that tcpdump doesn't always catch all the required traffic, or that it might somehow depend on the DHCP server -- anyone willing to comment on that?)

The following patches have been tested with a few KVM tests (boot, reboot, stress_boot, migration) with both TAP and user mode, but they could probably use more testing (maybe with Python 2.6?), so if anyone is willing to help with that I'd appreciate it very much.