[PATCH] tools: virsh-snapshot: refactor small functions