Re: [Libguestfs] [PATCH nbdkit v2] Add the ability to write plugins in golang.

2020-04-23 Thread Richard W.M. Jones
On Tue, Apr 21, 2020 at 05:07:43PM +0100, Daniel P. Berrangé wrote: > On Tue, Apr 21, 2020 at 11:44:59AM +0100, Richard W.M. Jones wrote: > > Thanks: Dan Berrangé > > > > XXX UNFINISHED: > > > > - Is using uintptr for the handle a good idea? Plugins must return > >something != 0. In other

[Libguestfs] [PATCH nbdkit] golang: Compile against the local nbdkit build, not installed.

2020-04-23 Thread Richard W.M. Jones
When compiling when an older nbdkit is installed, the build would fail because certain symbols such as .get_ready were not defined: ../../src/libguestfs.org/nbdkit/nbdkit.go:541:8: plugin.get_ready undefined (type _Ctype_struct_nbdkit_plugin has no field or method get_ready) This happens

Re: [Libguestfs] [PATCH nbdkit v2] Add the ability to write plugins in golang.

2020-04-23 Thread Daniel P . Berrangé
On Thu, Apr 23, 2020 at 10:03:45AM +0100, Richard W.M. Jones wrote: > On Tue, Apr 21, 2020 at 05:07:43PM +0100, Daniel P. Berrangé wrote: > > On Tue, Apr 21, 2020 at 11:44:59AM +0100, Richard W.M. Jones wrote: > > > Thanks: Dan Berrangé > > > > > > XXX UNFINISHED: > > > > > > - Is using uintptr

Re: [Libguestfs] [PATCH nbdkit] golang: Compile against the local nbdkit build, not installed.

2020-04-23 Thread Richard W.M. Jones
On Thu, Apr 23, 2020 at 06:06:12PM +0100, Daniel P. Berrangé wrote: > On Thu, Apr 23, 2020 at 06:04:20PM +0100, Richard W.M. Jones wrote: > > On Thu, Apr 23, 2020 at 05:58:25PM +0100, Daniel P. Berrangé wrote: > > > On Thu, Apr 23, 2020 at 05:55:14PM +0100, Richard W.M. Jones wrote: > > > > When

Re: [Libguestfs] [PATCH nbdkit] golang: Compile against the local nbdkit build, not installed.

2020-04-23 Thread Daniel P . Berrangé
On Thu, Apr 23, 2020 at 06:04:20PM +0100, Richard W.M. Jones wrote: > On Thu, Apr 23, 2020 at 05:58:25PM +0100, Daniel P. Berrangé wrote: > > On Thu, Apr 23, 2020 at 05:55:14PM +0100, Richard W.M. Jones wrote: > > > When compiling when an older nbdkit is installed, the build would fail > > >

Re: [Libguestfs] [PATCH nbdkit] golang: Compile against the local nbdkit build, not installed.

