From 161ed5476d27a69bbb940fd4a76f67976bd1d91e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sat, 16 Feb 2013 02:09:10 +0100 Subject: [PATCH] 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. --- Makefile.am | 1 + .../patches/qemu-multiple-smb-shares.patch | 20 +++++++++++++++++++ gnu/packages/qemu.scm | 13 ++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 gnu/packages/patches/qemu-multiple-smb-shares.patch diff --git a/Makefile.am b/Makefile.am index 84277ddc13..c9e3ca92f5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 \ diff --git a/gnu/packages/patches/qemu-multiple-smb-shares.patch b/gnu/packages/patches/qemu-multiple-smb-shares.patch new file mode 100644 index 0000000000..c20066cbfe --- /dev/null +++ b/gnu/packages/patches/qemu-multiple-smb-shares.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, diff --git a/gnu/packages/qemu.scm b/gnu/packages/qemu.scm index 785d470079..b10935ce0d 100644 --- a/gnu/packages/qemu.scm +++ b/gnu/packages/qemu.scm @@ -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)