def undefine_domain(dom)
      case dom.info.state
        when Libvirt::Domain::RUNNING, Libvirt::Domain::PAUSED, Libvirt::Domain::BLOCKED
          dom.destroy
      end
      dom.undefine
    end
def undefine_domain(dom)
      case dom.info.state
        when Libvirt::Domain::RUNNING, Libvirt::Domain::PAUSED, Libvirt::Domain::BLOCKED
          dom.destroy
      end
      dom.undefine
    end
Undefine a domain. The domain will be destroyed first if required.