From f467c6d131a4adfa4612ecba0a33b3216e1cade2 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 23 Sep 2009 15:17:47 +0000 Subject: [PATCH] * Retry CIFS mounts a few times. Hopefully this fixes problems such as in http://hydra.nixos.org/build/79029 (i.e. "CIFS VFS: No response for cmd 114 mid 1", "CIFS VFS: cifs_mount failed w/return code = -112"). svn path=/nixpkgs/trunk/; revision=17365 --- pkgs/build-support/vm/default.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkgs/build-support/vm/default.nix b/pkgs/build-support/vm/default.nix index e1ddad20689..f8f6b5f55a6 100644 --- a/pkgs/build-support/vm/default.nix +++ b/pkgs/build-support/vm/default.nix @@ -102,7 +102,18 @@ rec { mkdir -p /fs/dev mount -o bind /dev /fs/dev - mount.cifs //10.0.2.4/qemu /fs/hostfs -o guest,username=nobody + n=. + echo "mounting host filesystem..." + while true; do + if mount.cifs //10.0.2.4/qemu /fs/hostfs -o guest,username=nobody; then + break + else + n=".$n" + test ''${#n} -le 10 || exit 1 + sleep 1 + echo "retrying..." + fi + done mkdir -p /fs/nix/store mount -o bind /fs/hostfs/nix/store /fs/nix/store