Documentation
¶
Index ¶
- type BaseDriver
- func (d *BaseDriver) ApplySnapshot(_ context.Context, _ string) error
- func (d *BaseDriver) CanRunGUI() bool
- func (d *BaseDriver) ChangeDisplayPassword(_ context.Context, _ string) error
- func (d *BaseDriver) CreateDisk(_ context.Context) error
- func (d *BaseDriver) CreateSnapshot(_ context.Context, _ string) error
- func (d *BaseDriver) DeleteSnapshot(_ context.Context, _ string) error
- func (d *BaseDriver) ForwardGuestAgent() bool
- func (d *BaseDriver) GetDisplayConnection(_ context.Context) (string, error)
- func (d *BaseDriver) GuestAgentConn(_ context.Context) (net.Conn, error)
- func (d *BaseDriver) Initialize(_ context.Context) error
- func (d *BaseDriver) ListSnapshots(_ context.Context) (string, error)
- func (d *BaseDriver) Register(_ context.Context) error
- func (d *BaseDriver) RunGUI() error
- func (d *BaseDriver) Start(_ context.Context) (chan error, error)
- func (d *BaseDriver) Stop(_ context.Context) error
- func (d *BaseDriver) Unregister(_ context.Context) error
- func (d *BaseDriver) Validate() error
- type Driver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseDriver ¶
type BaseDriver struct { Instance *store.Instance SSHLocalPort int VSockPort int VirtioPort string }
func (*BaseDriver) ApplySnapshot ¶ added in v0.16.0
func (d *BaseDriver) ApplySnapshot(_ context.Context, _ string) error
func (*BaseDriver) CanRunGUI ¶ added in v0.17.0
func (d *BaseDriver) CanRunGUI() bool
func (*BaseDriver) ChangeDisplayPassword ¶ added in v0.15.0
func (d *BaseDriver) ChangeDisplayPassword(_ context.Context, _ string) error
func (*BaseDriver) CreateDisk ¶
func (d *BaseDriver) CreateDisk(_ context.Context) error
func (*BaseDriver) CreateSnapshot ¶ added in v0.16.0
func (d *BaseDriver) CreateSnapshot(_ context.Context, _ string) error
func (*BaseDriver) DeleteSnapshot ¶ added in v0.16.0
func (d *BaseDriver) DeleteSnapshot(_ context.Context, _ string) error
func (*BaseDriver) ForwardGuestAgent ¶ added in v0.20.0
func (d *BaseDriver) ForwardGuestAgent() bool
func (*BaseDriver) GetDisplayConnection ¶ added in v0.15.0
func (d *BaseDriver) GetDisplayConnection(_ context.Context) (string, error)
func (*BaseDriver) GuestAgentConn ¶ added in v0.19.0
func (*BaseDriver) Initialize ¶ added in v0.19.0
func (d *BaseDriver) Initialize(_ context.Context) error
func (*BaseDriver) ListSnapshots ¶ added in v0.16.0
func (d *BaseDriver) ListSnapshots(_ context.Context) (string, error)
func (*BaseDriver) Register ¶ added in v0.18.0
func (d *BaseDriver) Register(_ context.Context) error
func (*BaseDriver) RunGUI ¶ added in v0.17.0
func (d *BaseDriver) RunGUI() error
func (*BaseDriver) Unregister ¶ added in v0.18.0
func (d *BaseDriver) Unregister(_ context.Context) error
func (*BaseDriver) Validate ¶
func (d *BaseDriver) Validate() error
type Driver ¶
type Driver interface { // Validate returns error if the current driver isn't support for given config Validate() error // Initialize is called on creating the instance for initialization. // (e.g., creating "vz-identifier" file) // // Initialize MUST return nil when it is called against an existing instance. // // Initialize does not create the disks. Initialize(_ context.Context) error // CreateDisk returns error if the current driver fails in creating disk CreateDisk(_ context.Context) error // Start is used for booting the vm using driver instance // It returns a chan error on successful boot // The second argument may contain error occurred while starting driver Start(_ context.Context) (chan error, error) // CanRunGUI returns bool to indicate if the hostagent need to run GUI synchronously CanRunGUI() bool // RunGUI is for starting GUI synchronously by hostagent. This method should be wait and return only after vm terminates // It returns error if there are any failures RunGUI() error // Stop will terminate the running vm instance. // It returns error if there are any errors during Stop Stop(_ context.Context) error // Register will add an instance to a registry. // It returns error if there are any errors during Register Register(_ context.Context) error // Unregister will perform any cleanup related to the vm instance. // It returns error if there are any errors during Unregister Unregister(_ context.Context) error ChangeDisplayPassword(_ context.Context, password string) error GetDisplayConnection(_ context.Context) (string, error) CreateSnapshot(_ context.Context, tag string) error ApplySnapshot(_ context.Context, tag string) error DeleteSnapshot(_ context.Context, tag string) error ListSnapshots(_ context.Context) (string, error) // ForwardGuestAgent returns if the guest agent sock needs forwarding by host agent. ForwardGuestAgent() bool // GuestAgentConn returns the guest agent connection, or nil (if forwarded by ssh). GuestAgentConn(_ context.Context) (net.Conn, error) }
Driver interface is used by hostagent for managing vm.
This interface is extended by BaseDriver which provides default implementation. All other driver definition must extend BaseDriver.
Click to show internal directories.
Click to hide internal directories.