Re: [Libguestfs] [libnbd PATCH] generator: Add support for namespace constants

2019-06-27 Thread Martin Kletzander
On Thu, Jun 27, 2019 at 09:25:38AM -0500, Eric Blake wrote: On 6/27/19 5:07 AM, Martin Kletzander wrote: This just defines the namespace, its contexts and related constants and the only supported one is currently base:allocation. The names of the constants are not very future-proof, but shorter

[Libguestfs] [libnbd PATCH] tests: Enhance errors test

2019-06-27 Thread Eric Blake
Let's check for a quite a few more errors. Among other things, this adds some coverage for a few things I've patched recently. --- And these enhancements set me up for my next fix: making NBD_CMD_DISC prevent future commands. tests/errors.c | 167 +---

[Libguestfs] [libnbd PATCH] opt-go: Better decoding of known errors

2019-06-27 Thread Eric Blake
I'm easily able to provoke NBD_REP_ERR_TLS_REQD (use nbd_set_tls(0) to talk to a server that requires encryption) and NBD_REP_ERR_UNKNOWN (forget to use nbd_set_export_name for qemu-nbd); it's nice to display a useful error for these rather than "unknown reply from NBD_OPT_GO: 0x8005" or simila

[Libguestfs] [nbdkit PATCH] nbd: Update for libnbd 0.1.5

2019-06-27 Thread Eric Blake
libnbd 0.1.5 was released today, but is not yet packaged for Fedora. I'd prefer to bump the minimum version in the pkg-config check in configure.ac, as such, I won't be pushing this patch as-is, but waiting until Fedora does have the newer build. But anyone playing with a self-built libnbd library

Re: [Libguestfs] [libnbd PATCH] block-status: Make callback usage consistent with pread_structured

2019-06-27 Thread Richard W.M. Jones
ACK -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests.

Re: [Libguestfs] [libnbd PATCH] python: Fix bindings for Path parameters

2019-06-27 Thread Richard W.M. Jones
ACK again -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. h

Re: [Libguestfs] [libnbd PATCH] maint: Use $(NULL) for all Makefile.am macro lists

2019-06-27 Thread Richard W.M. Jones
ACK this one too Thanks :-) Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libra

[Libguestfs] [libnbd PATCH] maint: Use $(NULL) for all Makefile.am macro lists

2019-06-27 Thread Eric Blake
This borrows from a trick in libvirt - by defining $(NULL) to expand to an empty string, we can more consistently write multi-line macros where all useful lines terminate with \, making it easier to add/remove lines without worrying about whether \ needs to be touched up on neighboring lines. ---

[Libguestfs] [libnbd PATCH] python: Fix bindings for Path parameters

2019-06-27 Thread Eric Blake
Our use of PyUnicode_FSConverter was wrong - the result is a PyObject* rather than a char* (where dereferencing then calling free() on that pointer as char* has catastrophic effects). With this patch, I was able to set up a qemu-nbd encrypted server over a Unix socket (using a pending patch on the

[Libguestfs] [libnbd PATCH] block-status: Make callback usage consistent with pread_structured

2019-06-27 Thread Eric Blake
Now that we have a way to pass Mutable(Int "error") to callbacks, that's a much nicer way for language bindings to use than relying on the value of errno after returning -1. Update the semantics for block status to match what pread_structured does, getting errno out of the equation, and changing th

Re: [Libguestfs] [libnbd PATCH] generator: Add support for namespace constants

2019-06-27 Thread Eric Blake
On 6/27/19 5:07 AM, Martin Kletzander wrote: > This just defines the namespace, its contexts and related constants and the > only > supported one is currently base:allocation. The names of the constants are > not > very future-proof, but shorter than LIBNBD_META_NS_CONTEXT_BASE_ALLOCATION or > s

Re: [Libguestfs] [libnbd PATCH] tests: Add test for abrupt server death

2019-06-27 Thread Eric Blake
On 6/27/19 7:20 AM, Richard W.M. Jones wrote: > > ACK. Let's worry about portability to FreeBSD when we decide > to port libnbd :-) Bike-shedding won me over - I'm renaming this test server-death.c, and will push soon with that rename. I still have a few more patches to post hopefully later tod

Re: [Libguestfs] [libnbd PATCH 2/2] poll: Improve our interface

2019-06-27 Thread Richard W.M. Jones
This series is all fine, ACK. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) an

Re: [Libguestfs] [libnbd PATCH] tests: Add test for abrupt server death

