diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2019-10-07 19:07:08 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2019-10-07 19:07:08 -0300 |
commit | ab82ad7fa360a32e76fa0f2371a842877929e876 (patch) | |
tree | 239d6d71e7fe35444d51cabd8007b13bb0f462ba /kvmx | |
parent | ebbe4622db99554a569e4b6161773f7378e0f7c0 (diff) | |
download | kvmx-ab82ad7fa360a32e76fa0f2371a842877929e876.tar.gz kvmx-ab82ad7fa360a32e76fa0f2371a842877929e876.tar.bz2 |
Adds shared_folders_sshfs config
Diffstat (limited to 'kvmx')
-rwxr-xr-x | kvmx | 25 |
1 files changed, 24 insertions, 1 deletions
@@ -632,6 +632,27 @@ function kvmx_up { IFS="$old_ifs" fi + # Shall we add an umount hook when powering off the guest? + if [ ! -z "$shared_folders_sshfs" ]; then + local old_ifs="$IFS" + local shared_item + IFS="," + for shared_item in $shared_folders_sshfs; do + local id="`echo $shared_item | cut -d ':' -f 1`" + local shared_folder="`echo $shared_item | cut -d ':' -f 2`" + local shared_folder_mountpoint="`echo $shared_item | cut -d ':' -f 3`" + + # Temporaly reset IFS so kvmx_sshfs executes correctly + IFS="$old_ifs" + kvmx_sshfs $shared_folder $shared_folder_mountpoint + IFS="," + + unset shared_folder + unset shared_folder_mountpoint + done + IFS="$old_ifs" + fi + if [ "$xrandr" == "1" ] && [ "$run_spice_client" == "1" ]; then echo "Waiting for X11 to come up so we can set machine resolution..." sleep 8 @@ -799,7 +820,9 @@ function kvmx_sshfs { fi SSH="`cat $SSHFILE`" - sshfs $SSH_LOGIN@127.0.0.1:$folder $mountpoint $SSH_OPTS -o nonempty -p $SSH + + # See https://github.com/libfuse/sshfs/issues/82 about "-o writeback_cache=no" + sshfs $SSH_LOGIN@127.0.0.1:$folder $mountpoint $SSH_OPTS -o nonempty -o sshfs_sync -o sync_readdir -o cache=no -o follow_symlinks -o sync_read -o workaround=rename -o noforget -p $SSH } # Get guest PID |