aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-12-01 08:21:40 -0200
committerSilvio Rhatto <rhatto@riseup.net>2017-12-01 08:21:40 -0200
commit8eedb041a8fccdd6c2656e2f7d1f55c973619dc2 (patch)
tree5acccff12406a27ca4c885cce669bc11453a5190
parentf6a3a456ca952752e7b7961640cbc47ceae1d694 (diff)
downloadkvmx-8eedb041a8fccdd6c2656e2f7d1f55c973619dc2.tar.gz
kvmx-8eedb041a8fccdd6c2656e2f7d1f55c973619dc2.tar.bz2
Adds shared_folders_msize and shared_folders_cache options
-rwxr-xr-xkvmx10
-rw-r--r--kvmxfile9
2 files changed, 18 insertions, 1 deletions
diff --git a/kvmx b/kvmx
index fc7ba38..30981d8 100755
--- a/kvmx
+++ b/kvmx
@@ -361,6 +361,14 @@ function kvmx_up {
nic_model="virtio"
fi
+ if [ -z "$shared_folder_msize" ]; then
+ shared_folders_msize="524288"
+ fi
+
+ if [ -z "$shared_folders_cache" ]; then
+ shared_folders_cache="none"
+ fi
+
# Run virtual machine
# See https://en.wikipedia.org/wiki/Nohup#Overcoming_hanging
nohup kvm -m $memory -name $VM -drive file=$image,if=$drive_interface $graphics $shared \
@@ -417,7 +425,7 @@ function kvmx_up {
if [ ! -z "$shared_folder" ] && [ ! -z "$shared_folder_mountpoint" ]; then
echo "Mounting $shared_folder on $shared_folder_mountpoint on guest..."
echo "sudo mkdir -p $shared_folder_mountpoint" | kvmx_ssh
- echo "sudo mount -t 9p -o trans=virtio shared $shared_folder_mountpoint -oversion=9p2000.L,posixacl,cache=none -o sync -o dirsync" | kvmx_ssh
+ echo "sudo mount -t 9p -o trans=virtio,msize=$shared_folders_msize shared $shared_folder_mountpoint -oversion=9p2000.L,posixacl,cache=$shared_folders_cache -o sync -o dirsync" | kvmx_ssh
#echo "sudo mount //10.0.2.4/qemu $shared_folder_mountpint" | kvmx_ssh
elif [ ! -z "$shared_folders" ]; then
local old_ifs="$IFS"
diff --git a/kvmxfile b/kvmxfile
index 6926e21..248f2cf 100644
--- a/kvmxfile
+++ b/kvmxfile
@@ -22,6 +22,15 @@ shared_folder_mountpoint="/home/$user/code/$VM"
# Format: <id1>:<host-folder1>:<guest-mountpoint1>,<id2>:<host-folder2>:<guest-mountpoint2>[,...]
#shared_folders="shared1:.:/home/$user/code/$VM,shared2:$HOME/.local/share/app:/home/$user/.local/share/app"
+# Maximum packet size including any headers for shared folders using 9p
+# See https://forums.lime-technology.com/topic/34691-9p-sharing-speed-not-what-i-expected/
+# https://github.com/clearcontainers/hyperstart/pull/25
+#shared_folders_msize="524288"
+
+# Shared folders caching
+# See https://www.kernel.org/doc/Documentation/filesystems/9p.txt
+#shared_folders_cache="none"
+
# Folder to sync during provisioning in the format "/host/folder1 /guest/folder1,/host/folder2 /guest/folder2[,...]".
#provision_rsync="$KVMX_BASE/share/provision/ /usr/local/share/kvmx/provision/"
#provision_rsync="puppet/ /etc/puppet/"