[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] golang/xenlight: define MsVmGenid builtin type



commit 4993745554846ee8e9a363b30f9031109e726f1b
Author:     Nick Rosbrook <rosbrookn@xxxxxxxxxxxx>
AuthorDate: Mon Dec 16 18:08:04 2019 +0000
Commit:     George Dunlap <george.dunlap@xxxxxxxxxx>
CommitDate: Mon Dec 16 18:08:04 2019 +0000

    golang/xenlight: define MsVmGenid builtin type
    
    Define MsVmGenid as [int(C.LIBXL_MS_VM_GENID_LEN)]byte and implement fromC 
and toC functions.
    
    Signed-off-by: Nick Rosbrook <rosbrookn@xxxxxxxxxxxx>
    Reviewed-by: George Dunlap <george.dunlap@xxxxxxxxxx>
---
 tools/golang/xenlight/xenlight.go | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/tools/golang/xenlight/xenlight.go 
b/tools/golang/xenlight/xenlight.go
index 17d146771e..6c3868cd69 100644
--- a/tools/golang/xenlight/xenlight.go
+++ b/tools/golang/xenlight/xenlight.go
@@ -214,6 +214,27 @@ func (mac Mac) toC() (C.libxl_mac, error) {
        return cmac, nil
 }
 
+// MsVmGenid represents a libxl_ms_vm_genid.
+type MsVmGenid [int(C.LIBXL_MS_VM_GENID_LEN)]byte
+
+func (mvg *MsVmGenid) fromC(cmvg *C.libxl_ms_vm_genid) error {
+       for i := range *mvg {
+               mvg[i] = byte(cmvg.bytes[i])
+       }
+
+       return nil
+}
+
+func (mvg *MsVmGenid) toC() (C.libxl_ms_vm_genid, error) {
+       var cmvg C.libxl_ms_vm_genid
+
+       for i, v := range mvg {
+               cmvg.bytes[i] = C.uint8_t(v)
+       }
+
+       return cmvg, nil
+}
+
 type Context struct {
        ctx    *C.libxl_ctx
        logger *C.xentoollog_logger_stdiostream
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.