From 2e38d8cd317b0d88d569b197648cb5cb65292328 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 7 Dec 2010 00:44:29 +0000 Subject: [PATCH] * ZOMG, fixed a giant bug in the networking of distributed VM tests. It turns out that all network interfaces in all VMs had the same Ethernet address (52:54:00:12:34:56) because we didn't specify any with the macaddr=... option. This can obviously lead to great confusion. For instance, when a router forwards a packet, it can actually end up sending the packet to itself because the target machine has the same Ethernet address (causing a loop until the TTL expires), while the target *also* receives the packet. It's amazing anything worked at all, really. So now we just set the Ethernet addresses to 52:54:00:12::. svn path=/nixos/trunk/; revision=25020 --- lib/build-vms.nix | 2 +- lib/qemu-flags.nix | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/build-vms.nix b/lib/build-vms.nix index efd1ce3b8d3f..2c867a0985ba 100644 --- a/lib/build-vms.nix +++ b/lib/build-vms.nix @@ -108,7 +108,7 @@ rec { virtualisation.qemu.options = lib.flip lib.concatMapStrings interfacesNumbered - ({ first, second }: qemuNICFlags second first ); + ({ first, second }: qemuNICFlags second first m.second); }; } ) diff --git a/lib/qemu-flags.nix b/lib/qemu-flags.nix index 05edc1d2cc6c..7831c8f149ab 100644 --- a/lib/qemu-flags.nix +++ b/lib/qemu-flags.nix @@ -2,8 +2,8 @@ { - qemuNICFlags = nic: net: - "-net nic,vlan=${toString nic},model=virtio " + + qemuNICFlags = nic: net: machine: + "-net nic,vlan=${toString nic},macaddr=52:54:00:12:${toString net}:${toString machine},model=virtio " + # Use 232.0.1. as the multicast address to connect VMs on # the same vlan, but allow it to be overriden using the # $QEMU_MCAST_ADDR_ environment variable. The test driver