コード例 #1
0
ファイル: domain.go プロジェクト: rgbkrk/libvirt-go
func (d *VirDomain) Resume() error {
	result := C.virDomainResume(d.ptr)
	if result == -1 {
		return GetLastError()
	}
	return nil
}
コード例 #2
0
ファイル: domain.go プロジェクト: firebitsbr/libvirt-golang
// Resume resumes a suspended domain, the process is restarted from the state
// where it was frozen by calling Suspend(). This function may require
// privileged access. Moreover, resume may not be supported if domain is in
// some special state like DomStatePMSuspended.
func (dom Domain) Resume() error {
	dom.log.Println("resuming domain...")
	cRet := C.virDomainResume(dom.virDomain)
	ret := int32(cRet)

	if ret == -1 {
		err := LastError()
		dom.log.Printf("an error occurred: %v\n", err)
		return err
	}

	dom.log.Println("domain resumed")

	return nil
}