diff --git a/bin/qemush b/bin/qemush index 3436b26..26c70d7 100755 --- a/bin/qemush +++ b/bin/qemush @@ -51,7 +51,7 @@ error_usage() { # Function to start a virtual machine public_start() { - QEMUSH_NAME="$1" + export QEMUSH_NAME="$1" set -- "$@" \ -name "$QEMUSH_NAME" \ @@ -66,7 +66,7 @@ public_start() { # Attach to a running virtual machine output, the latest opened if no # argument is provided public_attach() { - QEMUSH_NAME="$1" + export QEMUSH_NAME="$1" shift exec socat -,rawer,escape=15 "UNIX-CONNECT:$(pathof socket)" @@ -90,7 +90,7 @@ public_ls() { # Create a copy-on-write disk for a virtual machine public_diskadd() { - QEMUSH_NAME="$1" + export QEMUSH_NAME="$1" shift exec qemu-img create -f qcow2 "$(pathof disk)" "$1" } @@ -98,7 +98,7 @@ public_diskadd() { # Delete a disk public_diskrm() { for disk in "$@"; do - QEMUSH_NAME="$disk" + export QEMUSH_NAME="$disk" rm -vi -- "$(pathof disk)" done } @@ -170,7 +170,7 @@ public_do() { # Expose SPICE via TCP public_spice() { - QEMUSH_NAME="$1" + export QEMUSH_NAME="$1" if [ -n "$2" ]; then port=$2 else