forked from ahurac/dotfiles
Ajout : fonctions pour manipuler des images disque dans qemush
This commit is contained in:
parent
7db32e1bbf
commit
c115dbd144
1 changed files with 25 additions and 5 deletions
20
bin/qemush
20
bin/qemush
|
@ -28,6 +28,9 @@ ${name}: usage:
|
|||
${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 <disk name> <size> - create a disk image
|
||||
${name} diskrm <disk name> - 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
|
||||
|
||||
|
|
Loading…
Reference in a new issue