Versions in this module Expand all Collapse all v0 v0.6.0 May 25, 2016 Changes in this version + const BaseDir + const COMMAND_ACK + const COMMAND_ATTACH + const COMMAND_DETACH + const COMMAND_GET_POD_STATS + const COMMAND_NEWCONTAINER + const COMMAND_ONLINECPUMEM + const COMMAND_PAUSEVM + const COMMAND_RELEASE + const COMMAND_REPLACE_POD + const COMMAND_RUN_POD + const COMMAND_SHUTDOWN + const COMMAND_STOP_POD + const COMMAND_WINDOWSIZE + const ConsoleSockName + const DefaultInitrd + const DefaultKernel + const DefaultMaxCpus + const DefaultMaxMem + const DetachKeys + const ERROR_CMD_FAIL + const ERROR_INIT_FAIL + const ERROR_INTERRUPTED + const ERROR_QMP_FAIL + const EVENT_BLOCK_EJECTED + const EVENT_BLOCK_INSERTED + const EVENT_CONTAINER_ADD + const EVENT_CONTAINER_DELETE + const EVENT_DEV_SKIP + const EVENT_INIT_CONNECTED + const EVENT_INTERFACE_ADD + const EVENT_INTERFACE_DELETE + const EVENT_INTERFACE_EJECTED + const EVENT_INTERFACE_INSERTED + const EVENT_PAUSE_RESULT + const EVENT_POD_FINISH + const EVENT_SERIAL_ADD + const EVENT_SERIAL_DELETE + const EVENT_TTY_CLOSE + const EVENT_TTY_OPEN + const EVENT_VM_EXIT + const EVENT_VM_KILL + const EVENT_VM_START_FAILED + const EVENT_VM_TIMEOUT + const EVENT_VOLUME_ADD + const GENERIC_OPERATION + const HyperSockName + const ShareDirTag + const StateCleaning + const StateDestroying + const StateInit + const StateNone + const StatePodStopping + const StatePreparing + const StateRunning + const StateStarting + const StateTerminating + const TtySockName + var InterfaceCount int = 1 + var PciAddrFrom int = 0x05 + func EventString(ev int) string + func InitNetwork(bIface, bIP string, disableIptables bool) error + func LazyVmLoop(vmId string, hub chan VmEvent, client chan *types.VmResponse, boot *BootConfig) + func NewVmMessage(m *hyperstartapi.DecodedMessage) []byte + func ReadVmMessage(conn *net.UnixConn) (*hyperstartapi.DecodedMessage, error) + func SupportLazyMode() bool + func TtyLiner(conn io.Reader, output chan string) + func UnblockSend(ch chan *types.VmResponse, u *types.VmResponse) + func VmAssociate(vmId string, hub chan VmEvent, client chan *types.VmResponse, ...) + func VmLoop(vmId string, hub chan VmEvent, client chan *types.VmResponse, boot *BootConfig) + type AttachCommand struct + Container string + Size *WindowSize + Stderr *TtyIO + Streams *TtyIO + func (qe *AttachCommand) Event() int + type BlockDescriptor struct + DeviceName string + Filename string + Format string + Fstype string + Name string + Options map[string]string + ScsiId int + type BlockdevInsertedEvent struct + DeviceName string + Name string + ScsiAddr string + ScsiId int + SourceType string + func (qe *BlockdevInsertedEvent) Event() int + type BootConfig struct + Bios string + CPU int + Cbfs string + HotAddCpuMem bool + Initrd string + Kernel string + Memory int + Vbox string + type CommandAck struct + func (qe *CommandAck) Event() int + type CommandError CommandAck + func (qe *CommandError) Event() int + type Container struct + Cmds []string + ExitCode int + Id string + Image string + Logs LogStatus + Name string + PodId string + Status uint32 + type ContainerCreatedEvent struct + Cmd []string + Entrypoint []string + Envs map[string]string + Fstype string + Id string + Image string + Index int + Rootfs string + Workdir string + func (qe *ContainerCreatedEvent) Event() int + type ContainerInfo struct + Cmd []string + Entrypoint []string + Envs map[string]string + Fstype string + Id string + Image string + Initialize bool + MountId string + Rootfs string + User string + Workdir string + type ContainerUnmounted struct + Index int + Success bool + func (qe *ContainerUnmounted) Event() int + type DevSkipEvent struct + func (qe *DevSkipEvent) Event() int + type DeviceFailed struct + Session VmEvent + func (qe *DeviceFailed) Event() int + type DriverContext interface + AddDisk func(ctx *VmContext, sourceType string, blockInfo *BlockDescriptor) + AddMem func(ctx *VmContext, slot, size int, result chan<- error) + AddNic func(ctx *VmContext, host *HostNicInfo, guest *GuestNicInfo, result chan<- VmEvent) + AllocateNetwork func(vmId, requestedIP string, maps []pod.UserContainerPort) (*network.Settings, error) + Associate func(ctx *VmContext) + Close func() + ConfigureNetwork func(vmId, requestedIP string, maps []pod.UserContainerPort, ...) (*network.Settings, error) + Dump func() (map[string]interface{}, error) + Kill func(ctx *VmContext) + Launch func(ctx *VmContext) + Pause func(ctx *VmContext, pause bool, result chan<- error) + ReleaseNetwork func(vmId, releasedIP string, maps []pod.UserContainerPort, file *os.File) error + RemoveDisk func(ctx *VmContext, blockInfo *BlockDescriptor, callback VmEvent) + RemoveNic func(ctx *VmContext, n *InterfaceCreated, callback VmEvent) + Save func(ctx *VmContext, path string, result chan<- error) + SetCpus func(ctx *VmContext, cpus int, result chan<- error) + Shutdown func(ctx *VmContext) + Stats func(ctx *VmContext) (*types.PodStats, error) + type EmptyContext struct + func (ec *EmptyContext) AddDisk(ctx *VmContext, sourceType string, blockInfo *BlockDescriptor) + func (ec *EmptyContext) AddMem(ctx *VmContext, slot, size int, result chan<- error) + func (ec *EmptyContext) AddNic(ctx *VmContext, host *HostNicInfo, guest *GuestNicInfo, result chan<- VmEvent) + func (ec *EmptyContext) AllocateNetwork(vmId, requestedIP string, maps []pod.UserContainerPort) (*network.Settings, error) + func (ec *EmptyContext) Associate(ctx *VmContext) + func (ec *EmptyContext) BuildinNetwork() bool + func (ec *EmptyContext) Close() + func (ec *EmptyContext) ConfigureNetwork(vmId, requestedIP string, maps []pod.UserContainerPort, ...) (*network.Settings, error) + func (ec *EmptyContext) Dump() (map[string]interface{}, error) + func (ec *EmptyContext) Kill(ctx *VmContext) + func (ec *EmptyContext) Launch(ctx *VmContext) + func (ec *EmptyContext) Pause(ctx *VmContext, pause bool, result chan<- error) + func (ec *EmptyContext) ReleaseNetwork(vmId, releasedIP string, maps []pod.UserContainerPort, file *os.File) error + func (ec *EmptyContext) RemoveDisk(ctx *VmContext, blockInfo *BlockDescriptor, callback VmEvent) + func (ec *EmptyContext) RemoveNic(ctx *VmContext, n *InterfaceCreated, callback VmEvent) + func (ec *EmptyContext) Save(ctx *VmContext, path string, result chan<- error) + func (ec *EmptyContext) SetCpus(ctx *VmContext, cpus int, result chan<- error) + func (ec *EmptyContext) Shutdown(ctx *VmContext) + func (ec *EmptyContext) Stats(ctx *VmContext) (*types.PodStats, error) + type EmptyDriver struct + func (ed *EmptyDriver) InitContext(homeDir string) DriverContext + func (ed *EmptyDriver) Initialize() error + func (ed *EmptyDriver) LoadContext(persisted map[string]interface{}) (DriverContext, error) + func (ed *EmptyDriver) SupportLazyMode() bool + type Fanout struct + func CreateFanout(upstream chan *types.VmResponse, size int, block bool) *Fanout + func (fo *Fanout) Acquire() (chan *types.VmResponse, error) + func (fo *Fanout) Close() + func (fo *Fanout) Release(client chan *types.VmResponse) error + type GenericOperation struct + OpFunc func(ctx *VmContext, result chan<- error) + OpName string + Result chan<- error + State []string + func (qe *GenericOperation) Event() int + type GetPodStatsCommand struct + Id string + func (qe *GetPodStatsCommand) Event() int + type GuestNicInfo struct + Busaddr int + Device string + Index int + Ipaddr string + type HandleEvent struct + Data interface{} + Handle func(*types.VmResponse, interface{}, *PodStatus, *Vm) bool + type HostNicInfo struct + Bridge string + Device string + Fd uint64 + Gateway string + Mac string + type HypervisorDriver interface + BuildinNetwork func() bool + InitContext func(homeDir string) DriverContext + InitNetwork func(bIface, bIP string, disableIptables bool) error + LoadContext func(persisted map[string]interface{}) (DriverContext, error) + SupportLazyMode func() bool + var HDriver HypervisorDriver + type InitConnectedEvent struct + func (qe *InitConnectedEvent) Event() int + type InitFailedEvent struct + Reason string + func (qe *InitFailedEvent) Event() int + type InterfaceCreated struct + Bridge string + DeviceName string + Fd *os.File + HostDevice string + Index int + IpAddr string + MacAddr string + NetMask string + PCIAddr int + RouteTable []*RouteRule + func (qe *InterfaceCreated) Event() int + type InterfaceReleased struct + Index int + Success bool + func (qe *InterfaceReleased) Event() int + type Interrupted struct + Reason string + func (qe *Interrupted) Event() int + type LazyDriverContext interface + InitVM func(ctx *VmContext) error + LazyAddDisk func(ctx *VmContext, name, sourceType, filename, format string, id int) + LazyAddNic func(ctx *VmContext, host *HostNicInfo, guest *GuestNicInfo) + LazyLaunch func(ctx *VmContext) + type LogStatus struct + Copier *logger.Copier + Driver logger.Logger + LogPath string + type NetDevInsertedEvent struct + Address int + DeviceName string + Index int + func (qe *NetDevInsertedEvent) Event() int + type NetDevRemovedEvent struct + Index int + func (qe *NetDevRemovedEvent) Event() int + type NewContainerCommand struct + func (qe *NewContainerCommand) Event() int + type OnlineCpuMemCommand struct + func (qe *OnlineCpuMemCommand) Event() int + type PersistInfo struct + DriverInfo map[string]interface{} + HwStat *VmHwStatus + Id string + NetworkList []*PersistNetworkInfo + UserSpec *pod.UserPod + VmSpec *hyperstartapi.Pod + VolumeList []*PersistVolumeInfo + type PersistNetworkInfo struct + DeviceName string + Index int + IpAddr string + PciAddr int + type PersistVolumeInfo struct + Containers []int + DeviceName string + Filename string + Format string + Fstype string + MontPoints []string + Name string + ScsiId int + type PodFinished struct + func (qe *PodFinished) Event() int + type PodStatus struct + Autoremove bool + Containers []*Container + FinishedAt string + Handler HandleEvent + Id string + Name string + ResourcePath string + RestartPolicy string + StartedAt string + Status uint + Type string + Vm string + Wg *sync.WaitGroup + func NewPod(podId string, userPod *pod.UserPod) *PodStatus + func (mypod *PodStatus) AddContainer(containerId, name, image string, cmds []string, status uint32) + func (mypod *PodStatus) GetPodIP(vm *Vm) []string + func (mypod *PodStatus) SetContainerStatus(status uint32) + func (mypod *PodStatus) SetPodContainerStatus(data []uint32) + type PreparingItem interface + ItemType func() string + type ReleaseVMCommand struct + func (qe *ReleaseVMCommand) Event() int + type ReplacePodCommand RunPodCommand + func (qe *ReplacePodCommand) Event() int + type RouteRule struct + Destination string + Gateway string + ViaThis bool + type RunPodCommand struct + Containers []*ContainerInfo + Spec *pod.UserPod + Volumes map[string]*VolumeInfo + Wg *sync.WaitGroup + func (qe *RunPodCommand) Event() int + type RunningContainer struct + Id string + type ShutdownCommand struct + Wait bool + func (qe *ShutdownCommand) Event() int + type StopPodCommand struct + func (qe *StopPodCommand) Event() int + type TtyIO struct + Callback chan *types.VmResponse + ClientTag string + ExitCode uint8 + Stdin io.ReadCloser + Stdout io.WriteCloser + func (tty *TtyIO) Close(code uint8) string + func (tty *TtyIO) WaitForFinish() error + type Vm struct + Cpu int + Hub chan VmEvent + Id string + Lazy bool + Mem int + Pod *PodStatus + Status uint + func GetVm(vmId string, b *BootConfig, waitStarted, lazy bool) (vm *Vm, err error) + func NewVm(vmId string, cpu, memory int, lazy bool) *Vm + func (vm *Vm) AddCpu(totalCpu int) error + func (vm *Vm) AddMem(totalMem int) error + func (vm *Vm) AddNic(idx int, name string, info pod.UserInterface) error + func (vm *Vm) AddProcess(container string, terminal bool, args []string, env []string, workdir string, ...) error + func (vm *Vm) AssociateVm(mypod *PodStatus, data []byte) error + func (vm *Vm) Attach(tty *TtyIO, container string, size *WindowSize) error + func (vm *Vm) Exec(container, cmd string, terminal bool, tty *TtyIO) error + func (vm *Vm) GenericOperation(name string, op func(ctx *VmContext, result chan<- error), states ...string) error + func (vm *Vm) GetLogOutput(container, tag string, callback chan *types.VmResponse) (io.ReadCloser, io.ReadCloser, error) + func (vm *Vm) GetResponseChan() (chan *types.VmResponse, error) + func (vm *Vm) Kill() (int, string, error) + func (vm *Vm) KillContainer(container string, signal syscall.Signal) error + func (vm *Vm) Launch(b *BootConfig) (err error) + func (vm *Vm) NewContainer(c *pod.UserContainer, info *ContainerInfo) error + func (vm *Vm) OnlineCpuMem() error + func (vm *Vm) Pause(pause bool) error + func (vm *Vm) ReadFile(container, target string) ([]byte, error) + func (vm *Vm) ReleaseResponseChan(ch chan *types.VmResponse) + func (vm *Vm) ReleaseVm() (int, error) + func (vm *Vm) Save(path string) error + func (vm *Vm) SendGenericOperation(name string, op func(ctx *VmContext, result chan<- error), states ...string) <-chan error + func (vm *Vm) SetCpus(cpus int) error + func (vm *Vm) StartPod(mypod *PodStatus, userPod *pod.UserPod, cList []*ContainerInfo, ...) *types.VmResponse + func (vm *Vm) Stats() *types.VmResponse + func (vm *Vm) StopPod(mypod *PodStatus) *types.VmResponse + func (vm *Vm) Tty(tag string, row, column int) error + func (vm *Vm) WriteFile(container, target string, data []byte) error + type VmContext struct + Boot *BootConfig + ConsoleSockName string + DCtx DriverContext + HomeDir string + Hub chan VmEvent + HyperSockName string + Id string + InterfaceCount int + Paused bool + ShareDir string + TtySockName string + func InitContext(id string, hub chan VmEvent, client chan *types.VmResponse, dc DriverContext, ...) (*VmContext, error) + func (ctx *VmContext) Become(handler stateHandler, desc string) + func (ctx *VmContext) Close() + func (ctx *VmContext) ConfigureInterface(index int, pciAddr int, name string, config pod.UserInterface, ...) + func (ctx *VmContext) CreateInterface(index int, pciAddr int, name string) + func (ctx *VmContext) InitDeviceContext(spec *pod.UserPod, wg *sync.WaitGroup, cInfo []*ContainerInfo, ...) + func (ctx *VmContext) Lookup(container string) int + func (ctx *VmContext) ReleaseInterface(index int, ipAddr string, file *os.File, maps []pod.UserContainerPort) + type VmEvent interface + Event func() int + type VmExit struct + func (qe *VmExit) Event() int + type VmHwStatus struct + AttachId uint64 + PciAddr int + ScsiId int + type VmKilledEvent struct + Success bool + func (qe *VmKilledEvent) Event() int + type VmStartFailEvent struct + Message string + func (qe *VmStartFailEvent) Event() int + type VmTimeout struct + func (qe *VmTimeout) Event() int + type VolumeInfo struct + DockerVolume bool + Filepath string + Format string + Fstype string + Name string + type VolumeReadyEvent struct + Filepath string + Format string + Fstype string + Name string + func (qe *VolumeReadyEvent) Event() int + type VolumeUnmounted struct + Name string + Success bool + func (qe *VolumeUnmounted) Event() int + type WindowSize struct + Column uint16 + Row uint16 + type WindowSizeCommand struct + ClientTag string + Size *WindowSize + func (qe *WindowSizeCommand) Event() int v0.5.0 Feb 5, 2016 v0.4.0 Sep 15, 2015