Re: [PATCH 1/5] golang: Add a minimum go version to go.mod

2020-05-23 Thread Nick Rosbrook
> `go build` wants to add the current go version to go.mod as the > minimum every time we run `make` in the directory. Add 1.11 (the > earliest Go version that supports modules) there to make it happy. > > Signed-off-by: George Dunlap Reviewed-by: Nick Rosbrook

Re: [PATCH 2/5] golang: Add a variable for the libxl source directory

2020-05-23 Thread Nick Rosbrook
> ...rather than duplicating the path in several places. > > Signed-off-by: George Dunlap Reviewed-by: Nick Rosbrook

Re: [PATCH 4/5] golang/xenlight: Use XEN_PKG_DIR variable rather than open-coding

2020-05-23 Thread Nick Rosbrook
> Signed-off-by: George Dunlap Reviewed-by: Nick Rosbrook

Re: [PATCH 4/5] golang/xenlight: Use XEN_PKG_DIR variable rather than open-coding

2020-05-23 Thread Nick Rosbrook
> > Signed-off-by: George Dunlap > Reviewed-by: Nick Rosbrook Oh, I just noticed your commit message calls the variable "XEN_PKG_DIR", but it's actually named "GOXL_PKG_DIR."

Re: [PATCH 3/5] libxl: Generate golang bindings in libxl Makefile

2020-05-23 Thread Nick Rosbrook
during a parallel build; but that shouldn't be an issue, since > tools/golang/xenlight should never be built until after tools/libxl > has completed building anyway. > > Signed-off-by: George Dunlap For the golang side: Reviewed-by: Nick Rosbrook

Re: [PATCH 5/5] gitignore: Ignore golang package directory

2020-05-23 Thread Nick Rosbrook
> Signed-off-by: George Dunlap Reviewed-by: Nick Rosbrook

Re: [PATCH 4/5] golang/xenlight: Use XEN_PKG_DIR variable rather than open-coding

2020-05-26 Thread Nick Rosbrook
On Tue, May 26, 2020 at 5:31 AM George Dunlap wrote: > > > > > On May 23, 2020, at 5:48 PM, Nick Rosbrook wrote: > > > >>> Signed-off-by: George Dunlap > >> Reviewed-by: Nick Rosbrook > > > > Oh, I just noticed your commit message calls t

[PATCH 5/5] gitignore: Ignore golang package directory

2020-05-26 Thread Nick Rosbrook
> With golang, you don’t really distribute package binaries; you only > distribute source files. > > However, we don’t want to wait until someone tries to clone the package to > see if we’ve broken the build; so the current makefile does a “build test” of > the package files. > > Before golang

[PATCH v2 2/5] golang/xenlight: Get rid of GOPATH-based build artefacts

2020-05-26 Thread Nick Rosbrook
> diff --git a/tools/golang/xenlight/Makefile b/tools/golang/xenlight/Makefile > index 8ab4cb5665..f8d8047524 100644 > --- a/tools/golang/xenlight/Makefile > +++ b/tools/golang/xenlight/Makefile > @@ -14,17 +14,8 @@ LIBXL_SRC_DIR = ../../libxl > .PHONY: all > all: build > > -.PHONY: package > -

[PATCH v2 2/5] golang/xenlight: Get rid of GOPATH-based build artefacts

2020-05-26 Thread Nick Rosbrook
the source > files. > > Signed-off-by: George Dunlap If you want to just make that change on check-in, Reviewed-by: Nick Rosbrook

[PATCH v2 1/5] libxl: Generate golang bindings in libxl Makefile

2020-06-04 Thread Nick Rosbrook
> The simplest short-term way to fix this would be to remove the `go fmt` call > from `gengotypes.py`. It’s actually relatively unusual for generated code to > look pretty (or even be looked at). We could also consider adding in some > “manual” formatting in gengotypes.py, like indentation, so

Re: [PATCH for-4.14] golang/xenlight: remove call to go fmt in gengotypes.py

2020-06-08 Thread Nick Rosbrook
On Mon, Jun 08, 2020 at 11:39:43AM +, George Dunlap wrote: > > > On Jun 6, 2020, at 5:10 PM, Nick Rosbrook wrote: > > > > Since the golang bindings are now set to be re-generated whenever a > > change is made to tools/libxl/libxl_types.idl, the call to go fmt in &

