qemu

package
Version: v0.10.4 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2020 License: MPL-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// PluginID is the qemu plugin metadata registered in the plugin
	// catalog.
	PluginID = loader.PluginID{
		Name:       pluginName,
		PluginType: base.PluginTypeDriver,
	}

	// PluginConfig is the qemu driver factory function registered in the
	// plugin catalog.
	PluginConfig = &loader.InternalPluginConfig{
		Config:  map[string]interface{}{},
		Factory: func(l hclog.Logger) interface{} { return NewQemuDriver(l) },
	}
)

Functions

func GetAbsolutePath

func GetAbsolutePath(bin string) (string, error)

GetAbsolutePath returns the absolute path of the passed binary by resolving it in the path and following symlinks.

func NewQemuDriver

func NewQemuDriver(logger hclog.Logger) drivers.DriverPlugin

Types

type Driver

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

Driver is a driver for running images via Qemu

func (*Driver) Capabilities

func (d *Driver) Capabilities() (*drivers.Capabilities, error)

func (*Driver) ConfigSchema

func (d *Driver) ConfigSchema() (*hclspec.Spec, error)

func (*Driver) DestroyTask

func (d *Driver) DestroyTask(taskID string, force bool) error

func (*Driver) ExecTask

func (d *Driver) ExecTask(taskID string, cmdArgs []string, timeout time.Duration) (*drivers.ExecTaskResult, error)

func (*Driver) Fingerprint

func (d *Driver) Fingerprint(ctx context.Context) (<-chan *drivers.Fingerprint, error)

func (*Driver) InspectTask

func (d *Driver) InspectTask(taskID string) (*drivers.TaskStatus, error)

func (*Driver) PluginInfo

func (d *Driver) PluginInfo() (*base.PluginInfoResponse, error)

func (*Driver) RecoverTask

func (d *Driver) RecoverTask(handle *drivers.TaskHandle) error

func (*Driver) SetConfig

func (d *Driver) SetConfig(cfg *base.Config) error

func (*Driver) Shutdown

func (d *Driver) Shutdown()

func (*Driver) SignalTask

func (d *Driver) SignalTask(taskID string, signal string) error

func (*Driver) StartTask

func (*Driver) StopTask

func (d *Driver) StopTask(taskID string, timeout time.Duration, signal string) error

func (*Driver) TaskConfigSchema

func (d *Driver) TaskConfigSchema() (*hclspec.Spec, error)

func (*Driver) TaskEvents

func (d *Driver) TaskEvents(ctx context.Context) (<-chan *drivers.TaskEvent, error)

func (*Driver) TaskStats

func (d *Driver) TaskStats(ctx context.Context, taskID string, interval time.Duration) (<-chan *drivers.TaskResourceUsage, error)

func (*Driver) WaitTask

func (d *Driver) WaitTask(ctx context.Context, taskID string) (<-chan *drivers.ExitResult, error)

type TaskConfig

type TaskConfig struct {
	ImagePath        string             `codec:"image_path"`
	Accelerator      string             `codec:"accelerator"`
	Args             []string           `codec:"args"`     // extra arguments to qemu executable
	PortMap          hclutils.MapStrInt `codec:"port_map"` // A map of host port and the port name defined in the image manifest file
	GracefulShutdown bool               `codec:"graceful_shutdown"`
}

TaskConfig is the driver configuration of a taskConfig within a job

type TaskState

type TaskState struct {
	ReattachConfig *pstructs.ReattachConfig
	TaskConfig     *drivers.TaskConfig
	Pid            int
	StartedAt      time.Time
}

TaskState is the state which is encoded in the handle returned in StartTask. This information is needed to rebuild the taskConfig state and handler during recovery.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to