[Nix-dev] RE: [Nix-commits] SVN commit: nix - r25020 - nixos/trunk/lib

Sander van der Burg - EWI S.vanderBurg at tudelft.nl
Tue Dec 7 11:47:31 CET 2010


Nice :-)


-----Original Message-----
From: nix-commits-bounces at cs.uu.nl on behalf of Eelco Dolstra
Sent: Tue 12/7/2010 1:44 AM
To: nix-commits at cs.uu.nl
Subject: [Nix-commits] SVN commit: nix - r25020 - nixos/trunk/lib
 
Author: eelco
Date: Tue Dec  7 00:44:29 2010
New Revision: 25020
URL: https://svn.nixos.org/websvn/nix/?rev=25020&sc=1

Log:
* 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:<virtual
  network number>:<machine number>.

Modified:
   nixos/trunk/lib/build-vms.nix
   nixos/trunk/lib/qemu-flags.nix

Modified: nixos/trunk/lib/build-vms.nix
==============================================================================
--- nixos/trunk/lib/build-vms.nix	Mon Dec  6 22:02:37 2010	(r25019)
+++ nixos/trunk/lib/build-vms.nix	Tue Dec  7 00:44:29 2010	(r25020)
@@ -108,7 +108,7 @@
                   
                   virtualisation.qemu.options =
                     lib.flip lib.concatMapStrings interfacesNumbered
-                      ({ first, second }: qemuNICFlags second first );
+                      ({ first, second }: qemuNICFlags second first m.second);
                 };
             }
           )

Modified: nixos/trunk/lib/qemu-flags.nix
==============================================================================
--- nixos/trunk/lib/qemu-flags.nix	Mon Dec  6 22:02:37 2010	(r25019)
+++ nixos/trunk/lib/qemu-flags.nix	Tue Dec  7 00:44:29 2010	(r25020)
@@ -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.<vlan> as the multicast address to connect VMs on
     # the same vlan, but allow it to be overriden using the
     # $QEMU_MCAST_ADDR_<vlan> environment variable.  The test driver
_______________________________________________
nix-commits mailing list
nix-commits at cs.uu.nl
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20101207/f2287192/attachment.html 


More information about the nix-dev mailing list