Re: [PATCH v2 1/5] libxl: Generate golang bindings in libxl Makefile

2020-06-08 Thread Nick Rosbrook
> > Out of curiosity, would it be totally out of the question to require > > having gofmt installed (not for 4.14, but in the future)? I ask because > > I haven't seen it discussed one way or the other. > > I think I’d like to try to avoid it, unless / until we have a “core > component” written i

Unexpected diff after autogen.sh

2020-06-10 Thread Nick Rosbrook
Hello, When writing a patch to tools/configure.ac, re-running autogen.sh resulted in a diff with unexpected changes. Specifically, these additions: diff --git a/configure b/configure index 8af54e8a5a..9da3970cef 100755 --- a/configure +++ b/configure @@ -644,6 +644,7 @@ infodi

Re: golang bindings dirty in tree after libxl build

2020-06-12 Thread Nick Rosbrook
On Fri, Jun 12, 2020 at 8:15 AM Andrew Cooper wrote: > > On 12/06/2020 12:59, George Dunlap wrote: > > > >> On Jun 12, 2020, at 12:00 PM, Andrew Cooper > >> wrote: > >> > >> Hello, > >> > >> I've just done a libxl build and got things such as: > >> > >> --- a/tools/golang/xenlight/helpers.gen.go

[PATCH for-4.14] tools: check go compiler version if present

2020-06-12 Thread Nick Rosbrook
Currently, no minimum go compiler version is required by the configure scripts. However, the go bindings actually will not build with some older versions of go. Add a check for a minimum go version of 1.11.1 in accordance with tools/golang/xenlight/go.mod. Signed-off-by: Nick Rosbrook --- m4

Re: [PATCH for-4.14] tools: check go compiler version if present

2020-06-12 Thread Nick Rosbrook
On Fri, Jun 12, 2020 at 05:40:21PM +0100, Ian Jackson wrote: > Nick Rosbrook writes ("[PATCH for-4.14] tools: check go compiler version if > present"): > > Currently, no minimum go compiler version is required by the configure > > scripts. However, the go bindings

Re: [PATCH for-4.14] tools: check go compiler version if present

2020-06-15 Thread Nick Rosbrook
> Ideally at some point maybe we would make this clearer but not now. Okay, sounds good. > Have you tested the situations you describe ? That might be a better > way of checking that it's right than the code inspection which is > obviously failing for me now... Yes, I have tested the following

[PATCH for-4.14] golang/xenlight: sort cases in switch statement

2020-06-15 Thread Nick Rosbrook
with different versions of python will now yield the same result. Signed-off-by: Nick Rosbrook --- Andrew reported this in [1], so I intend this as a build fix for 4.14. [1] https://lists.xenproject.org/archives/html/xen-devel/2020-06/msg00881.html --- tools/golang/xenlight/gengotypes.py | 2

Re: [PATCH v3 1/3] xen+tools: Introduce XEN_SYSCTL_PHYSCAP_vpmu

2021-10-08 Thread Nick Rosbrook
index 09a3bb67e2..45f2cba3d2 100644 > --- a/tools/golang/xenlight/types.gen.go > +++ b/tools/golang/xenlight/types.gen.go > @@ -1008,6 +1008,7 @@ CapHap bool > CapShadow bool > CapIommuHapPtShare bool > CapVmtrace bool > +CapVpmu bool > } For the golang re-gen, Acked-by: Nick Rosbrook Thanks, NR

Re: [PATCH v3 3/3] xen: Expose the PMU to the guests

