diff --git a/bin/qemush b/bin/qemush index d42e6b4..2a8f798 100755 --- a/bin/qemush +++ b/bin/qemush @@ -23,11 +23,14 @@ public_help() { name="$(basename "$0")" cat << EOF ${name}: usage: - ${name} start - start a VM - ${name} watch - attach VM screen session - ${name} active - (default behaviour) list active VMs - ${name} list - list available VMs - ${name} help - show this help + ${name} start - start a VM + ${name} watch - attach VM screen session + ${name} active - (default behaviour) list active VMs + ${name} list - list available VMs + ${name} help - show this help + ${name} diskls - list available disk images + ${name} diskadd - create a disk image + ${name} diskrm - delete disk image EOF } @@ -57,6 +60,23 @@ public_list() { ls --color=auto bin } +diskpath() { + printf 'images/%s.qcow2' "$1" +} + +public_diskadd() { + qemu-img create -f qcow2 "$(diskpath "$1")" "$2" +} + +public_diskrm() { + rm -vi -- "$(diskpath "$1")" +} + +public_diskls() { + echo "Available disks:" + ls --color=auto images +} + function="$1" shift