Exemplo n.º 1
0
func (d *Domain) Reset() error {
	result := C.virDomainReset(d.cptr, 0)
	if result == -1 {
		return GetLastError()
	}

	return nil
}
Exemplo n.º 2
0
// Reset resets a domain immediately without any guest OS shutdown. Reset
// emulates the power reset button on a machine, where all hardware sees the
// RST line set and reinitializes internal state.
// Note that there is a risk of data loss caused by reset without any guest
// OS shutdown.
func (dom Domain) Reset() error {
	dom.log.Println("resetting domain...")
	cRet := C.virDomainReset(dom.virDomain, 0)
	ret := int32(cRet)

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

	dom.log.Println("domain reset")

	return nil
}