2021-10-08 Thread Nick Rosbrook
r := x.Vpmu.toC(&xc.vpmu); err != nil { > +return fmt.Errorf("converting field Vpmu: %v", err) > +} > > return nil > } > diff --git a/tools/golang/xenlight/types.gen.go > b/tools/golang/xenlight/types.gen.go > index 45f2cba3d2..b2e8bd1a85 100644 > --- a/tools/golang/xenlight/types.gen.go > +++ b/tools/golang/xenlight/types.gen.go > @@ -521,6 +521,7 @@ MsrRelaxed Defbool > } > Altp2M Altp2MMode > VmtraceBufKb int > +Vpmu Defbool > } > > type DomainBuildInfoTypeUnion interface { For the golang re-gen, Acked-by: Nick Rosbrook Thanks, NR

Re: [XEN PATCH for-4.16] golang/xenlight: regen generated code

2021-11-19 Thread Nick Rosbrook
gt; @@ -479,6 +480,7 @@ BlkdevStart string > VnumaNodes []VnodeInfo > MaxGrantFrames uint32 > MaxMaptrackFrames uint32 > +MaxGrantVersion int > DeviceModelVersion DeviceModelVersion > DeviceModelStubdomain Defbool > StubdomainMemkb uint64 > -- > Anthony PERARD > Acked-by: Nick Rosbrook Thanks for catching that. -NR

Re: [PATCH] tools/go: honor append build flags

2021-07-07 Thread Nick Rosbrook
nlight) $(LDLIBS_libxentoollog) > -L$(XEN_libxenlight) -L$(XEN_libxentoollog) $(APPEND_LDFLAGS)" $(GO) build -x > > .PHONY: install > install: build > -- > 2.31.1 > > Acked-by: Nick Rosbrook Thanks, NR

Re: [RESEND PATCH 03/12] golang/xenlight: fix string conversion in generated toC functions

2021-07-07 Thread Nick Rosbrook
On Thu, Jul 01, 2021 at 02:09:47PM +, George Dunlap wrote: > > > > On Jun 21, 2021, at 5:11 PM, Nick Rosbrook wrote: > > > > On Fri, Jun 18, 2021 at 11:00:26AM +, George Dunlap wrote: > >> > >> > >>> On May 24, 2021, at 9:36 P

Re: [RFC v2 5/7] libxl: add device function definitions to libxl_types.idl

2021-05-04 Thread Nick Rosbrook
On Tue, May 04, 2021 at 04:43:27PM +0100, Anthony PERARD wrote: > On Tue, Mar 02, 2021 at 08:46:17PM -0500, Nick Rosbrook wrote: > > diff --git a/tools/libs/light/libxl_types.idl > > b/tools/libs/light/libxl_types.idl > > index 5b85a7419f..550af7a1c7 100644 >

Re: [RFC v2 6/7] libxl: implement device add/remove/destroy functions generation

2021-05-04 Thread Nick Rosbrook
On Tue, May 04, 2021 at 04:02:55PM +0100, Anthony PERARD wrote: > On Tue, Mar 02, 2021 at 08:46:18PM -0500, Nick Rosbrook wrote: > > +def libxl_func_define_device_add(func): > > +s = '' > > + > > +return_type = func.return_type.typename &g

Re: [RFC v2 0/7] add function support to IDL

2021-05-04 Thread Nick Rosbrook
On Tue, May 04, 2021 at 04:46:52PM +0100, Anthony PERARD wrote: > On Tue, Mar 02, 2021 at 08:46:12PM -0500, Nick Rosbrook wrote: > > At a Xen Summit design session for the golang bindings (see [1]), we > > agreed that it would be beneficial to expand the libxl IDL with function

[RESEND PATCH 00/12] golang/xenlight: domain life cycle support

2021-05-24 Thread Nick Rosbrook
package to boot domains with various configurations. These patches address several things (e.g. bug fixes, code style, conveniences, new wrapper functions), but are all work towards the final goal of allowing a package user to manage a full domain life cycle. Nick Rosbrook (12): golang/xenlight

[RESEND PATCH 01/12] golang/xenlight: update generated code

2021-05-24 Thread Nick Rosbrook
-by: Nick Rosbrook --- tools/golang/xenlight/helpers.gen.go | 6 ++ tools/golang/xenlight/types.gen.go | 5 + 2 files changed, 11 insertions(+) diff --git a/tools/golang/xenlight/helpers.gen.go b/tools/golang/xenlight/helpers.gen.go index 4c60d27a9c..b454b12d52 100644 --- a/tools/golang

[RESEND PATCH 02/12] golang/xenlight: fix StringList toC conversion

