I advise you simplify this function to return Cmdresult,
and you can accomplish this function in libvirt_vm module.

Because your work has been done by virsh.command(...) by passing "ignore_status = False".