aboutsummaryrefslogtreecommitdiff
path: root/kvmx
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2018-06-13 18:48:48 -0300
committerSilvio Rhatto <rhatto@riseup.net>2018-06-13 18:48:48 -0300
commita926dcdcef4f004d49845d8a1231e93361172c4b (patch)
tree7ec52a7476b2da3db7ece2539e1d91f4c9db4642 /kvmx
parentb60e8245f323f792b01e0dd15435ee076e1a07bb (diff)
downloadkvmx-a926dcdcef4f004d49845d8a1231e93361172c4b.tar.gz
kvmx-a926dcdcef4f004d49845d8a1231e93361172c4b.tar.bz2
Adds create action, wrapper to kvmx-create
Diffstat (limited to 'kvmx')
-rwxr-xr-xkvmx12
1 files changed, 11 insertions, 1 deletions
diff --git a/kvmx b/kvmx
index b00c747..f861fdc 100755
--- a/kvmx
+++ b/kvmx
@@ -366,7 +366,7 @@ function kvmx_up {
fi
else
local wait="y"
- kvmx-create $GLOBAL_USER_CONFIG_FOLDER/$VM
+ kvmx_create
fi
if [ "$wait" == "y" ]; then
@@ -1849,6 +1849,16 @@ function kvmx_xrandr {
echo DISPLAY=:0 xrandr --output $xrandr_device --mode $name | kvmx_ssh
}
+# Wrapper to kvmx-create
+function kvmx_create {
+ if kvmx_running || kvmx_suspended; then
+ echo "$BASENAME: guest $VM is running or suspended, cannot (re-)create"
+ exit 1
+ fi
+
+ kvmx-create $KVMXFILE
+}
+
# Dispatch
if type kvmx_$ACTION 2> /dev/null | grep -q "kvmx_$ACTION ()"; then
__kvmx_initialize $*