2021-05-24 Thread Nick Rosbrook
ss the C memory, and explicity set the last entry to nil so the C memory will be zeroed out, and (2) dereferencing csl in the unsafe.Pointer conversion. Signed-off-by: Nick Rosbrook --- tools/golang/xenlight/xenlight.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/golang/

[RESEND PATCH 03/12] golang/xenlight: fix string conversion in generated toC functions

2021-05-24 Thread Nick Rosbrook
fields to nil first, and then proceeds to check if the Go string is non-empty. And, commit the new generated code. Signed-off-by: Nick Rosbrook --- tools/golang/xenlight/gengotypes.py | 1 + tools/golang/xenlight/helpers.gen.go | 160 +++ 2 files changed, 161 insertions

[RESEND PATCH 04/12] golang/xenlight: export keyed union interface types

2021-05-24 Thread Nick Rosbrook
g/git-http/xen.git/tools/golang/xenlight?tab=doc#DeviceUsbdev Signed-off-by: Nick Rosbrook --- tools/golang/xenlight/gengotypes.py | 6 +-- tools/golang/xenlight/types.gen.go | 58 ++--- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/tools/golan

[RESEND PATCH 05/12] golang/xenlight: use struct pointers in keyed union fields

2021-05-24 Thread Nick Rosbrook
NOT using pointers in these fields, update code generation to set keyed union fields to pointers of their implementing structs. Signed-off-by: Nick Rosbrook --- tools/golang/xenlight/gengotypes.py | 4 +-- tools/golang/xenlight/helpers.gen.go | 44 ++-- 2 files changed, 24

[RESEND PATCH 06/12] golang/xenlight: rename Ctx receivers to ctx

2021-05-24 Thread Nick Rosbrook
tools/golang/xenlight. There is no functional change. Signed-off-by: Nick Rosbrook --- tools/golang/xenlight/xenlight.go | 154 +++--- 1 file changed, 77 insertions(+), 77 deletions(-) diff --git a/tools/golang/xenlight/xenlight.go b/tools/golang/xenlight/xenlight.go ind

[RESEND PATCH 07/12] golang/xenlight: add logging conveniences for within xenlight

2021-05-24 Thread Nick Rosbrook
ments, e.g. xtl_log, add an xtl_log_wrap function to the cgo preamble that accepts an already formatted string, and handle the formatting in Go. Signed-off-by: Nick Rosbrook --- tools/golang/xenlight/xenlight.go | 45 +++ 1 file changed, 45 insertions(+) diff --g

[RESEND PATCH 08/12] golang/xenlight: add functional options to configure Context

2021-05-24 Thread Nick Rosbrook
x27;s xentoollog_logger. Future configuration options can be created by adding an appropriate field to the contextOptions struct and creating a With function to return a ContextOption Signed-off-by: Nick Rosbrook --- tools/golang/xenlight/xenlight.go | 44 +-- 1 file change

[RESEND PATCH 09/12] golang/xenlight: add DomainDestroy wrapper

2021-05-24 Thread Nick Rosbrook
Add a wrapper around libxl_domain_destroy. Signed-off-by: Nick Rosbrook --- tools/golang/xenlight/xenlight.go | 10 ++ 1 file changed, 10 insertions(+) diff --git a/tools/golang/xenlight/xenlight.go b/tools/golang/xenlight/xenlight.go index 65f93abe32..1e0ed109e4 100644 --- a/tools

[RESEND PATCH 10/12] golang/xenlight: add SendTrigger wrapper

2021-05-24 Thread Nick Rosbrook
Add a warpper around libxl_send_trigger. Signed-off-by: Nick Rosbrook --- tools/golang/xenlight/xenlight.go | 11 +++ 1 file changed, 11 insertions(+) diff --git a/tools/golang/xenlight/xenlight.go b/tools/golang/xenlight/xenlight.go index 1e0ed109e4..d153feb851 100644 --- a/tools

[RESEND PATCH 12/12] golang/xenlight: add NotifyDomainDeath method to Context

2021-05-24 Thread Nick Rosbrook
to the provided channel. With this, callers should be able to manage a full domain life cycle. Add to the comment of DomainCreateNew so that package uses know they should use this method in conjunction with DomainCreateNew. Signed-off-by: Nick Rosbrook --- tools/golang/xenlight/xenlight.go | 83

