MCPcopy Index your code
hub / github.com/checkpoint-restore/go-criu

github.com/checkpoint-restore/go-criu @v8.3.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v8.3.0 ↗ · + Follow
3,125 symbols 4,523 edges 123 files 340 documented · 11% 9 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

go-criu -- Go bindings for CRIU

ci verify Go Reference

This repository provides Go bindings for CRIU. The code is based on the Go-based PHaul implementation from the CRIU repository. For easier inclusion into other Go projects, the CRIU Go bindings have been moved to this repository.

CRIU

The Go bindings provide an easy way to use the CRIU RPC calls from Go without the need to set up all the infrastructure to make the actual RPC connection to CRIU.

The following example would print the version of CRIU:

import (
    "log"

    "github.com/checkpoint-restore/go-criu/v8"
)

func main() {
    c := criu.MakeCriu()
    version, err := c.GetCriuVersion()
    if err != nil {
        log.Fatalln(err)
    }
    log.Println(version)
}

or to just check if at least a certain CRIU version is installed:

    c := criu.MakeCriu()
    result, err := c.IsCriuAtLeast(31100)

CRIT

The crit package provides bindings to decode, encode, and manipulate CRIU image files natively within Go. It also provides a CLI tool similar to the original CRIT Python tool. To get started with this, see the docs at CRIT (Go library).

Releases

The first go-criu release was 3.11 based on CRIU 3.11. The initial plan was to follow CRIU so that go-criu would carry the same version number as CRIU.

As go-criu is imported in other projects and as Go modules are expected to follow Semantic Versioning go-criu will also follow Semantic Versioning starting with the 4.0.0 release.

The following table shows the relation between go-criu and criu versions:

Major version Latest release CRIU version
v8 8.2.0 4.2
v7 7.2.0 3.19
v7 7.0.0 3.18
v6 6.3.0 3.17
v5 5.3.0 3.16
v5 5.0.0 3.15
v4 4.1.0 3.14

How to contribute

See CONTRIBUTING.md for details on how to contribute to this project.

License and copyright

Unless mentioned otherwise in a specific file's header, all code in this project is released under the Apache 2.0 license.

The author of a change remains the copyright holder of their code (no copyright assignment). The list of authors and contributors can be retrieved from the git commit history and in some cases, the file headers.

Extension points exported contracts — how you extend this code

Notify (Interface)
Notify interface [1 implementers]
notify.go
Remote (Interface)
Remote interface Rpc between PhaulClient and PhaulServer. When client calls anything on this one, the corresponding meth [1 …
phaul/api.go
Critter (Interface)
Critter is the interface that wraps all CRIT operations. To create a CRIT service instance, use New(). [1 implementers]
crit/crit.go
Local (Interface)
Local interface Interface to local classes. Client calls them when it needs something on the source node. Methods: - D [1 …
phaul/api.go

Core symbols most depended-on inside this repo

Ptr
called by 42
internal/proto/proto.go
getImg
called by 24
crit/utils.go
countBytes
called by 16
crit/utils.go
encodeDefault
called by 9
crit/encode.go
decodeDefault
called by 9
crit/decode.go
String
called by 8
crit/task_state.go
New
called by 8
crit/crit.go
getFilePath
called by 6
crit/utils.go

Shape

Method 2,492
Function 327
Struct 279
TypeAlias 21
Interface 4
Class 2

Languages

Go100%
Python1%
C1%

Modules by API surface

rpc/rpc.pb.go402 symbols
crit/images/criu-core/criu-core.pb.go119 symbols
crit/images/core-x86/core-x86.pb.go113 symbols
crit/images/core-mips/core-mips.pb.go100 symbols
crit/images/tty/tty.pb.go83 symbols
crit/images/fsnotify/fsnotify.pb.go77 symbols
stats/stats.pb.go75 symbols
crit/images/core-s390/core-s390.pb.go67 symbols
crit/images/core-ppc64/core-ppc64.pb.go66 symbols
crit/images/cgroup/cgroup.pb.go66 symbols
crit/images/core-aarch64/core-aarch64.pb.go65 symbols
crit/images/cpuinfo/cpuinfo.pb.go60 symbols

For agents

$ claude mcp add go-criu \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page