Пример #1
0
func (d *VirDomain) CreateWithFlags(flags uint) error {
	result := C.virDomainCreateWithFlags(d.ptr, C.uint(flags))
	if result == -1 {
		return GetLastError()
	}
	return nil
}
Пример #2
0
// Create launches a defined domain. If the call succeeds the domain moves from
// the defined to the running domains pools.
func (dom Domain) Create(flags DomainCreateFlag) error {
	dom.log.Printf("starting domain (flags = %v)...\n", flags)
	cRet := C.virDomainCreateWithFlags(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 started")

	return nil
}