diff --git a/libs/virtualization.bash b/libs/virtualization.bash index 7ed8d3e..5503cb7 100755 --- a/libs/virtualization.bash +++ b/libs/virtualization.bash @@ -121,14 +121,15 @@ vm_change_bridge() { vm_add_data_disk() { - if [ $# -ne 2 ]; then echo "Usage : $0 hypervisor_name_or_ip vm_name size"; return 1; fi + if [ $# -ne 3 ]; then echo "Usage : $0 hypervisor_name_or_ip vm_name size (in Gb)"; return 1; fi hypervisor=${1} name=${2} - size=${3} + size=$(( ${3} * 1024 * 1024 * 1024 )) virsh --connect=qemu+ssh://${USER}@${hypervisor}/system pool-list + virsh --connect=qemu+ssh://${USER}@${hypervisor}/system domblklist ${name} virsh --connect=qemu+ssh://${USER}@${hypervisor}/system vol-create-as --pool guests_data --name ${name} --capacity ${size} --format raw - virsh --connect=qemu+ssh://${USER}@${hypervisor}/system attach-disk ${name} /dev/lvm_guests_data/${name} vdb --cache writethrough + virsh --connect=qemu+ssh://${USER}@${hypervisor}/system attach-disk ${name} /dev/lvm_guests_data/${name} vdb --cache writethrough --persistent virsh --connect=qemu+ssh://${USER}@${hypervisor}/system domblklist ${name} } diff --git a/rc.d/todo.txt b/rc.d/todo.txt index 8eab41f..ee0e851 100644 --- a/rc.d/todo.txt +++ b/rc.d/todo.txt @@ -2,9 +2,13 @@ if [ -f ~/software/todo.txt-cli/todo.sh ]; then - source ~/software/todo.txt-cli/todo_completion export TODOTXT_DEFAULT_ACTION=ls + source ~/software/todo.txt-cli/todo_completion + + alias todo.sh='~/software/todo.txt-cli/todo.sh' + complete -F _todo todo.sh + alias todo='~/software/todo.txt-cli/todo.sh' complete -F _todo todo