2020-04-23 Thread Daniel P . Berrangé
On Thu, Apr 23, 2020 at 05:55:14PM +0100, Richard W.M. Jones wrote: > When compiling when an older nbdkit is installed, the build would fail > because certain symbols such as .get_ready were not defined: > > ../../src/libguestfs.org/nbdkit/nbdkit.go:541:8: plugin.get_ready undefined > (type

Re: [Libguestfs] [PATCH nbdkit] golang: Compile against the local nbdkit build, not installed.

2020-04-23 Thread Richard W.M. Jones
On Thu, Apr 23, 2020 at 05:58:25PM +0100, Daniel P. Berrangé wrote: > On Thu, Apr 23, 2020 at 05:55:14PM +0100, Richard W.M. Jones wrote: > > When compiling when an older nbdkit is installed, the build would fail > > because certain symbols such as .get_ready were not defined: > > > >

Re: [Libguestfs] [PATCH nbdkit v2] Add the ability to write plugins in golang.

2020-04-23 Thread Richard W.M. Jones
On Thu, Apr 23, 2020 at 02:49:25PM +0100, Daniel P. Berrangé wrote: > I think this design with two interfaces looks pretty nice from the > Go plugin implementors POV now. Thanks. While implementing PWrite I discovered that C.GoBytes makes a copy (the docs were unclear on this), so it wasn't

Re: [Libguestfs] [PATCH nbdkit] golang: Compile against the local nbdkit build, not installed.

2020-04-23 Thread Eric Blake
On 4/23/20 11:58 AM, Daniel P. Berrangé wrote: On Thu, Apr 23, 2020 at 05:55:14PM +0100, Richard W.M. Jones wrote: When compiling when an older nbdkit is installed, the build would fail because certain symbols such as .get_ready were not defined:

[Libguestfs] [PATCH nbdkit 2/2] golang: Compile against the local nbdkit build, not installed.

2020-04-23 Thread Richard W.M. Jones
When compiling when an older nbdkit is installed, the build would fail because certain symbols such as .get_ready were not defined: ../../src/libguestfs.org/nbdkit/nbdkit.go:541:8: plugin.get_ready undefined (type _Ctype_struct_nbdkit_plugin has no field or method get_ready) This happens

[Libguestfs] [PATCH nbdkit 1/2] server: Add pkg-config file to compile against locally compiled nbdkit.

2020-04-23 Thread Richard W.M. Jones
In most cases it is incorrect to use this - pay attention to the note at the top of the newly added file. --- .gitignore| 1 + configure.ac | 1 + server/local/nbdkit.pc.in | 45 +++ 3 files changed, 47 insertions(+) diff --git

[Libguestfs] [PATCH nbdkit 0/2 v2] golang: Compile against the local nbdkit build.

2020-04-23 Thread Richard W.M. Jones
Version 1 was here: https://www.redhat.com/archives/libguestfs/2020-April/thread.html#00160 Version 2 side-steps the objections to the first patch by using a well-formed alternate nbdkit.pc file and running ordinary pkg-config against it, so any parsing of --cflags etc will be done by pkg-config.

Re: [Libguestfs] [PATCH nbdkit 1/2] server: Add pkg-config file to compile against locally compiled nbdkit.

2020-04-23 Thread Richard W.M. Jones
On Thu, Apr 23, 2020 at 07:04:14PM +0100, Richard W.M. Jones wrote: > +# probably should *not* use this in most cases, since your plugin will > +# may end up containing hard paths to the local nbdkit sources. "will may" -> "may" in my local copy. Rich. -- Richard Jones, Virtualization Group,

Re: [Libguestfs] [PATCH v2] python: Fix UnicodeError in inspect_list_applications2() (RHBZ#1684004)

2020-04-23 Thread Nir Soffer
On Mon, Apr 20, 2020 at 3:38 PM Sam Eiderman wrote: > > The python3 bindings create unicode objects from application strings > on the guest (i.e. installed rpm, deb packages). > It is documented that rpm package fields such as description should be > utf8 encoded - however in some cases they are

Re: [Libguestfs] [PATCH nbdkit v3 2/2] golang: Compile against the local nbdkit build, not installed.

2020-04-23 Thread Eric Blake
On 4/23/20 2:13 PM, Richard W.M. Jones wrote: Compiling nbdkit from source when an older nbdkit is installed would fail because certain symbols such as .get_ready are not defined in the (installed) : ../../src/libguestfs.org/nbdkit/nbdkit.go:541:8: plugin.get_ready undefined (type

Re: [Libguestfs] [PATCH nbdkit 1/2] server: Add pkg-config file to compile against locally compiled nbdkit.

2020-04-23 Thread Eric Blake
On 4/23/20 1:11 PM, Richard W.M. Jones wrote: On Thu, Apr 23, 2020 at 07:08:43PM +0100, Richard W.M. Jones wrote: On Thu, Apr 23, 2020 at 07:04:14PM +0100, Richard W.M. Jones wrote: +# probably should *not* use this in most cases, since your plugin will +# may end up containing hard paths to

Re: [Libguestfs] [PATCH nbdkit v3 0/2] golang: Compile against the local nbdkit build.

2020-04-23 Thread Eric Blake
On 4/23/20 2:13 PM, Richard W.M. Jones wrote: Version 2: https://www.redhat.com/archives/libguestfs/2020-April/thread.html#00166 Version 3 contains all changes discussed in the previous review. Looks good now. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226

Re: [Libguestfs] [PATCH nbdkit v3 2/2] golang: Compile against the local nbdkit build, not installed.

2020-04-23 Thread Eric Blake
On 4/23/20 2:50 PM, Eric Blake wrote: PKG_CONFIG_PATH="$(abs_builddir)/server/local$${PKG_CONFIG_PATH:-:$$PKG_CONFIG_PATH}" \ Ooops, I typod this one. unset foo bar= blah=set echo "pre${foo:-:$foo}" echo "pre${bar:-:$bar}" echo "pre${bar:-:$blah}" shows that :- was the wrong operator. 

Re: [Libguestfs] [PATCH nbdkit 1/2] server: Add pkg-config file to compile against locally compiled nbdkit.

2020-04-23 Thread Richard W.M. Jones
On Thu, Apr 23, 2020 at 07:08:43PM +0100, Richard W.M. Jones wrote: > On Thu, Apr 23, 2020 at 07:04:14PM +0100, Richard W.M. Jones wrote: > > +# probably should *not* use this in most cases, since your plugin will > > +# may end up containing hard paths to the local nbdkit sources. > > "will may"

Re: [Libguestfs] [PATCH nbdkit 0/2 v2] golang: Compile against the local nbdkit build.

2020-04-23 Thread Daniel P . Berrangé
On Thu, Apr 23, 2020 at 07:04:13PM +0100, Richard W.M. Jones wrote: > Version 1 was here: > https://www.redhat.com/archives/libguestfs/2020-April/thread.html#00160 > > Version 2 side-steps the objections to the first patch by using a > well-formed alternate nbdkit.pc file and running ordinary

Re: [Libguestfs] [PATCH nbdkit 2/2] golang: Compile against the local nbdkit build, not installed.

2020-04-23 Thread Eric Blake
On 4/23/20 1:04 PM, Richard W.M. Jones wrote: When compiling when an older nbdkit is installed, the build would fail because certain symbols such as .get_ready were not defined: ../../src/libguestfs.org/nbdkit/nbdkit.go:541:8: plugin.get_ready undefined (type _Ctype_struct_nbdkit_plugin has

[Libguestfs] [PATCH nbdkit v3 1/2] server: Add pkg-config file for compiling against locally compiled nbdkit.

2020-04-23 Thread Richard W.M. Jones
If you want to compile against a locally compiled (but not installed) nbdkit, you can now set PKG_CONFIG_PATH=/path/to/nbdkit/server/local Since it's not clear how useful this will be (we only want it for internal reasons) this is not documented. Thanks: Dan Berrangé, Eric Blake --- .gitignore

[Libguestfs] [PATCH nbdkit v3 0/2] golang: Compile against the local nbdkit build.

2020-04-23 Thread Richard W.M. Jones
Version 2: https://www.redhat.com/archives/libguestfs/2020-April/thread.html#00166 Version 3 contains all changes discussed in the previous review. Rich. ___ Libguestfs mailing list Libguestfs@redhat.com

[Libguestfs] [PATCH nbdkit v3 2/2] golang: Compile against the local nbdkit build, not installed.

2020-04-23 Thread Richard W.M. Jones
Compiling nbdkit from source when an older nbdkit is installed would fail because certain symbols such as .get_ready are not defined in the (installed) : ../../src/libguestfs.org/nbdkit/nbdkit.go:541:8: plugin.get_ready undefined (type _Ctype_struct_nbdkit_plugin has no field or method