[PATCH v2 0/6] virsh: refactor some bigger functions