def _shutdown(self, libvirt_cmd, ssh_cmd, msg):
if not self.alive():<EOL><INDENT>return<EOL><DEDENT>with LogTask('<STR_LIT>'.format(msg, self.vm.name())):<EOL><INDENT>dom = self.libvirt_con.lookupByName(self._libvirt_name())<EOL>dom_xml = dom.XMLDesc()<EOL>idx = dom_xml.find('<STR_LIT>')<EOL>if idx == -<NUM_LIT:1>:<EOL><INDENT>LOGGER.debug(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'.format(msg)<EOL>)<EOL>self.vm.ssh(ssh_cmd)<EOL><DEDENT>else:<EOL><INDENT>LOGGER.debug('<STR_LIT>'.format(msg))<EOL>libvirt_cmd(dom)<EOL><DEDENT><DEDENT>
Choose the invoking method (using libvirt or ssh)
to shutdown / poweroff the domain.

If acpi is defined in the domain use libvirt, otherwise use ssh.

Args:
    libvirt_cmd (function): Libvirt function the invoke
    ssh_cmd (list of str): Shell command to invoke on the domain
    msg (str): Name of the command that should be inserted to the log
        message.

Returns
    None

Raises:
    RuntimeError: If acpi is not configured an ssh isn't available