[RESEND PATCH 11/12] golang/xenlight: do not negate ret when converting to Error

2021-05-24 Thread Nick Rosbrook
#x27; xenlight.go from tools/golang/xenlight. Signed-off-by: Nick Rosbrook --- tools/golang/xenlight/xenlight.go | 46 +++ 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/tools/golang/xenlight/xenlight.go b/tools/golang/xenlight/xenlight.go index

Re: [RESEND PATCH 00/12] golang/xenlight: domain life cycle support

2021-06-17 Thread Nick Rosbrook
On Mon, May 24, 2021 at 4:37 PM Nick Rosbrook wrote: > > The primary goal of this patch series is to allow users of the xenlight > package to manage a full domain life cycle. In particular, it provides > support for receiving domain death events so that domain shutdown, > reboo

Re: [RESEND PATCH 08/12] golang/xenlight: add functional options to configure Context

2021-06-18 Thread Nick Rosbrook
On Fri, Jun 18, 2021 at 02:44:15PM +, George Dunlap wrote: > > > > On May 24, 2021, at 9:36 PM, Nick Rosbrook wrote: > > > > Add a ContextOption type to support functional options in NewContext. > > Then, add a variadic ContextOption parameter to NewContex

Re: [RESEND PATCH 07/12] golang/xenlight: add logging conveniences for within xenlight

2021-06-18 Thread Nick Rosbrook
On Fri, Jun 18, 2021 at 01:17:07PM +, George Dunlap wrote: > > > > On May 24, 2021, at 9:36 PM, Nick Rosbrook wrote: > > > > Add some logging methods to Context to provide easy use of the > > Contenxt's xentoollog_logger. These are not exported, but the L

Re: [RESEND PATCH 07/12] golang/xenlight: add logging conveniences for within xenlight

2021-06-18 Thread Nick Rosbrook
On Fri, Jun 18, 2021 at 01:21:40PM +, George Dunlap wrote: > > > > On Jun 18, 2021, at 2:17 PM, George Dunlap wrote: > > > > > > > >> On May 24, 2021, at 9:36 PM, Nick Rosbrook wrote: > >> > >> Add some logging meth

Re: [RESEND PATCH 11/12] golang/xenlight: do not negate ret when converting to Error

2021-06-18 Thread Nick Rosbrook
On Fri, Jun 18, 2021 at 03:13:03PM +, George Dunlap wrote: > > > > On May 24, 2021, at 9:36 PM, Nick Rosbrook wrote: > > > > There are several locations where the return code from calling into C is > > negated when being converted to Error. This results in

Re: [RESEND PATCH 08/12] golang/xenlight: add functional options to configure Context

2021-06-18 Thread Nick Rosbrook
On Fri, Jun 18, 2021 at 04:18:44PM +, George Dunlap wrote: > > > > On Jun 18, 2021, at 4:08 PM, Nick Rosbrook wrote: > > > > On Fri, Jun 18, 2021 at 02:44:15PM +, George Dunlap wrote: > >> > >> > >>> On May 24, 2021, at 9:36 PM,

Re: [RESEND PATCH 03/12] golang/xenlight: fix string conversion in generated toC functions

2021-06-21 Thread Nick Rosbrook
On Fri, Jun 18, 2021 at 11:00:26AM +, George Dunlap wrote: > > > > On May 24, 2021, at 9:36 PM, Nick Rosbrook wrote: > > > > In gengotypes.py, the toC functions only set C string fields when > > the Go strings are non-empty. However, to prevent segfaults i

Re: [RESEND PATCH 00/12] golang/xenlight: domain life cycle support

2021-06-21 Thread Nick Rosbrook
On Mon, Jun 21, 2021 at 03:53:39PM +, George Dunlap wrote: > > > > On May 24, 2021, at 9:36 PM, Nick Rosbrook wrote: > > > > The primary goal of this patch series is to allow users of the xenlight > > package to manage a full domain life cycle. In particula

Re: [RESEND PATCH 12/12] golang/xenlight: add NotifyDomainDeath method to Context

