qemu

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2017 License: Apache-2.0 Imports: 20 Imported by: 5

Documentation

Index

Constants

View Source
const (
	QMP_INIT = iota
	QMP_SESSION
	QMP_FINISH
	QMP_EVENT
	QMP_INTERNAL_ERROR
	QMP_QUIT
	QMP_TIMEOUT
	QMP_RESULT
	QMP_ERROR
)
View Source
const (
	QmpSockName = "qmp.sock"
	QemuPidFile = "pidfile"
	QemuLogDir  = "/var/log/hyper/qemu"

	QMP_EVENT_SHUTDOWN = "SHUTDOWN"
)
View Source
const (
	IFNAMSIZ       = 16
	CIFF_TAP       = 0x0002
	CIFF_NO_PI     = 0x1000
	CIFF_ONE_QUEUE = 0x2000
)
View Source
const (
	QEMU_SYSTEM_EXE = "qemu-system-x86_64"
)

Variables

This section is empty.

Functions

func GetTapFd added in v1.0.0

func GetTapFd(device, bridge, options string) (int, error)

func GetVhostUserPort added in v1.0.0

func GetVhostUserPort(device, bridge, sockPath, option string) error

Types

type QemuContext

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

implement the hypervisor.DriverContext interface

func (*QemuContext) AddDisk

func (qc *QemuContext) AddDisk(ctx *hypervisor.VmContext, sourceType string, blockInfo *hypervisor.DiskDescriptor, result chan<- hypervisor.VmEvent)

func (*QemuContext) AddMem

func (qc *QemuContext) AddMem(ctx *hypervisor.VmContext, slot, size int) error

func (*QemuContext) AddNic

func (qc *QemuContext) AddNic(ctx *hypervisor.VmContext, host *hypervisor.HostNicInfo, guest *hypervisor.GuestNicInfo, result chan<- hypervisor.VmEvent)

func (*QemuContext) Associate

func (qc *QemuContext) Associate(ctx *hypervisor.VmContext)

func (*QemuContext) Close

func (qc *QemuContext) Close()

func (*QemuContext) Dump

func (qc *QemuContext) Dump() (map[string]interface{}, error)

func (*QemuContext) Kill

func (qc *QemuContext) Kill(ctx *hypervisor.VmContext)

func (*QemuContext) Launch

func (qc *QemuContext) Launch(ctx *hypervisor.VmContext)

func (*QemuContext) Pause

func (qc *QemuContext) Pause(ctx *hypervisor.VmContext, pause bool) error

func (*QemuContext) RemoveDisk

func (qc *QemuContext) RemoveDisk(ctx *hypervisor.VmContext, blockInfo *hypervisor.DiskDescriptor, callback hypervisor.VmEvent, result chan<- hypervisor.VmEvent)

func (*QemuContext) RemoveNic

func (qc *QemuContext) RemoveNic(ctx *hypervisor.VmContext, n *hypervisor.InterfaceCreated, callback hypervisor.VmEvent, result chan<- hypervisor.VmEvent)

func (*QemuContext) Save

func (qc *QemuContext) Save(ctx *hypervisor.VmContext, path string) error

func (*QemuContext) SetCpus

func (qc *QemuContext) SetCpus(ctx *hypervisor.VmContext, cpus int) error

func (*QemuContext) Shutdown

func (qc *QemuContext) Shutdown(ctx *hypervisor.VmContext)

func (*QemuContext) Stats

func (qc *QemuContext) Stats(ctx *hypervisor.VmContext) (*types.PodStats, error)

type QemuDriver

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

implement the hypervisor.HypervisorDriver interface

func InitDriver

func InitDriver() *QemuDriver

func (*QemuDriver) InitContext

func (qd *QemuDriver) InitContext(homeDir string) hypervisor.DriverContext

func (*QemuDriver) LoadContext

func (qd *QemuDriver) LoadContext(persisted map[string]interface{}) (hypervisor.DriverContext, error)

func (*QemuDriver) Name added in v0.6.2

func (qd *QemuDriver) Name() string

func (*QemuDriver) SupportLazyMode

func (qc *QemuDriver) SupportLazyMode() bool

func (*QemuDriver) SupportVmSocket added in v0.8.0

func (qc *QemuDriver) SupportVmSocket() bool

type QemuLogFile added in v0.6.2

type QemuLogFile struct {
	Name   string `json:"name"`
	Offset int64  `json:"offset"`
	// contains filtered or unexported fields
}

func (*QemuLogFile) Close added in v0.6.2

func (f *QemuLogFile) Close() error

func (*QemuLogFile) Read added in v0.6.2

func (f *QemuLogFile) Read(p []byte) (n int, err error)

func (*QemuLogFile) Watch added in v0.6.2

func (f *QemuLogFile) Watch()

type QmpCommand

type QmpCommand struct {
	Execute   string                 `json:"execute"`
	Arguments map[string]interface{} `json:"arguments,omitempty"`
	Scm       []byte                 `json:"-"`
}

type QmpError

type QmpError struct {
	Cause map[string]interface{} `json:"error"`
}

func (*QmpError) Finish

func (qmp *QmpError) Finish(respond func(err error)) *QmpFinish

func (*QmpError) MessageType

func (qmp *QmpError) MessageType() int

type QmpEvent

type QmpEvent struct {
	Type      string       `json:"event"`
	Timestamp QmpTimeStamp `json:"timestamp"`
	Data      interface{}  `json:"data,omitempty"`
}

func (*QmpEvent) MessageType

func (qmp *QmpEvent) MessageType() int

type QmpFinish

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

func (*QmpFinish) MessageType

func (qmp *QmpFinish) MessageType() int

type QmpInit

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

func (*QmpInit) MessageType

func (qmp *QmpInit) MessageType() int

type QmpInteraction

type QmpInteraction interface {
	MessageType() int
}

type QmpInternalError

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

func (*QmpInternalError) MessageType

func (qmp *QmpInternalError) MessageType() int

type QmpQuit

type QmpQuit struct{}

func (*QmpQuit) MessageType

func (qmp *QmpQuit) MessageType() int

type QmpResponse

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

func (*QmpResponse) UnmarshalJSON

func (qmp *QmpResponse) UnmarshalJSON(raw []byte) error

type QmpResult

type QmpResult struct {
	Return map[string]interface{} `json:"return"`
}

func (*QmpResult) MessageType

func (qmp *QmpResult) MessageType() int

type QmpSession

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

func (*QmpSession) Finish

func (qmp *QmpSession) Finish() *QmpFinish

func (*QmpSession) MessageType

func (qmp *QmpSession) MessageType() int

type QmpTimeStamp

type QmpTimeStamp struct {
	Seconds      uint64 `json:"seconds"`
	Microseconds uint64 `json:"microseconds"`
}

type QmpTimeout

type QmpTimeout struct{}

func (*QmpTimeout) MessageType

func (qmp *QmpTimeout) MessageType() int

Jump to

Keyboard shortcuts

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