1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-25 07:00:43 +00:00
nixpkgs/pkgs/os-specific/linux/kvm/smbd-path-r3.patch
Eelco Dolstra 97ad838137 * KVM 86. This one finally seems to have decent CIFS performance
again.

svn path=/nixpkgs/trunk/; revision=15825
2009-06-02 15:59:42 +00:00

51 lines
1.5 KiB
Diff

diff -rc kvm-86/net.c kvm-86-new/net.c
*** kvm-86/net.c 2009-05-19 18:29:02.000000000 +0200
--- kvm-86-new/net.c 2009-06-02 17:41:15.000000000 +0200
***************
*** 684,694 ****
slirp_init(slirp_restrict, slirp_ip);
}
! /* XXX: better tmp dir construction */
! snprintf(smb_dir, sizeof(smb_dir), "/tmp/qemu-smb.%ld", (long)getpid());
! if (mkdir(smb_dir, 0700) < 0) {
! fprintf(stderr, "qemu: could not create samba server dir '%s'\n", smb_dir);
! exit(1);
}
snprintf(smb_conf, sizeof(smb_conf), "%s/%s", smb_dir, "smb.conf");
--- 684,696 ----
slirp_init(slirp_restrict, slirp_ip);
}
! while (1) {
! snprintf(smb_dir, sizeof(smb_dir), "/tmp/qemu-smb.%ld.%d", (long) getpid(), random());
! if (mkdir(smb_dir, 0700) == 0) break;
! if (errno != EEXIST) {
! fprintf(stderr, "qemu: could not create samba server dir '%s'\n", smb_dir);
! exit(1);
! }
}
snprintf(smb_conf, sizeof(smb_conf), "%s/%s", smb_dir, "smb.conf");
diff -rc kvm-86/net.h kvm-86-new/net.h
*** kvm-86/net.h 2009-05-19 18:29:02.000000000 +0200
--- kvm-86-new/net.h 2009-06-02 17:39:17.000000000 +0200
***************
*** 129,135 ****
#ifdef __sun__
#define SMBD_COMMAND "/usr/sfw/sbin/smbd"
#else
! #define SMBD_COMMAND "/usr/sbin/smbd"
#endif
#endif
--- 129,135 ----
#ifdef __sun__
#define SMBD_COMMAND "/usr/sfw/sbin/smbd"
#else
! #define SMBD_COMMAND "smbd"
#endif
#endif