func (d *VirDomain) Create() error { result := C.virDomainCreate(d.ptr) if result == -1 { return GetLastError() } return nil }
func (d *Domain) Start() error { result := C.virDomainCreate(d.cptr) if result == -1 { return GetLastError() } return nil }
func (c *VirConnection) CreateAndBootNewDomain(xml string) (VirDomain, error) { cXml := C.CString(xml) defer C.free(unsafe.Pointer(cXml)) cDomainPtr := C.virDomainDefineXML(c.ptr, cXml) if cDomainPtr == nil { return VirDomain{}, errors.New(GetLastError()) } result := C.virDomainCreate(cDomainPtr) if result == -1 { return VirDomain{}, errors.New(GetLastError()) } return VirDomain{ptr: cDomainPtr}, nil }