package phaul

import "github.com/checkpoint-restore/go-criu/v4/phaul"

Index

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client struct

func MakePhaulClient

func MakePhaulClient(l Local, r Remote, c Config) (*Client, error)

MakePhaulClient function Main entry point. Caller should create the client object by passing here local, remote and comm. See comment in corresponding interfaces/structs for explanation.

Then call client.Migrate() and enjoy :)

func (*Client) Migrate

func (pc *Client) Migrate() error

Migrate function

type Config

type Config struct {
	Pid   int
	Memfd int
	Wdir  string
}

Config is the configuration which is passed around

Pid is what we migrate Memfd is the file descriptor via which criu can transfer memory pages. Wdir is the directory where phaul can put images and other stuff

type Local

type Local interface {
	DumpCopyRestore(criu *criu.Criu, c Config, lastClientImagesPath string) error
}

Local interface Interface to local classes. Client calls them when it needs something on the source node.

Methods:

type Remote

type Remote interface {
	StartIter() error
	StopIter() error
}

Remote interface Rpc between PhaulClient and PhaulServer. When client calls anything on this one, the corresponding method should be called on PhaulServer object.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server struct

func MakePhaulServer

func MakePhaulServer(c Config) (*Server, error)

MakePhaulServer function Main entry point. Make the server with comm and call PhaulRemote methods on it upon client requests.

func (*Server) GetCriu

func (s *Server) GetCriu() *criu.Criu

GetCriu function

func (*Server) LastImagesDir

func (s *Server) LastImagesDir() string

LastImagesDir function

func (*Server) StartIter

func (s *Server) StartIter() error

StartIter phaul.Remote methods

func (*Server) StopIter

func (s *Server) StopIter() error

StopIter function

Source Files

api.go client.go images.go server.go stats.go

Version
v4.1.0 (latest)
Published
Jul 30, 2020
Platform
linux/amd64
Imports
7 packages
Last checked
1 week ago

Tools for package owners.