@@ -633,9 +633,11 @@ func (ctx *Context) CpupoolInfo(Poolid uint32) (pool Cpupoolinfo, err error) {
}
// int libxl_cpupool_create(libxl_ctx *ctx, const char *name,
-// libxl_scheduler sched,
-// libxl_bitmap cpumap, libxl_uuid *uuid,
-// uint32_t *poolid);
+//
+// libxl_scheduler sched,
+// libxl_bitmap cpumap, libxl_uuid *uuid,
+// uint32_t *poolid);
+//
// FIXME: uuid
// FIXME: Setting poolid
func (ctx *Context) CpupoolCreate(Name string, Scheduler Scheduler, Cpumap Bitmap) (err error, Poolid uint32) {
@@ -688,7 +690,8 @@ func (ctx *Context) CpupoolCpuadd(Poolid uint32, Cpu int) (err error) {
}
// int libxl_cpupool_cpuadd_cpumap(libxl_ctx *ctx, uint32_t poolid,
-// const libxl_bitmap *cpumap);
+//
+// const libxl_bitmap *cpumap);
func (ctx *Context) CpupoolCpuaddCpumap(Poolid uint32, Cpumap Bitmap) (err error) {
var cbm C.libxl_bitmap
if err = Cpumap.toC(&cbm); err != nil {
@@ -717,7 +720,8 @@ func (ctx *Context) CpupoolCpuremove(Poolid uint32, Cpu int) (err error) {
}
// int libxl_cpupool_cpuremove_cpumap(libxl_ctx *ctx, uint32_t poolid,
-// const libxl_bitmap *cpumap);
+//
+// const libxl_bitmap *cpumap);
func (ctx *Context) CpupoolCpuremoveCpumap(Poolid uint32, Cpumap Bitmap) (err error) {
var cbm C.libxl_bitmap
if err = Cpumap.toC(&cbm); err != nil {
@@ -789,9 +793,7 @@ func (ctx *Context) CpupoolMovedomain(Poolid uint32, Id Domid) (err error) {
return
}
-//
// Utility functions
-//
func (ctx *Context) CpupoolFindByName(name string) (info Cpupoolinfo, found bool) {
plist := ctx.ListCpupool()
@@ -939,7 +941,7 @@ func (bm Bitmap) String() (s string) {
return
}
-//int libxl_get_max_cpus(libxl_ctx *ctx);
+// int libxl_get_max_cpus(libxl_ctx *ctx);
func (ctx *Context) GetMaxCpus() (maxCpus int, err error) {
ret := C.libxl_get_max_cpus(ctx.ctx)
if ret < 0 {
@@ -950,7 +952,7 @@ func (ctx *Context) GetMaxCpus() (maxCpus int, err error) {
return
}
-//int libxl_get_online_cpus(libxl_ctx *ctx);
+// int libxl_get_online_cpus(libxl_ctx *ctx);
func (ctx *Context) GetOnlineCpus() (onCpus int, err error) {
ret := C.libxl_get_online_cpus(ctx.ctx)
if ret < 0 {
@@ -961,7 +963,7 @@ func (ctx *Context) GetOnlineCpus() (onCpus int, err error) {
return
}
-//int libxl_get_max_nodes(libxl_ctx *ctx);
+// int libxl_get_max_nodes(libxl_ctx *ctx);
func (ctx *Context) GetMaxNodes() (maxNodes int, err error) {
ret := C.libxl_get_max_nodes(ctx.ctx)
if ret < 0 {
@@ -972,7 +974,7 @@ func (ctx *Context) GetMaxNodes() (maxNodes int, err error) {
return
}
-//int libxl_get_free_memory(libxl_ctx *ctx, uint64_t *memkb);
+// int libxl_get_free_memory(libxl_ctx *ctx, uint64_t *memkb);
func (ctx *Context) GetFreeMemory() (memkb uint64, err error) {
var cmem C.uint64_t
ret := C.libxl_get_free_memory(ctx.ctx, &cmem)
@@ -987,7 +989,7 @@ func (ctx *Context) GetFreeMemory() (memkb uint64, err error) {
}
-//int libxl_get_physinfo(libxl_ctx *ctx, libxl_physinfo *physinfo)
+// int libxl_get_physinfo(libxl_ctx *ctx, libxl_physinfo *physinfo)
func (ctx *Context) GetPhysinfo() (physinfo *Physinfo, err error) {
var cphys C.libxl_physinfo
C.libxl_physinfo_init(&cphys)
@@ -1005,7 +1007,7 @@ func (ctx *Context) GetPhysinfo() (physinfo *Physinfo, err error) {
return
}
-//const libxl_version_info* libxl_get_version_info(libxl_ctx *ctx);
+// const libxl_version_info* libxl_get_version_info(libxl_ctx *ctx);
func (ctx *Context) GetVersionInfo() (info *VersionInfo, err error) {
var cinfo *C.libxl_version_info
@@ -1044,7 +1046,7 @@ func (ctx *Context) DomainUnpause(Id Domid) (err error) {
return
}
-//int libxl_domain_pause(libxl_ctx *ctx, uint32_t domain);
+// int libxl_domain_pause(libxl_ctx *ctx, uint32_t domain);
func (ctx *Context) DomainPause(id Domid) (err error) {
ret := C.libxl_domain_pause(ctx.ctx, C.uint32_t(id), nil)
@@ -1054,7 +1056,7 @@ func (ctx *Context) DomainPause(id Domid) (err error) {
return
}
-//int libxl_domain_shutdown(libxl_ctx *ctx, uint32_t domid);
+// int libxl_domain_shutdown(libxl_ctx *ctx, uint32_t domid);
func (ctx *Context) DomainShutdown(id Domid) (err error) {
ret := C.libxl_domain_shutdown(ctx.ctx, C.uint32_t(id), nil)
@@ -1064,7 +1066,7 @@ func (ctx *Context) DomainShutdown(id Domid) (err error) {
return
}
-//int libxl_domain_reboot(libxl_ctx *ctx, uint32_t domid);
+// int libxl_domain_reboot(libxl_ctx *ctx, uint32_t domid);
func (ctx *Context) DomainReboot(id Domid) (err error) {
ret := C.libxl_domain_reboot(ctx.ctx, C.uint32_t(id), nil)
@@ -1074,8 +1076,8 @@ func (ctx *Context) DomainReboot(id Domid) (err error) {
return
}
-//libxl_dominfo * libxl_list_domain(libxl_ctx*, int *nb_domain_out);
-//void libxl_dominfo_list_free(libxl_dominfo *list, int nb_domain);
+// libxl_dominfo * libxl_list_domain(libxl_ctx*, int *nb_domain_out);
+// void libxl_dominfo_list_free(libxl_dominfo *list, int nb_domain);
func (ctx *Context) ListDomain() (glist []Dominfo) {
var nbDomain C.int
clist := C.libxl_list_domain(ctx.ctx, &nbDomain)
@@ -1095,9 +1097,11 @@ func (ctx *Context) ListDomain() (glist []Dominfo) {
return
}
-//libxl_vcpuinfo *libxl_list_vcpu(libxl_ctx *ctx, uint32_t domid,
-// int *nb_vcpu, int *nr_cpus_out);
-//void libxl_vcpuinfo_list_free(libxl_vcpuinfo *, int nr_vcpus);
+// libxl_vcpuinfo *libxl_list_vcpu(libxl_ctx *ctx, uint32_t domid,
+//
+// int *nb_vcpu, int *nr_cpus_out);
+//
+// void libxl_vcpuinfo_list_free(libxl_vcpuinfo *, int nr_vcpus);
func (ctx *Context) ListVcpu(id Domid) (glist []Vcpuinfo) {
var nbVcpu C.int
var nrCpu C.int
@@ -1126,8 +1130,8 @@ func (ct ConsoleType) String() (str string) {
return
}
-//int libxl_console_get_tty(libxl_ctx *ctx, uint32_t domid, int cons_num,
-//libxl_console_type type, char **path);
+// int libxl_console_get_tty(libxl_ctx *ctx, uint32_t domid, int cons_num,
+// libxl_console_type type, char **path);
func (ctx *Context) ConsoleGetTty(id Domid, consNum int, conType ConsoleType) (path string, err error) {
var cpath *C.char
ret := C.libxl_console_get_tty(ctx.ctx, C.uint32_t(id), C.int(consNum), C.libxl_console_type(conType), &cpath)
@@ -1141,8 +1145,9 @@ func (ctx *Context) ConsoleGetTty(id Domid, consNum int, conType ConsoleType) (p
return
}
-//int libxl_primary_console_get_tty(libxl_ctx *ctx, uint32_t domid_vm,
-// char **path);
+// int libxl_primary_console_get_tty(libxl_ctx *ctx, uint32_t domid_vm,
+//
+// char **path);
func (ctx *Context) PrimaryConsoleGetTty(domid uint32) (path string, err error) {
var cpath *C.char
ret := C.libxl_primary_console_get_tty(ctx.ctx, C.uint32_t(domid), &cpath)
No functional change. Signed-off-by: George Dunlap <george.dunlap@cloud.com> --- CC: Nick Rosbrook <rosbrookn@gmail.com> CC: Anthony PERARD <anthony.perard@citrix.com> --- tools/golang/xenlight/xenlight.go | 55 +++++++++++++++++-------------- 1 file changed, 30 insertions(+), 25 deletions(-)