Example #1
0
func (conn VirConnection) Restore(srcFile string) error {
	cPath := C.CString(srcFile)
	defer C.free(unsafe.Pointer(cPath))
	if result := C.virDomainRestore(conn.ptr, cPath); result == -1 {
		return errors.New(GetLastError())
	}
	return nil
}
Example #2
0
func (h *Hypervisor) RestoreDomain(filepath string) error {
	cfilepath := C.CString(filepath)
	defer C.free(unsafe.Pointer(cfilepath))

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

	return nil
}