[libvirt] [go PATCH 0/8] Refactor the way typed parameters are handled

Daniel P. Berrangé posted 8 patches 5 years, 2 months ago
Failed in applying to current master (apply log)
connect.go             |  81 ++++----
domain.go              | 429 +++++++++++++++++------------------------
domain_events.go       |  20 +-
typedparams.go         | 295 ++++++++++++----------------
typedparams_test.go    |   8 +-
typedparams_wrapper.go | 240 +++++++++++++++++++++++
typedparams_wrapper.h  | 126 ++++++++++++
7 files changed, 721 insertions(+), 478 deletions(-)
create mode 100644 typedparams_wrapper.go
create mode 100644 typedparams_wrapper.h
[libvirt] [go PATCH 0/8] Refactor the way typed parameters are handled
Posted by Daniel P. Berrangé 5 years, 2 months ago
Go 1.12 breaks our current typed parameter handling as it appears to be
deciding some various are no longer live & free'ing them. Mixing go
allocated memory with C API calls often trips with this kind of thing.
This series thus changes the code to use C allocated memory for typed
parameter arrays and use the libvirt APIs where possible.

I'm not sure if anyone on list feels like reviewing this Go code or not.
Most of the time I've just pushed Go changes directly, but I figure putting
it out for review might help people spread the knowledge of the Go
bindings

Daniel P. Berrangé (8):
  Fix GetGuestVcpus to actually return some data
  Add missing error reporting when setting typed parameters
  Change typedParamsPackNew to use a C allocated array
  Switch typedParamsUnpackLen to use accessor methods
  Use 'cnparams' for virTypedParameters array length variables
  Simplify setting of typed parameters
  Switch remaining typed parameter code to use C allocs
  Rename typedParamsUnpackLen to typedParamsUnpack

 connect.go             |  81 ++++----
 domain.go              | 429 +++++++++++++++++------------------------
 domain_events.go       |  20 +-
 typedparams.go         | 295 ++++++++++++----------------
 typedparams_test.go    |   8 +-
 typedparams_wrapper.go | 240 +++++++++++++++++++++++
 typedparams_wrapper.h  | 126 ++++++++++++
 7 files changed, 721 insertions(+), 478 deletions(-)
 create mode 100644 typedparams_wrapper.go
 create mode 100644 typedparams_wrapper.h

-- 
2.20.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [go PATCH 0/8] Refactor the way typed parameters are handled
Posted by Daniel P. Berrangé 5 years, 2 months ago
On Thu, Jan 24, 2019 at 01:16:59PM +0000, Daniel P. Berrangé wrote:
> Go 1.12 breaks our current typed parameter handling as it appears to be
> deciding some various are no longer live & free'ing them. Mixing go
> allocated memory with C API calls often trips with this kind of thing.
> This series thus changes the code to use C allocated memory for typed
> parameter arrays and use the libvirt APIs where possible.
> 
> I'm not sure if anyone on list feels like reviewing this Go code or not.
> Most of the time I've just pushed Go changes directly, but I figure putting
> it out for review might help people spread the knowledge of the Go
> bindings

Been a week so I presume no one cares abuot review & I'll push this

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list