Exemplo n.º 1
0
func (d *VirDomain) UndefineFlags(flags uint) error {
	result := C.virDomainUndefineFlags(d.ptr, C.uint(flags))
	if result == -1 {
		return GetLastError()
	}
	return nil
}
Exemplo n.º 2
0
// Undefine undefines a domain. If the domain is running, it's converted to
// transient domain, without stopping it. If the domain is inactive, the domain
// configuration is removed.
func (dom Domain) Undefine(flags DomainUndefineFlag) error {
	dom.log.Printf("undefining domain (flags = %v)...\n", flags)
	cRet := C.virDomainUndefineFlags(dom.virDomain, C.uint(flags))
	ret := int32(cRet)

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

	dom.log.Println("domain undefined")

	return nil
}