示例#1
0
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
}
示例#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
}