* The installer test lost the QEMU flags to set up the NIC to talk to

the web server somewhere, so put them back in
  (http://hydra.nixos.org/build/424923).

svn path=/nixos/trunk/; revision=22003
This commit is contained in:
Eelco Dolstra 2010-05-27 12:20:37 +00:00
parent 894435ce5e
commit 77a4004df1
3 changed files with 18 additions and 1 deletions

15
lib/qemu-flags.nix Normal file
View File

@ -0,0 +1,15 @@
# QEMU flags shared between various Nix expressions.
{
qemuNICFlags = nic: net:
"-net nic,vlan=${toString nic},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
# sets this variable to prevent collisions between parallel
# builds.
"-net socket,vlan=${toString nic},mcast=" +
"\${QEMU_MCAST_ADDR_${toString net}:-232.0.1.${toString net}:1234} ";
}

View File

@ -34,6 +34,7 @@ sub new {
if defined $args->{hda};
$startCommand .= "-cdrom $args->{cdrom} "
if defined $args->{cdrom};
$startCommand .= $args->{qemuFlags} || "";
}
my $name = $args->{name};

View File

@ -1,6 +1,7 @@
{ pkgs, nixpkgs, system, ... }:
with pkgs.lib;
with import ../lib/qemu-flags.nix;
let
@ -104,7 +105,7 @@ let
''
createDisk("harddisk", 4 * 1024);
my $machine = Machine->new({ hda => "harddisk", cdrom => glob("${iso}/iso/*.iso") });
my $machine = Machine->new({ hda => "harddisk", cdrom => glob("${iso}/iso/*.iso"), qemuFlags => '${qemuNICFlags 1 1}' });
$machine->start;
${optionalString testChannel ''