Author: eelco
Date: 2010-06-15 16:15:17 +0000 (Tue, 15 Jun 2010)
New Revision: 22280

You can view the changes in this commit at:
   https://svn.nixos.org/viewvc/nix?rev=22280&view=rev

Modified:
   nixos/branches/boot-order/lib/test-driver/Machine.pm
   nixos/branches/boot-order/modules/virtualisation/qemu-vm.nix

Log:
* Don't use -smb and -no-kvm-irqchip.  Maybe this makes VM builds more
  reliable.


Changes:

Modified: nixos/branches/boot-order/lib/test-driver/Machine.pm
===================================================================
--- nixos/branches/boot-order/lib/test-driver/Machine.pm        2010-06-15 
16:13:10 UTC (rev 22279)
+++ nixos/branches/boot-order/lib/test-driver/Machine.pm        2010-06-15 
16:15:17 UTC (rev 22280)
@@ -113,6 +113,7 @@
         dup2(fileno($serialC), fileno(STDOUT));
         dup2(fileno($serialC), fileno(STDERR));
         $ENV{TMPDIR} = $self->{stateDir};
+        $ENV{USE_TMPDIR} = 1;
         $ENV{QEMU_OPTS} = "-nographic -no-reboot -redir tcp:65535::514 
-monitor unix:./monitor";
         $ENV{QEMU_KERNEL_PARAMS} = "hostTmpDir=$ENV{TMPDIR}";
         chdir $self->{stateDir} or die;

Modified: nixos/branches/boot-order/modules/virtualisation/qemu-vm.nix
===================================================================
--- nixos/branches/boot-order/modules/virtualisation/qemu-vm.nix        
2010-06-15 16:13:10 UTC (rev 22279)
+++ nixos/branches/boot-order/modules/virtualisation/qemu-vm.nix        
2010-06-15 16:15:17 UTC (rev 22280)
@@ -113,21 +113,28 @@
     ''
       #! ${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
-          ${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
-      
-      # -no-kvm-irqchip is needed to prevent the CIFS mount from
-      # hanging the VM on x86_64.
+
+      # Start Samba (which wants to put its socket and config files in TMPDIR).
+      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 \
           -name ${vmName} \
           -m ${toString config.virtualisation.memorySize} \
-          -no-kvm-irqchip \
-          -net nic,vlan=0,model=virtio -net user,vlan=0 -smb / \
+          -net nic,vlan=0,model=virtio \
+          -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 \
           -kernel ${config.system.build.toplevel}/kernel \
           -initrd ${config.system.build.toplevel}/initrd \

_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to