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)