Beispiel #1
0
func (d *Domain) IsUpdated() (bool, error) {
	result := C.virDomainIsUpdated(d.cptr)
	if result == -1 {
		return false, GetLastError()
	}

	if result == 1 {
		return true, nil
	}

	return false, nil
}
Beispiel #2
0
// IsUpdated determines if the domain has been updated.
func (dom Domain) IsUpdated() (bool, error) {
	dom.log.Println("checking whether domain is updated...")
	cRet := C.virDomainIsUpdated(dom.virDomain)
	ret := int32(cRet)

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

	updated := (ret == 1)

	if updated {
		dom.log.Println("domain is updated")
	} else {
		dom.log.Println("domain is not updated")
	}

	return updated, nil
}