func (d *VirDomain) Save(destFile string) error {
	cPath := C.CString(destFile)
	defer C.free(unsafe.Pointer(cPath))
	result := C.virDomainSave(d.ptr, cPath)
	if result == -1 {
		return errors.New(GetLastError())
	}
	return nil
}
Exemple #2
0
func (d *Domain) Save(filepath string) error {
	cfilepath := C.CString(filepath)
	defer C.free(unsafe.Pointer(cfilepath))

	result := C.virDomainSave(d.cptr, cfilepath)
	if result == -1 {
		return GetLastError()
	}

	return nil
}