gnu: qemu-kvm: Add patch to have multiple SMB shares.

* gnu/packages/qemu.scm (qemu-kvm/smb-shares): New variable.
* gnu/packages/patches/qemu-multiple-smb-shares.patch: New file.
* Makefile.am (dist_patch_DATA): Add it.
This commit is contained in:
Ludovic Courtès 2013-02-16 02:09:10 +01:00
parent 5f7c5a97ba
commit 106ca9d0c1
3 changed files with 34 additions and 0 deletions

@ -202,6 +202,7 @@ dist_patch_DATA = \
gnu/packages/patches/mcron-install.patch \
gnu/packages/patches/perl-no-sys-dirs.patch \
gnu/packages/patches/procps-make-3.82.patch \
gnu/packages/patches/qemu-multiple-smb-shares.patch \
gnu/packages/patches/readline-link-ncurses.patch \
gnu/packages/patches/shishi-gets-undeclared.patch \
gnu/packages/patches/tar-gets-undeclared.patch \

@ -0,0 +1,20 @@
This file extends `-smb' to add a share for the Nix store, and changes
the name of the default share.
--- a/net/slirp.c
+++ b/net/slirp.c
@@ -515,8 +515,12 @@ static int slirp_smb(SlirpState* s, const char *exported_dir,
"log file=%s/log.smbd\n"
"smb passwd file=%s/smbpasswd\n"
"security = share\n"
- "[qemu]\n"
- "path=%s\n"
+ "[store]\n"
+ "path=/nix/store\n"
+ "read only=yes\n"
+ "guest ok=yes\n"
+ "[xchg]\n"
+ "path=%s/xchg\n"
"read only=no\n"
"guest ok=yes\n",
s->smb_dir,

@ -22,6 +22,7 @@
#:use-module (guix utils)
#:use-module ((guix licenses) #:select (gpl2))
#:use-module (guix build-system gnu)
#:use-module (gnu packages)
#:use-module (gnu packages autotools)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages glib)
@ -96,6 +97,18 @@ underway to get the required changes upstream.")
;; Many files are GPLv2+, but some are GPLv2-only---e.g., `memory.c'.
(license gpl2)))
(define-public qemu-kvm/smb-shares
;; A patched QEMU-KVM where `-net smb' yields two shares instead of one: one
;; for the store, and another one for exchanges with the host.
(package (inherit qemu-kvm)
(name "qemu-kvm-with-multiple-smb-shares")
(inputs `(,@(package-inputs qemu-kvm)
("patch/smb-shares"
,(search-patch "qemu-multiple-smb-shares.patch"))))
(arguments
`(#:patches (list (assoc-ref %build-inputs "patch/smb-shares"))
,@(package-arguments qemu-kvm)))))
(define-public qemu
;; The real one, with a complete target list.
(package (inherit qemu-kvm)