Delivery Status Notification (Delay)
** Delivery incomplete **
There was a temporary problem delivering your message to [email protected]. Gmail will retry for 22 more hours. You'll be notified if the delivery fails permanently.
-------------------------Blur-------------------------
This email is forwarded from a MASKED EMAIL you created using Blur. (https://dnt.abine.com/#help/faq/faq-whataremaskedemails).
IF THIS IS SPAM, CLICK HERE TO BLOCK:
https://dnt.abine.com/#/block_email/[email protected]/FWD-737QHYSMHVAYQAUCAOIQBDAAGAQLMA2YAMHECCJDLIBAYAWYAKIAZAQHSMCCWMBLIA4UANQUEIGCIMBKMAZUZ4AAEAACA===@opayq.com
Want to shop safely and privately online? Go Premium: https://dnt.abine.com/?pk_campaign=maskHeader#premium
-------------------------by Abine-------------------------
commit 453713b175003a6241f4560c784472d86f83c64b
Author: Ronald Rojas <[email protected]> AuthorDate: Wed Apr 5 17:05:47 2017 +0100 Commit: George Dunlap <[email protected]> CommitDate: Thu Apr 6 15:34:06 2017 +0100
golang/xenlight: Add host-related functionality
Add calls for the following host-related functionality:
- libxl_get_max_cpus
- libxl_get_online_cpus
- libxl_get_max_nodes
- libxl_get_free_memory
- libxl_get_physinfo
- libxl_get_version_info
Include Golang versions of the following structs:
- libxl_physinfo as Physinfo
- libxl_version_info as VersionInfo
- libxl_hwcap as Hwcap
--- tools/golang/xenlight/xenlight.go | 200 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 200 insertions(+)
tools/golang/xenlight/xenlight.go +80 -1
@@ -118,6 +118,103 @@ type Context struct { logger *C.xentoollog_logger_stdiostream } +type Hwcap []C.uint32_t + +func (chwcap C.libxl_hwcap) CToGo() (ghwcap Hwcap) { + // Alloc a Go slice for the bytes + size := 8 + ghwcap = make([]C.uint32_t, size) + + // Make a slice pointing to the C array + mapslice := (*[1 << 30]C.uint32_t)(unsafe.Pointer(&chwcap[0]))[:size:size] + + // And copy the C array into the Go array + copy(ghwcap, mapslice) + + return +} + +/* + * Types: IDL + * + * FIXME: Generate these automatically from the IDL + */ + +type Physinfo struct { + ThreadsPerCore uint32 + CoresPerSocket uint32 + MaxCpuId uint32 + NrCpus uint32 + CpuKhz uint32 + TotalPages uint64 + FreePages uint64 + ScrubPages uint64 + OutstandingPages uint64 + SharingFreedPages uint64 + SharingUsedFrames uint64 + NrNodes uint32 + HwCap Hwcap + CapHvm bool + CapHvmDirectio bool +} + +func (cphys *C.libxl_physinfo) toGo() (physinfo *Physinfo) { + + physinfo = &Physinfo{} + physinfo.ThreadsPerCore = uint32(cphys.threads_per_core) + physinfo.CoresPerSocket = uint32(cphys.cores_per_socket) + physinfo.MaxCpuId = uint32(cphys.max_cpu_id) + physinfo.NrCpus = uint32(cphys.nr_cpus) + physinfo.CpuKhz = uint32(cphys.cpu_khz) + physinfo.TotalPages = uint64(cphys.total_pages) + physinfo.FreePages = uint64(cphys.free_pages) + physinfo.ScrubPages = uint64(cphys.scrub_pages) + physinfo.ScrubPages = uint64(cphys.scrub_pages) + physinfo.SharingFreedPages = uint64(cphys.sharing_freed_pages) + physinfo.SharingUsedFrames = uint64(cphys.sharing_used_frames) + physinfo.NrNodes = uint32(cphys.nr_nodes) + physinfo.HwCap = cphys.hw_cap.CToGo() + physinfo.CapHvm = bool(cphys.cap_hvm) + physinfo.CapHvmDirectio = bool(cphys.cap_hvm_directio) + + return +} + +type VersionInfo struct { + XenVersionMajor int + XenVersionMinor int + XenVersionExtra string + Compiler string + CompileBy string + CompileDomain string + CompileDate string + Capabilities string + Changeset string + VirtStart uint64 + Pagesize int + Commandline string + BuildId string +} + +func (cinfo *C.libxl_version_info) toGo() (info *VersionInfo) { + info = ----- Message truncated -----
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel