added shutdown wait function based on virsh domstate