golang/xenlight: Fixing compilation for go 1.11
PATCH 1/1 golang/xenlight: Fixing compilation for go 1.11
This deals with two casting issues for compiling under go 1.11:
- explicitly cast to *C.xentoollog_logger for Ctx.logger pointer
- add cast to unsafe.Pointer for the C string cpath
--- tools/golang/xenlight/xenlight.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
tools/golang/xenlight/xenlight.go +4 -4
@@ -854,7 +854,7 @@ func (Ctx *Context) Open() (err error) { } ret := C.libxl_ctx_alloc(&Ctx.ctx, C.LIBXL_VERSION, - 0, unsafe.Pointer(Ctx.logger)) + 0, (*C.xentoollog_logger)(unsafe.Pointer(Ctx.logger))) if ret != 0 { err = Error(-ret)
@@ -869,7 +869,7 @@ func (Ctx *Context) Close() (err error) { if ret != 0 { err = Error(-ret) } - C.xtl_logger_destroy(unsafe.Pointer(Ctx.logger)) + C.xtl_logger_destroy((*C.xentoollog_logger)(unsafe.Pointer(Ctx.logger))) return }
@@ -1170,7 +1170,7 @@ func (Ctx *Context) ConsoleGetTty(id Domid, consNum int, conType ConsoleType) (p err = Error(-ret) return } - defer C.free(cpath) + defer C.free(unsafe.Pointer(cpath)) path = C.GoString(cpath) return
@@ -1190,7 +1190,7 @@ func (Ctx *Context) PrimaryConsoleGetTty(domid uint32) (path string, err error) err = Error(-ret) return } - defer C.free(cpath) + defer C.free(unsafe.Pointer(cpath)) path = C.GoString(cpath) return
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 5 lines · Daniel P. Smith
This deals with two casting issues for compiling under go 1.11:
- explicitly cast to *C.xentoollog_logger for Ctx.logger pointer
- add cast to unsafe.Pointer for the C string cpathSigned-off-by Daniel P. Smith <[email protected]>
BTW, do you know if this will compile for older versions of go?
This should be considered for backport as well (cc'ing Jan).
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 10 lines · George Dunlap
Quoted 5 lines · Daniel P. Smith
This deals with two casting issues for compiling under go 1.11:
- explicitly cast to *C.xentoollog_logger for Ctx.logger pointer
- add cast to unsafe.Pointer for the C string cpathSigned-off-by Daniel P. Smith <[email protected]>Reviewed-by George Dunlap <[email protected]>BTW, do you know if this will compile for older versions of go?
Per the suggestion on IRC, I did a test compile with golang 1.10.8 as the version available with Ubuntu 18.04 was 1.10.1. Since this matters, the environment was setup with Xen 4.12 tools. If there are additional variations you would like to see, please let me know as I am using a docker container setup for reproducible build environments and should be able to spin up different variations fairly easily.
Quoted 2 lines
This should be considered for backport as well (cc'ing Jan).
Ack and thank you.
V/r,
Daniel P. Smith
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 10 lines · Daniel P. Smith
Quoted 9 lines · George Dunlap
Quoted 5 lines · Daniel P. Smith
This deals with two casting issues for compiling under go 1.11:
- explicitly cast to *C.xentoollog_logger for Ctx.logger pointer
- add cast to unsafe.Pointer for the C string cpathSigned-off-by Daniel P. Smith <[email protected]>Reviewed-by George Dunlap <[email protected]>
Quoted 9 lines
Quoted 1 line
BTW, do you know if this will compile for older versions of go?
Per the suggestion on IRC, I did a test compile with golang 1.10.8 as the version available with Ubuntu 18.04 was 1.10.1. Since this matters, the environment was setup with Xen 4.12 tools. If there are additional variations you would like to see, please let me know as I am using a docker container setup for reproducible build environments and should be able to spin up different variations fairly easily.
Ubuntu 16.04 LTS seems to ship golang 1.6 as a default.
CentOS7 used to ship golang 1.9 in CentOS 7.5 and earlier (in extras repo), but currently in CentOS 7.6+ has golang 1.10 (in SCL) and 1.11 (in epel) available.
Thanks,
-- Pasi
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 6 lines
Quoted 1 line
Quoted 1 line · On 18.04.19 at 15:11, <[email protected]> wrote:
Quoted 4 lines · Daniel P. Smith
This deals with two casting issues for compiling under go 1.11:
- explicitly cast to *C.xentoollog_logger for Ctx.logger pointer
- add cast to unsafe.Pointer for the C string cpath
Quoted 7 lines
Quoted 1 line
Signed-off-by Daniel P. Smith <[email protected]>Reviewed-by George Dunlap <[email protected]>BTW, do you know if this will compile for older versions of go?
This should be considered for backport as well (cc'ing Jan).
Did you mean Ian, this being a tools patch?
Jan
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 8 lines · Jan Beulich
Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 18.04.19 at 15:11, <[email protected]> wrote:
Quoted 5 lines · Daniel P. Smith
This deals with two casting issues for compiling under go 1.11:
- explicitly cast to *C.xentoollog_logger for Ctx.logger pointer
- add cast to unsafe.Pointer for the C string cpathSigned-off-by Daniel P. Smith <[email protected]>
Quoted 7 lines
Quoted 5 lines
Reviewed-by George Dunlap <[email protected]>BTW, do you know if this will compile for older versions of go?
This should be considered for backport as well (cc'ing Jan).
Did you mean Ian, this being a tools patch?
I guess so. Sorry, I didn't realize Ian was doing the tools backports.
-George
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 15 lines · George Dunlap
Quoted 12 lines · Jan Beulich
Quoted 12 lines
Quoted 7 lines
Quoted 1 line · On 18.04.19 at 15:11, <[email protected]> wrote:
On 4/18/19 2:52 AM, Daniel P. Smith wrote:
This deals with two casting issues for compiling under go 1.11:
- explicitly cast to *C.xentoollog_logger for Ctx.logger pointer
- add cast to unsafe.Pointer for the C string cpathSigned-off-by Daniel P. Smith <[email protected]>Reviewed-by George Dunlap <[email protected]>BTW, do you know if this will compile for older versions of go?
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
This should be considered for backport as well (cc'ing Jan).
Did you mean Ian, this being a tools patch?
I guess so. Sorry, I didn't realize Ian was doing the tools backports.
-George
With the golang tools maintainer change completed, is anything further needed for this patch to be merged?
Rich
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 21 lines · Rich Persaud
Quoted 18 lines · George Dunlap
Quoted 14 lines · Jan Beulich
Quoted 13 lines
Quoted 7 lines
Quoted 1 line · On 18.04.19 at 15:11, <[email protected]> wrote:
On 4/18/19 2:52 AM, Daniel P. Smith wrote:
This deals with two casting issues for compiling under go 1.11:
- explicitly cast to *C.xentoollog_logger for Ctx.logger pointer
- add cast to unsafe.Pointer for the C string cpathSigned-off-by Daniel P. Smith <[email protected]>Reviewed-by George Dunlap <[email protected]>BTW, do you know if this will compile for older versions of go?
This should be considered for backport as well (cc'ing Jan).
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Did you mean Ian, this being a tools patch?
I guess so. Sorry, I didn't realize Ian was doing the tools backports.
-George
With the golang tools maintainer change completed, is anything further needed for this patch to be merged?
My change to the MAINTAINERS file hasn’t yet been merged; I think it would be good to wait until the tools maintainer (who technically is currently the maintainer) can Ack the patch.
I’ll ping Ian privately to make sure he doesn’t miss it.
-George
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 29 lines · George Dunlap
Quoted 26 lines · Rich Persaud
Quoted 22 lines · George Dunlap
Quoted 8 lines · Jan Beulich
Quoted 8 lines
Quoted 7 lines
Quoted 1 line · On 18.04.19 at 15:11, <[email protected]> wrote:
On 4/18/19 2:52 AM, Daniel P. Smith wrote:
This deals with two casting issues for compiling under go 1.11:
- explicitly cast to *C.xentoollog_logger for Ctx.logger pointer
- add cast to unsafe.Pointer for the C string cpathSigned-off-by Daniel P. Smith <[email protected]>Quoted 7 lines
Quoted 5 lines
Reviewed-by George Dunlap <[email protected]>BTW, do you know if this will compile for older versions of go?
This should be considered for backport as well (cc'ing Jan).
Did you mean Ian, this being a tools patch?
I guess so. Sorry, I didn't realize Ian was doing the tools backports.
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
-George
With the golang tools maintainer change completed, is anything further needed for this patch to be merged?
My change to the
MAINTAINERSfile hasn’t yet been merged; I think it would be good to wait until the tools maintainer (who technically is currently the maintainer) can Ack the patch.I’ll ping Ian privately to make sure he doesn’t miss it.
OK, he’s acked it privately, so I’ll check that in and then catch these.
-George
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel