diff options
author | Simon Rettberg | 2024-05-13 18:01:13 +0200 |
---|---|---|
committer | Simon Rettberg | 2024-05-13 18:01:13 +0200 |
commit | 41d3f2d3bc6d2a0c1af0f338ca2d271e03e86d57 (patch) | |
tree | c6828756a9225fb2e71e5bdea5511f49df696da6 | |
parent | [cowgui] New module for managing CoW session (diff) | |
download | mltk-41d3f2d3bc6d2a0c1af0f338ca2d271e03e86d57.tar.gz mltk-41d3f2d3bc6d2a0c1af0f338ca2d271e03e86d57.tar.xz mltk-41d3f2d3bc6d2a0c1af0f338ca2d271e03e86d57.zip |
[run-virt] Force short xdg config dir name for libvirt
-rwxr-xr-x | core/modules/run-virt/data/opt/openslx/vmchooser/vmchooser-run_virt | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/core/modules/run-virt/data/opt/openslx/vmchooser/vmchooser-run_virt b/core/modules/run-virt/data/opt/openslx/vmchooser/vmchooser-run_virt index 21f43301..d817f5d6 100755 --- a/core/modules/run-virt/data/opt/openslx/vmchooser/vmchooser-run_virt +++ b/core/modules/run-virt/data/opt/openslx/vmchooser/vmchooser-run_virt @@ -209,10 +209,18 @@ main() { fi writelog "VM command: ${VIRTCMD} ${VIRTCMDOPTS[*]}" + # Prepare short config dir, needed because libvirt is stupid and likes + # to create very long UNIX socket names and then chokes on them. + cd="$( mktemp -d "/tmp/lvXXX" )" + if [ -z "$cd" ]; then + cd="/tmp/lv${UID}$(( RANDOM % 10000 ))" + rm -rf -- "$cd" + mkdir -p "$cd" + fi # This will start the VM writelog "---------- BEGIN VM command output ----------" local retval vmpid - "${VIRTCMD}" "${VIRTCMDOPTS[@]}" &>> "${LOGFILE}" & + XDG_CONFIG_HOME="$cd" "${VIRTCMD}" "${VIRTCMDOPTS[@]}" &>> "${LOGFILE}" & vmpid=$! [ -n "$vmpidfile" ] && echo "$vmpid" > "$vmpidfile" wait "$vmpid" |