/** * Shutdown * * @return bool */ public function powerOff() { return (bool) libvirt_domain_shutdown($this->domain); }
function domain_shutdown($domain) { $dom = $this->get_domain_object($domain); if (!$dom) { return false; } $tmp = libvirt_domain_shutdown($dom); return $tmp ? $tmp : $this->_set_last_error(); }
/** * send ACPI shutdown command to a virtual machine on the virt host * * @global resource $host_conn libvirt connection * * @param string $vm_virt_id virt_id of the vm * * @return bool on success */ function ace_kvm_vm_shutdown($vm_virt_id) { global $host_conn; $vm_res = libvirt_domain_lookup_by_name($host_conn, $vm_virt_id); ace_kvm_log_last_error(); $result = libvirt_domain_shutdown($vm_res); ace_kvm_log_last_error(); return $result; }