* Don't use -smb and -no-kvm-irqchip. Maybe this makes VM builds more
reliable. svn path=/nixos/branches/boot-order/; revision=22280
This commit is contained in:
parent
e2dbfbdcf4
commit
46ac1375a7
@ -113,6 +113,7 @@ sub start {
|
|||||||
dup2(fileno($serialC), fileno(STDOUT));
|
dup2(fileno($serialC), fileno(STDOUT));
|
||||||
dup2(fileno($serialC), fileno(STDERR));
|
dup2(fileno($serialC), fileno(STDERR));
|
||||||
$ENV{TMPDIR} = $self->{stateDir};
|
$ENV{TMPDIR} = $self->{stateDir};
|
||||||
|
$ENV{USE_TMPDIR} = 1;
|
||||||
$ENV{QEMU_OPTS} = "-nographic -no-reboot -redir tcp:65535::514 -monitor unix:./monitor";
|
$ENV{QEMU_OPTS} = "-nographic -no-reboot -redir tcp:65535::514 -monitor unix:./monitor";
|
||||||
$ENV{QEMU_KERNEL_PARAMS} = "hostTmpDir=$ENV{TMPDIR}";
|
$ENV{QEMU_KERNEL_PARAMS} = "hostTmpDir=$ENV{TMPDIR}";
|
||||||
chdir $self->{stateDir} or die;
|
chdir $self->{stateDir} or die;
|
||||||
|
@ -113,21 +113,28 @@ let
|
|||||||
''
|
''
|
||||||
#! ${pkgs.stdenv.shell}
|
#! ${pkgs.stdenv.shell}
|
||||||
|
|
||||||
export PATH=${pkgs.samba}/sbin:$PATH
|
NIX_DISK_IMAGE=$(readlink -f ''${NIX_DISK_IMAGE:-${config.virtualisation.diskImage}})
|
||||||
|
|
||||||
NIX_DISK_IMAGE=''${NIX_DISK_IMAGE:-${config.virtualisation.diskImage}}
|
|
||||||
|
|
||||||
if ! test -e "$NIX_DISK_IMAGE"; then
|
if ! test -e "$NIX_DISK_IMAGE"; then
|
||||||
${pkgs.qemu_kvm}/bin/qemu-img create -f qcow2 "$NIX_DISK_IMAGE" ${toString config.virtualisation.diskSize}M || exit 1
|
${pkgs.qemu_kvm}/bin/qemu-img create -f qcow2 "$NIX_DISK_IMAGE" \
|
||||||
|
${toString config.virtualisation.diskSize}M || exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# -no-kvm-irqchip is needed to prevent the CIFS mount from
|
# Start Samba (which wants to put its socket and config files in TMPDIR).
|
||||||
# hanging the VM on x86_64.
|
if [ -z "$TMPDIR" -o -z "$USE_TMPDIR" ]; then
|
||||||
|
TMPDIR=$(mktemp -d nix-vm-smbd.XXXXXXXXXX --tmpdir)
|
||||||
|
fi
|
||||||
|
cd $TMPDIR
|
||||||
|
|
||||||
|
${pkgs.vmTools.startSamba}
|
||||||
|
|
||||||
|
# Start QEMU.
|
||||||
exec ${pkgs.qemu_kvm}/bin/qemu-system-x86_64 \
|
exec ${pkgs.qemu_kvm}/bin/qemu-system-x86_64 \
|
||||||
-name ${vmName} \
|
-name ${vmName} \
|
||||||
-m ${toString config.virtualisation.memorySize} \
|
-m ${toString config.virtualisation.memorySize} \
|
||||||
-no-kvm-irqchip \
|
-net nic,vlan=0,model=virtio \
|
||||||
-net nic,vlan=0,model=virtio -net user,vlan=0 -smb / \
|
-chardev socket,id=samba,path=./samba \
|
||||||
|
-net user,vlan=0,guestfwd=tcp:10.0.2.4:139-chardev:samba \
|
||||||
-drive file=$NIX_DISK_IMAGE,if=virtio,boot=on,cache=writeback,werror=report \
|
-drive file=$NIX_DISK_IMAGE,if=virtio,boot=on,cache=writeback,werror=report \
|
||||||
-kernel ${config.system.build.toplevel}/kernel \
|
-kernel ${config.system.build.toplevel}/kernel \
|
||||||
-initrd ${config.system.build.toplevel}/initrd \
|
-initrd ${config.system.build.toplevel}/initrd \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user