2021-06-21 Thread Nick Rosbrook
On Fri, Jun 18, 2021 at 07:31:46PM +, George Dunlap wrote: > > > > On Jun 18, 2021, at 7:28 PM, George Dunlap wrote: > > > > > > > >> On May 24, 2021, at 9:36 PM, Nick Rosbrook wrote: > >> > >> Add a helper function to wait for

[PATCH] MAINTAINERS: update my email address

2022-01-14 Thread Nick Rosbrook
I am no longer an employee at AIS. Use my personal email address instead. Signed-off-by: Nick Rosbrook --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 4a2884dfa7..feea7d14cf 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -302,7

Re: [PATCH v2 1/3] tools/golang: When returning pointers, actually allocate structrues

2024-04-19 Thread Nick Rosbrook
exception when calling the relevant `fromC` method. > > Allocate structures before attempting to fill them in. > > Fixes: 453713b1750 ("golang/xenlight: Add host-related functionality") > Reported-by: Tobias Fitschen > Signed-off-by: George Dunlap > Tested-by: Tobias Fi

Re: [PATCH v2 2/3] golang/xenlight: Ensure comments aren't interpreted as docstrings

2024-04-19 Thread Nick Rosbrook
No functional change. > > Signed-off-by: George Dunlap Acked-by: Nick Rosbrook Thanks, Nick

Re: [PATCH v2 3/3] tools/golang: Run `go vet` as part of the build process

2024-04-19 Thread Nick Rosbrook
On Fri, Apr 19, 2024 at 10:00 AM George Dunlap wrote: > > Signed-off-by: George Dunlap > --- > CC: Nick Rosbrook > CC: Anthony PERARD > --- > tools/golang/xenlight/Makefile | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/tools/golang/xenlight/Makefile b/

Re: [PATCH v2 15/29] tools/libs/light: add backend type for 9pfs PV devices

