Documentation
¶
Overview ¶
* Copyright (C) 2016 George W. Dunlap, Citrix Systems UK Ltd * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; If not, see <http://www.gnu.org/licenses/>.
Index ¶
- Constants
- type Bitmap
- func (a Bitmap) And(b Bitmap) (c Bitmap)
- func (bm *Bitmap) Clear(bit int)
- func (bm *Bitmap) ClearRange(start int, end int)
- func (bm *Bitmap) IsEmpty() bool
- func (bm *Bitmap) Max() int
- func (bm *Bitmap) Set(bit int)
- func (bm *Bitmap) SetRange(start int, end int)
- func (bm Bitmap) String() (s string)
- func (bm *Bitmap) Test(bit int) bool
- type ConsoleType
- type Context
- func (Ctx *Context) CheckOpen() (err error)
- func (Ctx *Context) Close() (err error)
- func (Ctx *Context) ConsoleGetTty(id Domid, consNum int, conType ConsoleType) (path string, err error)
- func (Ctx *Context) CpupoolCpuadd(Poolid uint32, Cpu int) (err error)
- func (Ctx *Context) CpupoolCpuaddCpumap(Poolid uint32, Cpumap Bitmap) (err error)
- func (Ctx *Context) CpupoolCpuaddNode(Poolid uint32, Node int) (Cpus int, err error)
- func (Ctx *Context) CpupoolCpuremove(Poolid uint32, Cpu int) (err error)
- func (Ctx *Context) CpupoolCpuremoveCpumap(Poolid uint32, Cpumap Bitmap) (err error)
- func (Ctx *Context) CpupoolCpuremoveNode(Poolid uint32, Node int) (Cpus int, err error)
- func (Ctx *Context) CpupoolCreate(Name string, Scheduler Scheduler, Cpumap Bitmap) (err error, Poolid uint32)
- func (Ctx *Context) CpupoolDestroy(Poolid uint32) (err error)
- func (Ctx *Context) CpupoolFindByName(name string) (info CpupoolInfo, found bool)
- func (Ctx *Context) CpupoolInfo(Poolid uint32) (pool CpupoolInfo)
- func (Ctx *Context) CpupoolMakeFree(Cpumap Bitmap) (err error)
- func (Ctx *Context) CpupoolMovedomain(Poolid uint32, Id Domid) (err error)
- func (Ctx *Context) CpupoolRename(Name string, Poolid uint32) (err error)
- func (Ctx *Context) DomainInfo(Id Domid) (di *Dominfo, err error)
- func (Ctx *Context) DomainPause(id Domid) (err error)
- func (Ctx *Context) DomainReboot(id Domid) (err error)
- func (Ctx *Context) DomainShutdown(id Domid) (err error)
- func (Ctx *Context) DomainUnpause(Id Domid) (err error)
- func (Ctx *Context) GetFreeMemory() (memkb uint64, err error)
- func (Ctx *Context) GetMaxCpus() (maxCpus int, err error)
- func (Ctx *Context) GetMaxNodes() (maxNodes int, err error)
- func (Ctx *Context) GetOnlineCpus() (onCpus int, err error)
- func (Ctx *Context) GetPhysinfo() (physinfo *Physinfo, err error)
- func (Ctx *Context) GetVersionInfo() (info *VersionInfo, err error)
- func (Ctx *Context) IsOpen() bool
- func (Ctx *Context) ListCpupool() (list []CpupoolInfo)
- func (Ctx *Context) ListDomain() (glist []Dominfo)
- func (Ctx *Context) ListVcpu(id Domid) (glist []Vcpuinfo)
- func (Ctx *Context) Open() (err error)
- func (Ctx *Context) PrimaryConsoleGetTty(domid uint32) (path string, err error)
- type CpupoolInfo
- type DomainType
- type Domid
- type Dominfo
- type Error
- type Hwcap
- type MemKB
- type Physinfo
- type Scheduler
- type ShutdownReason
- type Uuid
- type Vcpuinfo
- type VersionInfo
Constants ¶
const ( ErrorNonspecific = Error(-C.ERROR_NONSPECIFIC) ErrorVersion = Error(-C.ERROR_VERSION) ErrorFail = Error(-C.ERROR_FAIL) ErrorNi = Error(-C.ERROR_NI) ErrorNomem = Error(-C.ERROR_NOMEM) ErrorInval = Error(-C.ERROR_INVAL) ErrorBadfail = Error(-C.ERROR_BADFAIL) ErrorGuestTimedout = Error(-C.ERROR_GUEST_TIMEDOUT) ErrorTimedout = Error(-C.ERROR_TIMEDOUT) ErrorNoparavirt = Error(-C.ERROR_NOPARAVIRT) ErrorNotReady = Error(-C.ERROR_NOT_READY) ErrorOseventRegFail = Error(-C.ERROR_OSEVENT_REG_FAIL) ErrorBufferfull = Error(-C.ERROR_BUFFERFULL) ErrorUnknownChild = Error(-C.ERROR_UNKNOWN_CHILD) ErrorLockFail = Error(-C.ERROR_LOCK_FAIL) ErrorJsonConfigEmpty = Error(-C.ERROR_JSON_CONFIG_EMPTY) ErrorDeviceExists = Error(-C.ERROR_DEVICE_EXISTS) ErrorCheckpointDevopsDoesNotMatch = Error(-C.ERROR_CHECKPOINT_DEVOPS_DOES_NOT_MATCH) ErrorCheckpointDeviceNotSupported = Error(-C.ERROR_CHECKPOINT_DEVICE_NOT_SUPPORTED) ErrorVnumaConfigInvalid = Error(-C.ERROR_VNUMA_CONFIG_INVALID) ErrorDomainNotfound = Error(-C.ERROR_DOMAIN_NOTFOUND) ErrorAborted = Error(-C.ERROR_ABORTED) ErrorNotfound = Error(-C.ERROR_NOTFOUND) ErrorDomainDestroyed = Error(-C.ERROR_DOMAIN_DESTROYED) ErrorFeatureRemoved = Error(-C.ERROR_FEATURE_REMOVED) )
const ( ShutdownReasonUnknown = ShutdownReason(C.LIBXL_SHUTDOWN_REASON_UNKNOWN) ShutdownReasonPoweroff = ShutdownReason(C.LIBXL_SHUTDOWN_REASON_POWEROFF) ShutdownReasonReboot = ShutdownReason(C.LIBXL_SHUTDOWN_REASON_REBOOT) ShutdownReasonSuspend = ShutdownReason(C.LIBXL_SHUTDOWN_REASON_SUSPEND) ShutdownReasonCrash = ShutdownReason(C.LIBXL_SHUTDOWN_REASON_CRASH) ShutdownReasonWatchdog = ShutdownReason(C.LIBXL_SHUTDOWN_REASON_WATCHDOG) ShutdownReasonSoftReset = ShutdownReason(C.LIBXL_SHUTDOWN_REASON_SOFT_RESET) )
const ( DomainTypeInvalid = DomainType(C.LIBXL_DOMAIN_TYPE_INVALID) DomainTypeHvm = DomainType(C.LIBXL_DOMAIN_TYPE_HVM) DomainTypePv = DomainType(C.LIBXL_DOMAIN_TYPE_PV) )
const ( ConsoleTypeUnknown = ConsoleType(C.LIBXL_CONSOLE_TYPE_UNKNOWN) ConsoleTypeSerial = ConsoleType(C.LIBXL_CONSOLE_TYPE_SERIAL) ConsoleTypePV = ConsoleType(C.LIBXL_CONSOLE_TYPE_PV) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bitmap ¶
type Bitmap struct {
// contains filtered or unexported fields
}
Implement the Go bitmap type such that the underlying data can easily be copied in and out. NB that we still have to do copies both directions, because cgo runtime restrictions forbid passing to a C function a pointer to a Go-allocated structure which contains a pointer.
func (*Bitmap) ClearRange ¶
type ConsoleType ¶
type ConsoleType int
func (ConsoleType) String ¶
func (ct ConsoleType) String() (str string)
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
var Ctx Context
* Context
func (*Context) ConsoleGetTty ¶
func (Ctx *Context) ConsoleGetTty(id Domid, consNum int, conType ConsoleType) (path string, err error)
int libxl_console_get_tty(libxl_ctx *ctx, uint32_t domid, int cons_num, libxl_console_type type, char **path);
func (*Context) CpupoolCpuadd ¶
int libxl_cpupool_cpuadd(libxl_ctx *ctx, uint32_t poolid, int cpu);
func (*Context) CpupoolCpuaddCpumap ¶
int libxl_cpupool_cpuadd_cpumap(libxl_ctx *ctx, uint32_t poolid,
const libxl_bitmap *cpumap);
func (*Context) CpupoolCpuaddNode ¶
int libxl_cpupool_cpuadd_node(libxl_ctx *ctx, uint32_t poolid, int node, int *cpus);
func (*Context) CpupoolCpuremove ¶
int libxl_cpupool_cpuremove(libxl_ctx *ctx, uint32_t poolid, int cpu);
func (*Context) CpupoolCpuremoveCpumap ¶
int libxl_cpupool_cpuremove_cpumap(libxl_ctx *ctx, uint32_t poolid,
const libxl_bitmap *cpumap);
func (*Context) CpupoolCpuremoveNode ¶
int libxl_cpupool_cpuremove_node(libxl_ctx *ctx, uint32_t poolid, int node, int *cpus);
func (*Context) CpupoolCreate ¶
func (Ctx *Context) CpupoolCreate(Name string, Scheduler Scheduler, Cpumap Bitmap) (err error, Poolid uint32)
int libxl_cpupool_create(libxl_ctx *ctx, const char *name,
libxl_scheduler sched, libxl_bitmap cpumap, libxl_uuid *uuid, uint32_t *poolid);
FIXME: uuid FIXME: Setting poolid
func (*Context) CpupoolDestroy ¶
int libxl_cpupool_destroy(libxl_ctx *ctx, uint32_t poolid);
func (*Context) CpupoolFindByName ¶
func (Ctx *Context) CpupoolFindByName(name string) (info CpupoolInfo, found bool)
Utility functions
func (*Context) CpupoolInfo ¶
func (Ctx *Context) CpupoolInfo(Poolid uint32) (pool CpupoolInfo)
int libxl_cpupool_info(libxl_ctx *ctx, libxl_cpupoolinfo *info, uint32_t poolid);
func (*Context) CpupoolMakeFree ¶
func (*Context) CpupoolMovedomain ¶
int libxl_cpupool_movedomain(libxl_ctx *ctx, uint32_t poolid, uint32_t domid);
func (*Context) CpupoolRename ¶
int libxl_cpupool_rename(libxl_ctx *ctx, const char *name, uint32_t poolid);
func (*Context) DomainPause ¶
int libxl_domain_pause(libxl_ctx *ctx, uint32_t domain);
func (*Context) DomainReboot ¶
int libxl_domain_reboot(libxl_ctx *ctx, uint32_t domid);
func (*Context) DomainShutdown ¶
int libxl_domain_shutdown(libxl_ctx *ctx, uint32_t domid);
func (*Context) DomainUnpause ¶
func (*Context) GetFreeMemory ¶
int libxl_get_free_memory(libxl_ctx *ctx, uint64_t *memkb);
func (*Context) GetMaxCpus ¶
int libxl_get_max_cpus(libxl_ctx *ctx);
func (*Context) GetMaxNodes ¶
int libxl_get_max_nodes(libxl_ctx *ctx);
func (*Context) GetOnlineCpus ¶
int libxl_get_online_cpus(libxl_ctx *ctx);
func (*Context) GetPhysinfo ¶
int libxl_get_physinfo(libxl_ctx *ctx, libxl_physinfo *physinfo)
func (*Context) GetVersionInfo ¶
func (Ctx *Context) GetVersionInfo() (info *VersionInfo, err error)
const libxl_version_info* libxl_get_version_info(libxl_ctx *ctx);
func (*Context) ListCpupool ¶
func (Ctx *Context) ListCpupool() (list []CpupoolInfo)
libxl_cpupoolinfo * libxl_list_cpupool(libxl_ctx*, int *nb_pool_out); void libxl_cpupoolinfo_list_free(libxl_cpupoolinfo *list, int nb_pool);
func (*Context) ListDomain ¶
libxl_dominfo * libxl_list_domain(libxl_ctx*, int *nb_domain_out); void libxl_dominfo_list_free(libxl_dominfo *list, int nb_domain);
type CpupoolInfo ¶
type DomainType ¶
type DomainType int32
func (DomainType) String ¶
func (dt DomainType) String() (str string)
type Dominfo ¶
type Dominfo struct { Uuid Uuid Domid Domid Ssidref uint32 SsidLabel string Running bool Blocked bool Paused bool Shutdown bool Dying bool NeverStop bool ShutdownReason int32 OutstandingMemkb MemKB CurrentMemkb MemKB PagedMemkb MemKB MaxMemkb MemKB CpuTime time.Duration VcpuMaxId uint32 VcpuOnline uint32 Cpupool uint32 DomainType int32 }
type Scheduler ¶
type Scheduler int
# Consistent with values defined in domctl.h # Except unknown which we have made up libxl_scheduler = Enumeration("scheduler", [
(0, "unknown"), (4, "sedf"), (5, "credit"), (6, "credit2"), (7, "arinc653"), (8, "rtds"), ])
var ( SchedulerUnknown Scheduler = C.LIBXL_SCHEDULER_UNKNOWN SchedulerSedf Scheduler = C.LIBXL_SCHEDULER_SEDF SchedulerCredit Scheduler = C.LIBXL_SCHEDULER_CREDIT SchedulerCredit2 Scheduler = C.LIBXL_SCHEDULER_CREDIT2 SchedulerArinc653 Scheduler = C.LIBXL_SCHEDULER_ARINC653 SchedulerRTDS Scheduler = C.LIBXL_SCHEDULER_RTDS )
func SchedulerFromString ¶
func (*Scheduler) FromString ¶
int libxl_scheduler_from_string(const char *s, libxl_scheduler *e);
type ShutdownReason ¶
type ShutdownReason int32
func (ShutdownReason) String ¶
func (sr ShutdownReason) String() (str string)
type Uuid ¶
type Uuid C.libxl_uuid