2019-06-27 Thread Richard W.M. Jones
ACK. Let's worry about portability to FreeBSD when we decide to port libnbd :-) Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports sh

Re: [Libguestfs] [libnbd PATCH] generator: Add support for namespace constants

2019-06-27 Thread Richard W.M. Jones
Thanks - I have pushed this. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Sup

Re: [Libguestfs] [libguestfs/libguestfs] when compiling v1.40.2: rake aborted! (#40)

2019-06-27 Thread Samuel Bernardo
On 6/26/19 4:55 PM, Richard W.M. Jones wrote: > On Wed, Jun 26, 2019 at 05:38:28AM -0700, Samuel Bernardo wrote: >> When compilling libguestfs 1.40.2 I receive the following linking error: >> >> ``` >> linking shared-object _guestfs.so >> /usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../x86_64-pc

Re: [Libguestfs] [libnbd PATCH 0/2] Tighten URI parser

2019-06-27 Thread Richard W.M. Jones
I think this series is fine. I have no particular preference whether you want to go with just the first, or squash both patches together. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.c

Re: [Libguestfs] [libnbd PATCH] pread_structured: Change callback type to use Mutable error

2019-06-27 Thread Richard W.M. Jones
ACK Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html

Re: [Libguestfs] [libguestfs/libguestfs] when compiling v1.40.2: rake aborted! (#40)

2019-06-27 Thread Richard W.M. Jones
On Thu, Jun 27, 2019 at 11:01:20AM +0100, Samuel Bernardo wrote: > I try to compile again with ruby use flag activated and it compiled now. > When in compile phase it didn't uninstall the previous installed version > without ruby flag. Cloud this mean that it is missing some dependency in > include

[Libguestfs] [PATCH 10/11] Rust bindings: Format test files

2019-06-27 Thread Hiroyuki Katsura
--- rust/tests/010_load.rs| 28 ++-- rust/tests/020_create.rs | 28 ++-- rust/tests/030_create_flags.rs| 29 ++--- rust/tests/040_create_multiple.rs | 28 ++-- 4 files changed,

[Libguestfs] [PATCH 11/11] Rust bindings: Incorporate bindings to build system

2019-06-27 Thread Hiroyuki Katsura
--- configure.ac | 2 ++ rust/Makefile.am | 16 +++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index f9bdbe54b..b35b1ce0f 100644 --- a/configure.ac +++ b/configure.ac @@ -431,6 +431,8 @@ AS_ECHO_N(["Vala bindings ...

Re: [Libguestfs] [PATCH 09/11] Rust bindings: Add bindtests

2019-06-27 Thread Hiroyuki Katsura
--- generator/bindtests.ml | 63 ++ generator/main.ml | 2 +- generator/rust.mli | 5 +++- 3 files changed, 68 insertions(+), 2 deletions(-) diff --git a/generator/bindtests.ml b/generator/bindtests.ml index 41aef47ea..e88e71c8a 100644 --- a/gene

Re: [Libguestfs] [PATCH 08/11] Rust bindings: Fix memory management and format the file

2019-06-27 Thread Hiroyuki Katsura
--- generator/rust.ml | 461 +++--- 1 file changed, 311 insertions(+), 150 deletions(-) diff --git a/generator/rust.ml b/generator/rust.ml index 79e16dfc6..ee65b1073 100644 --- a/generator/rust.ml +++ b/generator/rust.ml @@ -61,14 +61,16 @@ let generate_rus

Re: [Libguestfs] Few libnbd questions/concerns

2019-06-27 Thread Martin Kletzander
On Wed, Jun 26, 2019 at 09:33:04PM -0500, Eric Blake wrote: On 6/25/19 9:25 AM, Eric Blake wrote: When running a program with `nbdkit -U - --run ...`, the $nbd parameter gets expanded to nbd:unix:/path/to/socket. When this string is passed to nbd_connect_uri(), it does not return an error (eve

[Libguestfs] [libnbd PATCH] generator: Add support for namespace constants

2019-06-27 Thread Martin Kletzander
This just defines the namespace, its contexts and related constants and the only supported one is currently base:allocation. The names of the constants are not very future-proof, but shorter than LIBNBD_META_NS_CONTEXT_BASE_ALLOCATION or similar. Currently the output looks like this: /* "base" n

Re: [Libguestfs] [PATCH 3/9] Rust bindings: Add 4 bindings tests

2019-06-27 Thread Hiroyuki Katsura
Dear Richard, > Normally we wouldn't check generated files into git. OK. I got it. Regards, Hiroyuki 2019年6月27日(木) 18:51 Richard W.M. Jones : > On Thu, Jun 27, 2019 at 06:27:05PM +0900, Hiroyuki Katsura wrote: > > > I guess this is a stray debug message? > > > > Yes. I'm sorry... > > > > > we

Re: [Libguestfs] [PATCH 3/9] Rust bindings: Add 4 bindings tests

2019-06-27 Thread Richard W.M. Jones
On Thu, Jun 27, 2019 at 06:27:05PM +0900, Hiroyuki Katsura wrote: > > I guess this is a stray debug message? > > Yes. I'm sorry... > > > we did *not* check them into git. > > Really? Does it mean that every time you build the library, Cargo.toml is > generated? That's how it has worked in nbdki

Re: [Libguestfs] [PATCH 3/9] Rust bindings: Add 4 bindings tests

2019-06-27 Thread Hiroyuki Katsura
> I guess this is a stray debug message? Yes. I'm sorry... > we did *not* check them into git. Really? Does it mean that every time you build the library, Cargo.toml is generated? > The actual test parts of this patch are fine, but you need to spend a > bit of time with ‘git rebase -i’ to move

Re: [Libguestfs] [PATCH 9/9] Rust bindings: Complete bindings

2019-06-27 Thread Richard W.M. Jones
Patch 9 is a kind of dumping ground of all kinds of stuff. It may be better to spend some time with git rebase -i trying to work this into more coherent patches. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog:

Re: [Libguestfs] [PATCH 7/9] Rust bindings: Complete actions

2019-06-27 Thread Richard W.M. Jones
This one looks OK. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestf

Re: [Libguestfs] [PATCH 6/9] Rust bindings: Add generator of function signatures

2019-06-27 Thread Richard W.M. Jones
On Thu, Jun 27, 2019 at 05:06:07PM +0900, Hiroyuki Katsura wrote: > From: Hiroyuki_Katsura > > --- > generator/rust.ml | 137 ++ > 1 file changed, 137 insertions(+) > > diff --git a/generator/rust.ml b/generator/rust.ml > index a229d5eac..aa8b249ff 10

Re: [Libguestfs] [PATCH 5/9] Rust bindings: Add generator of structs for optional arguments

2019-06-27 Thread Richard W.M. Jones
On Thu, Jun 27, 2019 at 05:06:06PM +0900, Hiroyuki Katsura wrote: > From: Hiroyuki_Katsura > > --- > generator/rust.ml | 71 +++ > 1 file changed, 71 insertions(+) > > diff --git a/generator/rust.ml b/generator/rust.ml > index 174f6ded3..a229d5eac 100

Re: [Libguestfs] [PATCH 3/9] Rust bindings: Add 4 bindings tests

2019-06-27 Thread Richard W.M. Jones
On Thu, Jun 27, 2019 at 05:06:04PM +0900, Hiroyuki Katsura wrote: > From: Hiroyuki_Katsura > > --- > generator/rust.ml | 13 --- > run.in| 9 > rust/Cargo.lock | 6 + > rust/Cargo.toml | 4 +--

Re: [Libguestfs] [PATCH 2/9] Rust bindings: Add create / close functions

2019-06-27 Thread Richard W.M. Jones
Patch 2 is fine, ACK. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html __

Re: [Libguestfs] [PATCH 4/9] Rust bindings: Add generator of structs

2019-06-27 Thread Richard W.M. Jones
On Thu, Jun 27, 2019 at 05:06:05PM +0900, Hiroyuki Katsura wrote: > From: Hiroyuki_Katsura > > --- > generator/rust.ml | 87 +-- > 1 file changed, 85 insertions(+), 2 deletions(-) > > diff --git a/generator/rust.ml b/generator/rust.ml > index 251eb159

Re: [Libguestfs] [PATCH 1/9] Rust bindings: Add Rust bindings

2019-06-27 Thread Richard W.M. Jones
On Thu, Jun 27, 2019 at 05:06:02PM +0900, Hiroyuki Katsura wrote: > diff --git a/generator/bindtests.ml b/generator/bindtests.ml > index 58d7897b3..41aef47ea 100644 > --- a/generator/bindtests.ml > +++ b/generator/bindtests.ml > @@ -983,6 +983,9 @@ and generate_php_bindtests () = > >dump "bin

[Libguestfs] [PATCH 6/9] Rust bindings: Add generator of function signatures

2019-06-27 Thread Hiroyuki Katsura
From: Hiroyuki_Katsura --- generator/rust.ml | 137 ++ 1 file changed, 137 insertions(+) diff --git a/generator/rust.ml b/generator/rust.ml index a229d5eac..aa8b249ff 100644 --- a/generator/rust.ml +++ b/generator/rust.ml @@ -59,8 +59,10 @@ let genera

[Libguestfs] [PATCH 5/9] Rust bindings: Add generator of structs for optional arguments

2019-06-27 Thread Hiroyuki Katsura
From: Hiroyuki_Katsura --- generator/rust.ml | 71 +++ 1 file changed, 71 insertions(+) diff --git a/generator/rust.ml b/generator/rust.ml index 174f6ded3..a229d5eac 100644 --- a/generator/rust.ml +++ b/generator/rust.ml @@ -29,10 +29,32 @@ open Struc

[Libguestfs] [PATCH 3/9] Rust bindings: Add 4 bindings tests

2019-06-27 Thread Hiroyuki Katsura
From: Hiroyuki_Katsura --- generator/rust.ml | 13 --- run.in| 9 rust/Cargo.lock | 6 + rust/Cargo.toml | 4 +--- rust/tests/010_load.rs| 24 +++ rust/tests/020_cr

[Libguestfs] [PATCH 9/9] Rust bindings: Complete bindings

2019-06-27 Thread Hiroyuki Katsura
From: Hiroyuki_Katsura --- configure.ac| 2 + generator/bindtests.ml | 63 + generator/main.ml | 2 +- generator/rust.ml | 423 +--- generator/rust.mli | 5 +- rust/.gitig

[Libguestfs] [PATCH 2/9] Rust bindings: Add create / close functions

2019-06-27 Thread Hiroyuki Katsura
From: Hiroyuki_Katsura --- generator/rust.ml | 84 ++- rust/Cargo.toml | 2 ++ 2 files changed, 85 insertions(+), 1 deletion(-) diff --git a/generator/rust.ml b/generator/rust.ml index 83afdfe73..dbe9db010 100644 --- a/generator/rust.ml +++ b/gener

[Libguestfs] [PATCH 1/9] Rust bindings: Add Rust bindings

2019-06-27 Thread Hiroyuki Katsura
From: Hiroyuki_Katsura --- Makefile.am | 4 configure.ac| 3 +++ generator/Makefile.am | 3 +++ generator/bindtests.ml | 3 +++ generator/bindtests.mli | 1 + generator/main.ml | 5 + generator/rust.ml | 34 ++

[Libguestfs] [PATCH 8/9] Rust bindings: Free buffers

2019-06-27 Thread Hiroyuki Katsura
From: Hiroyuki_Katsura --- generator/rust.ml | 142 +--- rust/tests/050_handle_properties.rs | 61 rust/tests/070_opt_args.rs | 36 +++ rust/tests/080_version.rs | 29 ++ 4 files changed, 236 insertions(+), 32 d

[Libguestfs] [PATCH 7/9] Rust bindings: Complete actions

2019-06-27 Thread Hiroyuki Katsura
From: Hiroyuki_Katsura --- generator/rust.ml | 283 ++ 1 file changed, 259 insertions(+), 24 deletions(-) diff --git a/generator/rust.ml b/generator/rust.ml index aa8b249ff..79e16dfc6 100644 --- a/generator/rust.ml +++ b/generator/rust.ml @@ -60,10 +6

[Libguestfs] [PATCH 4/9] Rust bindings: Add generator of structs

2019-06-27 Thread Hiroyuki Katsura
From: Hiroyuki_Katsura --- generator/rust.ml | 87 +-- 1 file changed, 85 insertions(+), 2 deletions(-) diff --git a/generator/rust.ml b/generator/rust.ml index 251eb1594..174f6ded3 100644 --- a/generator/rust.ml +++ b/generator/rust.ml @@ -29,13 +29,

Re: [Libguestfs] Few libnbd questions/concerns

2019-06-27 Thread Richard W.M. Jones
On Wed, Jun 26, 2019 at 09:33:04PM -0500, Eric Blake wrote: > Another thing I just noticed: nbd_poll returns 0 both for timeout and > for when it notified the state machine about POLLIN or POLLOUT making > progress. We probably want to switch it to return 0 on timeout and 1 > when it made progress,