2023-12-06 Thread Nick Rosbrook
On Wed, Dec 6, 2023 at 9:36 AM Jason Andryuk wrote: > FYI, these IDL changes will require golang binding regeneration. > (Maybe we shouldn't have generated code checked in...) The generated code needs to be checked in for it to work as a go module. -Nick

Re: [PATCH v2 15/29] tools/libs/light: add backend type for 9pfs PV devices

2024-01-02 Thread Nick Rosbrook
On Wed, Dec 6, 2023 at 1:53 PM Jason Andryuk wrote: > > On Wed, Dec 6, 2023 at 12:44 PM Nick Rosbrook wrote: > > > > On Wed, Dec 6, 2023 at 9:36 AM Jason Andryuk wrote: > > > FYI, these IDL changes will require golang binding regeneration. > > > (Maybe we s

Re: [PATCH v5 17/23] libxl: introduce 'libxl_pci_bdf' in the idl...

2020-12-04 Thread Nick Rosbrook
rrant The Go binding re-generation looks fine to me. Acked-by: Nick Rosbrook

[RFC v2 0/7] add function support to IDL

2021-03-02 Thread Nick Rosbrook
/msg01352.html Nick Rosbrook (7): libxl: remove extra whitespace from gentypes.py libxl: add Function class to IDL libxl: add PASS_BY_CONST_REFERENCE to idl libxl: add DeviceFunction classes to IDL libxl: add device function definitions to libxl_types.idl libxl: implement device add

[RFC v2 1/7] libxl: remove extra whitespace from gentypes.py

2021-03-02 Thread Nick Rosbrook
No functional change, just remove the extra whitespace from gentypes.py. Signed-off-by: Nick Rosbrook --- tools/libs/light/gentypes.py | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/libs/light/gentypes.py b/tools/libs/light/gentypes.py index 9a45e45acc

[RFC v2 2/7] libxl: add Function class to IDL

2021-03-02 Thread Nick Rosbrook
functions returned. Signed-off-by: Nick Rosbrook --- tools/golang/xenlight/gengotypes.py | 2 +- tools/libs/light/gentypes.py| 2 +- tools/libs/light/idl.py | 36 - 3 files changed, 37 insertions(+), 3 deletions(-) diff --git a/tools/golang

[RFC v2 3/7] libxl: add PASS_BY_CONST_REFERENCE to idl

2021-03-02 Thread Nick Rosbrook
Currently, there is only support for PASS_BY_{REFERENCE,VALUE} in the IDL. As a piece of adding function support, add logic for PASS_BY_CONST_REFERENCE so that function generation code can use Type.make_arg() for function signatures that require const reference parameters. Signed-off-by: Nick

[RFC v2 4/7] libxl: add DeviceFunction classes to IDL

2021-03-02 Thread Nick Rosbrook
d the base class. DeviceRemoveFunction adds the option of specifying 'custom_remove' parameter when custom remove functions are needed. DeviceDestroyFunction is a child of DeviceRemoveFunction to inherit the custom_remove attribute. Signed-off-by: Nick Rosbrook --- tools/libs/li

[RFC v2 5/7] libxl: add device function definitions to libxl_types.idl

2021-03-02 Thread Nick Rosbrook
generate the code from gentypes.py. Signed-off-by: Nick Rosbrook --- tools/libs/light/libxl_types.idl | 202 +++ 1 file changed, 202 insertions(+) diff --git a/tools/libs/light/libxl_types.idl b/tools/libs/light/libxl_types.idl index 5b85a7419f..550af7a1c7 100644 --- a

[RFC v2 6/7] libxl: implement device add/remove/destroy functions generation

2021-03-02 Thread Nick Rosbrook
out to a .c file, but are invoked to ensure there is no build regression introduced. A later commit will replace the existing macros with this generated code. Signed-off-by: Nick Rosbrook --- tools/libs/light/gentypes.py | 91 +++- 1 file changed, 90 insertions(+), 1

[RFC v2 7/7] libxl: replace LIBXL_DEFINE_DEVICE* macro usage with generated code

2021-03-02 Thread Nick Rosbrook
Allow the gentypes.py script to write generated function output to _libxl_types.c, and remove the LIBXL_DEFINE_DEVICE* macro calls in the appropriate locations. Signed-off-by: Nick Rosbrook --- Note: This commit does not build; there is more work to be done, particularly around accessing

Re: [RFC v2 0/7] add function support to IDL

2021-03-03 Thread Nick Rosbrook
On Wed, Mar 03, 2021 at 09:48:02AM +, Ian Jackson wrote: > Nick Rosbrook writes ("[RFC v2 0/7] add function support to IDL"): > > At a Xen Summit design session for the golang bindings (see [1]), we > > agreed that it would be beneficial to expand the libxl IDL with

Re: [RFC v2 0/7] add function support to IDL

2021-04-21 Thread Nick Rosbrook
On Wed, Mar 3, 2021 at 8:41 AM Nick Rosbrook wrote: > > On Wed, Mar 03, 2021 at 09:48:02AM +, Ian Jackson wrote: > > Nick Rosbrook writes ("[RFC v2 0/7] add function support to IDL"): > > > At a Xen Summit design session for the golang bindings (see [1]), w

[PATCH 00/12] golang/xenlight: domain life cycle support

2021-04-28 Thread Nick Rosbrook
package to boot domains with various configurations. These patches address several things (e.g. bug fixes, code style, conveniences, new wrapper functions), but are all work towards the final goal of allowing a package user to manage a full domain life cycle. Nick Rosbrook (12): golang/xenlight

[PATCH 01/12] golang/xenlight: update generated code

2021-04-28 Thread Nick Rosbrook
-by: Nick Rosbrook --- tools/golang/xenlight/helpers.gen.go | 6 ++ tools/golang/xenlight/types.gen.go | 5 + 2 files changed, 11 insertions(+) diff --git a/tools/golang/xenlight/helpers.gen.go b/tools/golang/xenlight/helpers.gen.go index 4c60d27a9c..b454b12d52 100644 --- a/tools/golang

[PATCH 02/12] golang/xenlight: fix StringList toC conversion

2021-04-28 Thread Nick Rosbrook
ss the C memory, and explicity set the last entry to nil so the C memory will be zeroed out, and (2) dereferencing csl in the unsafe.Pointer conversion. Signed-off-by: Nick Rosbrook --- tools/golang/xenlight/xenlight.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/golang/

[PATCH 04/12] golang/xenlight: export keyed union interface types

2021-04-28 Thread Nick Rosbrook
g/git-http/xen.git/tools/golang/xenlight?tab=doc#DeviceUsbdev Signed-off-by: Nick Rosbrook --- tools/golang/xenlight/gengotypes.py | 6 +-- tools/golang/xenlight/types.gen.go | 58 ++--- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/tools/golan

[PATCH 03/12] golang/xenlight: fix string conversion in generated toC functions

2021-04-28 Thread Nick Rosbrook
fields to nil first, and then proceeds to check if the Go string is non-empty. And, commit the new generated code. Signed-off-by: Nick Rosbrook --- tools/golang/xenlight/gengotypes.py | 1 + tools/golang/xenlight/helpers.gen.go | 160 +++ 2 files changed, 161 insertions

[PATCH 05/12] golang/xenlight: use struct pointers in keyed union fields

2021-04-28 Thread Nick Rosbrook
NOT using pointers in these fields, update code generation to set keyed union fields to pointers of their implementing structs. Signed-off-by: Nick Rosbrook --- tools/golang/xenlight/gengotypes.py | 4 +-- tools/golang/xenlight/helpers.gen.go | 44 ++-- 2 files changed, 24

[PATCH 06/12] golang/xenlight: rename Ctx receivers to ctx

2021-04-28 Thread Nick Rosbrook
tools/golang/xenlight. There is no functional change. Signed-off-by: Nick Rosbrook --- tools/golang/xenlight/xenlight.go | 154 +++--- 1 file changed, 77 insertions(+), 77 deletions(-) diff --git a/tools/golang/xenlight/xenlight.go b/tools/golang/xenlight/xenlight.go ind

[PATCH 07/12] golang/xenlight: add logging conveniences for within xenlight

2021-04-28 Thread Nick Rosbrook
ments, e.g. xtl_log, add an xtl_log_wrap function to the cgo preamble that accepts an already formatted string, and handle the formatting in Go. Signed-off-by: Nick Rosbrook --- tools/golang/xenlight/xenlight.go | 45 +++ 1 file changed, 45 insertions(+) diff --g

[PATCH 08/12] golang/xenlight: add functional options to configure Context

2021-04-28 Thread Nick Rosbrook
x27;s xentoollog_logger. Future configuration options can be created by adding an appropriate field to the contextOptions struct and creating a With function to return a ContextOption Signed-off-by: Nick Rosbrook --- tools/golang/xenlight/xenlight.go | 44 +-- 1 file change

[PATCH 09/12] golang/xenlight: add DomainDestroy wrapper

2021-04-28 Thread Nick Rosbrook
Add a wrapper around libxl_domain_destroy. Signed-off-by: Nick Rosbrook --- tools/golang/xenlight/xenlight.go | 10 ++ 1 file changed, 10 insertions(+) diff --git a/tools/golang/xenlight/xenlight.go b/tools/golang/xenlight/xenlight.go index 65f93abe32..1e0ed109e4 100644 --- a/tools

[PATCH 11/12] golang/xenlight: do not negate ret when converting to Error

2021-04-28 Thread Nick Rosbrook
#x27; xenlight.go from tools/golang/xenlight. Signed-off-by: Nick Rosbrook --- tools/golang/xenlight/xenlight.go | 46 +++ 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/tools/golang/xenlight/xenlight.go b/tools/golang/xenlight/xenlight.go index

[PATCH 12/12] golang/xenlight: add NotifyDomainDeath method to Context

2021-04-28 Thread Nick Rosbrook
to the provided channel. With this, callers should be able to manage a full domain life cycle. Add to the comment of DomainCreateNew so that package uses know they should use this method in conjunction with DomainCreateNew. Signed-off-by: Nick Rosbrook --- tools/golang/xenlight/xenlight.go | 83

[PATCH 10/12] golang/xenlight: add SendTrigger wrapper

2021-04-28 Thread Nick Rosbrook
Add a warpper around libxl_send_trigger. Signed-off-by: Nick Rosbrook --- tools/golang/xenlight/xenlight.go | 11 +++ 1 file changed, 11 insertions(+) diff --git a/tools/golang/xenlight/xenlight.go b/tools/golang/xenlight/xenlight.go index 1e0ed109e4..d153feb851 100644 --- a/tools

<    1   2   3