phaul

package
v6.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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:

  • DumpCopyRestore() is called on client side when the pre-iterations are over and it's time to do full dump, copy images and restore them on the server side. All the time this method is executed victim tree is frozen on client. Returning nil kills the tree, error unfreezes it and resumes. The criu argument is the pointer on created criu.Criu object on which client may call Dump(). The requirement on opts passed are: set Ps.Fd to comm.Memfd set ParentImg to lastClientImagesPath set TrackMem to true

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL