Re: [Libguestfs] [PATCH libnbd v2] tests: Add a test of nbd_{set, get}_socket_activation_name

2023-05-09 Thread Richard W.M. Jones
This was pushed as commit bab3081265 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 nbdkit v3 6/6] server: debug: Escape debug strings

2023-05-09 Thread Richard W.M. Jones
Thanks for everyone's feedback. I pushed this series with several enhancements as: 5fbf93a92..2f7ca818f Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows

Re: [Libguestfs] [PATCH nbdkit v3 6/6] server: debug: Escape debug strings

2023-05-09 Thread Richard W.M. Jones
On Tue, May 09, 2023 at 01:36:13PM -0500, Eric Blake wrote: > On Tue, May 09, 2023 at 03:51:21PM +0100, Richard W.M. Jones wrote: > > Debug strings contain all kinds of information including some under > > user control. Previously we simply sent everything to stderr, but > >

Re: [Libguestfs] [PATCH nbdkit v3 5/6] server: debug: Fix error handling

2023-05-09 Thread Richard W.M. Jones
On Tue, May 09, 2023 at 01:25:18PM -0500, Eric Blake wrote: > On Tue, May 09, 2023 at 03:51:20PM +0100, Richard W.M. Jones wrote: > > Preserve errno even if the function fails. We need to set > > errno = err again on every exit path out of the function. > > > > Chec

Re: [Libguestfs] [PATCH nbdkit v3 3/6] common/utils: Add C string quoting function

2023-05-09 Thread Richard W.M. Jones
On Tue, May 09, 2023 at 01:18:13PM -0500, Eric Blake wrote: > On Tue, May 09, 2023 at 03:51:18PM +0100, Richard W.M. Jones wrote: > > eg. { '\r', '\n' } -> { '\\', 'n', '\\', 'r' } > > --- > > common/utils/utils.h | 1 + > &

[Libguestfs] [PATCH nbdkit v3 6/6] server: debug: Escape debug strings

2023-05-09 Thread Richard W.M. Jones
Debug strings contain all kinds of information including some under user control. Previously we simply sent everything to stderr, but this is potentially insecure, as well as not dealing well with non-printable characters. Escape these strings when printing. --- server/debug.c | 38

[Libguestfs] [PATCH nbdkit v3 5/6] server: debug: Fix error handling

2023-05-09 Thread Richard W.M. Jones
Preserve errno even if the function fails. We need to set errno = err again on every exit path out of the function. Check if close_memstream failed and go to the error path if so. This is most important on Windows where close_memstream is what actually allocates the memory. But even on Unix,

[Libguestfs] [PATCH nbdkit v3 3/6] common/utils: Add C string quoting function

2023-05-09 Thread Richard W.M. Jones
eg. { '\r', '\n' } -> { '\\', 'n', '\\', 'r' } --- common/utils/utils.h | 1 + common/utils/quote.c | 58 2 files changed, 59 insertions(+) diff --git a/common/utils/utils.h b/common/utils/utils.h index 42288a5cd..1e6d8972b 100644 ---

[Libguestfs] [PATCH nbdkit v3 4/6] server: debug: Return earlier if not verbose

2023-05-09 Thread Richard W.M. Jones
In particular return before we have allocated 'str' with attribute((cleanup)) so that we don't waste time calling free (NULL) on the hot-ish path out of the function. --- server/debug.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/debug.c b/server/debug.c index

[Libguestfs] [PATCH nbdkit v3 1/6] server: Add -D nbdkit.environ=1 to dump the environment

2023-05-09 Thread Richard W.M. Jones
This is not secure so should not be used routinely. Also we do not attempt to filter environment variables, so even ones containing multiple lines or special characters are all sent to nbdkit_debug. The reason for adding this is to allow for debugging the new nbd_set_socket_activation_name(3)

[Libguestfs] [PATCH nbdkit v3 2/6] server: debug: Don't emit ANSI colour codes on Windows

2023-05-09 Thread Richard W.M. Jones
At least under Wine they are not recognized and you just see literal "[0m" etc appearing in the output. Updates: commit 5a011e02375912f2ad88de1ebc6d609e29d38f71 Reviewed-by: Laszlo Ersek --- server/debug.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/server/debug.c b/server/debug.c

[Libguestfs] [PATCH nbdkit v3 0/6] server: Add -D nbdkit.environ=1 to dump the environment

2023-05-09 Thread Richard W.M. Jones
Add R-b tags. Split the last patch into 3 parts, fixing the error handling issues raised by Laszlo in the previous review. Rich. ___ Libguestfs mailing list Libguestfs@redhat.com https://listman.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] [PATCH nbdkit v2 4/4] server: debug: Escape debug strings

2023-05-09 Thread Richard W.M. Jones
On Tue, May 09, 2023 at 03:05:41PM +0200, Laszlo Ersek wrote: [...] > Then, in the post-patch version, the following catches my eye: > > fp_inner = open_memstream (_inner, _inner); > if (fp_inner == NULL) { > fail: > /* Try to emit what we can. */ > errno = err; > vfprintf

Re: [Libguestfs] [PATCH nbdkit v2 3/4] common/utils: Add C string quoting function

2023-05-09 Thread Richard W.M. Jones
On Tue, May 09, 2023 at 02:28:40PM +0200, Laszlo Ersek wrote: > On 5/9/23 11:51, Richard W.M. Jones wrote: > > eg. { '\r', '\n' } -> { '\\', 'n', '\\', 'r' } > > --- > > common/utils/utils.h | 1 + > > common/utils/quote.c | 58 +++

[Libguestfs] [PATCH nbdkit v2 4/4] server: debug: Escape debug strings

2023-05-09 Thread Richard W.M. Jones
Debug strings contain all kinds of information including some under user control. Previously we simply sent everything to stderr, but this is potentially insecure, as well as not dealing well with non-printable characters. Escape these strings when printing. --- server/debug.c | 52

[Libguestfs] [PATCH nbdkit v2 3/4] common/utils: Add C string quoting function

2023-05-09 Thread Richard W.M. Jones
eg. { '\r', '\n' } -> { '\\', 'n', '\\', 'r' } --- common/utils/utils.h | 1 + common/utils/quote.c | 58 2 files changed, 59 insertions(+) diff --git a/common/utils/utils.h b/common/utils/utils.h index 42288a5cd..1e6d8972b 100644 ---

[Libguestfs] [PATCH nbdkit v2 0/4] Add -D nbdkit.environ=1, Windows fixes and quoting issues

2023-05-09 Thread Richard W.M. Jones
This grew a bit from last time ... The basic change to allow dumping the environment is the same, except I enabled this for Windows (and checked that it does in fact work -- Windows has environment variables, who knew?) The second patch fixes a problem I noticed while testing the above on

[Libguestfs] [PATCH nbdkit v2 1/4] server: Add -D nbdkit.environ=1 to dump the environment

2023-05-09 Thread Richard W.M. Jones
This is not secure so should not be used routinely. Also we do not attempt to filter environment variables, so even ones containing multiple lines or special characters are all sent to nbdkit_debug. The reason for adding this is to allow for debugging the new nbd_set_socket_activation_name(3)

[Libguestfs] [PATCH nbdkit v2 2/4] server: debug: Don't emit ANSI colour codes on Windows

2023-05-09 Thread Richard W.M. Jones
At least under Wine they are not recognized and you just see literal "[0m" etc appearing in the output. Updates: commit 5a011e02375912f2ad88de1ebc6d609e29d38f71 --- server/debug.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/server/debug.c b/server/debug.c index 1b5ddaafe..2231d40a0

[Libguestfs] [PATCH libnbd v2] tests: Add a test of nbd_{set, get}_socket_activation_name

2023-05-09 Thread Richard W.M. Jones
Also test that the expected environment variable is set when connecting to nbdkit. This test requires nbdkit >= 1.35.2 which added support for -D nbdkit.environ=1 to dump the environment, and will be skipped with other versions. --- .gitignore | 1 + tests/Makefile.am

[Libguestfs] [PATCH libnbd v2] tests: Add a test of nbd_{set, get}_socket_activation_name

2023-05-09 Thread Richard W.M. Jones
I added a test of the LISTEN_FDNAMES=unknown case as well, otherwise only minor cosmetic changes from last time. Rich. ___ Libguestfs mailing list Libguestfs@redhat.com https://listman.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] [PATCH nbdkit] server: Add -D nbdkit.environ=1 to dump the environment

2023-05-09 Thread Richard W.M. Jones
On Tue, May 09, 2023 at 08:56:47AM +0200, Laszlo Ersek wrote: > On 5/8/23 23:33, Richard W.M. Jones wrote: > > On Mon, May 08, 2023 at 08:54:48AM +0200, Laszlo Ersek wrote: > >> On 5/7/23 12:43, Richard W.M. Jones wrote: > >>> This is not secure so should not

Re: [Libguestfs] [PATCH nbdkit] server: Add -D nbdkit.environ=1 to dump the environment

2023-05-08 Thread Richard W.M. Jones
On Mon, May 08, 2023 at 08:54:48AM +0200, Laszlo Ersek wrote: > On 5/7/23 12:43, Richard W.M. Jones wrote: > > This is not secure so should not be used routinely. Also we do not > > attempt to filter environment variables, so even ones containing > > multiple lines or speci

Re: [Libguestfs] [PATCH nbdkit] server: Add -D nbdkit.environ=1 to dump the environment

2023-05-08 Thread Richard W.M. Jones
On Mon, May 08, 2023 at 08:35:53AM -0500, Eric Blake wrote: > On Sun, May 07, 2023 at 11:43:17AM +0100, Richard W.M. Jones wrote: > > This is not secure so should not be used routinely. Also we do not > > attempt to filter environment variables, so even ones containing >

[Libguestfs] [PATCH libnbd] tests: Add a test of nbd_{set, get}_socket_activation_name

2023-05-07 Thread Richard W.M. Jones
Also test that the expected environment variable is set when connecting to nbdkit. This test requires nbdkit >= 1.35.2 which added support for -D nbdkit.environ=1 to dump the environment, and will be skipped with other versions. --- .gitignore | 1 + tests/Makefile.am

[Libguestfs] [PATCH nbdkit] server: Add -D nbdkit.environ=1 to dump the environment

2023-05-07 Thread Richard W.M. Jones
This is not secure so should not be used routinely. Also we do not attempt to filter environment variables, so even ones containing multiple lines or special characters are all sent to nbdkit_debug. The reason for adding this is to allow for debugging the new nbd_set_socket_activation_name(3)

Re: [Libguestfs] [libnbd PATCH v2 2/2] generator/C: lib/api.c: indent arg list 2 spaces relative to function name

2023-05-04 Thread Richard W.M. Jones
For the series: Reviewed-by: Richard W.M. Jones 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

Re: [Libguestfs] [PATCH v2] daemon/tar: support more compression methods.

2023-05-02 Thread Richard W.M. Jones
Thanks - upstream in commit 692802bf96 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.

Re: [Libguestfs] [PATCH] daemon/tar: support more compression methods.

2023-04-29 Thread Richard W.M. Jones
On Sat, Apr 29, 2023 at 05:24:39PM +0200, Zixun LI wrote: > Add support for lzma, zstd and auto detection of compression methods. > > Signed-off-by: Zixun LI > --- > daemon/tar.c | 12 > 1 file changed, 12 insertions(+) > > diff --git a/daemon/tar.c b/daemon/tar.c > index

Re: [Libguestfs] Using nested partition with LUKS+GPT

2023-04-29 Thread Richard W.M. Jones
On Fri, Apr 28, 2023 at 03:32:57PM +0200, Philippe Midol-Monnet wrote: > Hi > > I have already fulfill a an issue, but it looks like it's not the recommended > process. > > > We are using a LUKS partition containing a GPT table and several partions. > > With libguestfs we can open the LUKS

Re: [Libguestfs] [PATCH nbdkit 2/2] allocators: sparse: Split the highly contended mutex

2023-04-28 Thread Richard W.M. Jones
On Thu, Apr 27, 2023 at 10:35:30AM -0500, Eric Blake wrote: > Reviewed-by: Eric Blake Thanks, I pushed the two patches as e397f0643..9b5b93a07 About using fcntl locks: it seems troublesome because we'd then need to have an actual file to lock (even one in /dev/shm). That makes the

Re: [Libguestfs] [libnbd PATCH 23/23] generator/C: lib/api.c: indent arg list 2 spaces relative to function name

2023-04-27 Thread Richard W.M. Jones
All looks good, thanks: Reviewed-by: Richard W.M. Jones Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. Tiny program with many powerful

Re: [Libguestfs] [PATCH 3/3] daemon/selinux-relabel: run setfiles with "-T 0", if supported

2023-04-27 Thread Richard W.M. Jones
Thanks, patches upstream in 7674d603e9..d0d8e67384. 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

[Libguestfs] [PATCH nbdkit 1/2] contrib: Add a test/benchmarking tool for the sparse memory plugin

2023-04-27 Thread Richard W.M. Jones
Add a contrib directory which we can use to store random tests and other contributions that we don't necessarily want to support long term or incorporate into nbdkit. Into this directory place a test program which tests nbdkit-memory-plugin with allocator=sparse. --- configure.ac |

[Libguestfs] [PATCH nbdkit 2/2] allocators: sparse: Split the highly contended mutex

2023-04-27 Thread Richard W.M. Jones
We've long known that nbdkit-memory-plugin with the default sparse array allocator suffers because a global lock must be taken whenever any read or write operation is performed. This commit aims to safely improve performance by converting the lock into a read-write lock. The shared (read) lock

[Libguestfs] [PATCH nbdkit 0/2] allocators: sparse: Split the highly contended mutex

2023-04-27 Thread Richard W.M. Jones
nbdkit-memory-plugin is a RAM disk, but it is quite a slow one because of the lock we must acquire on the sparse array. Try to improve performance by changing this mutex for a read-write lock. The results are somewhat mixed. Note that in the real world, workloads which constantly update the

Re: [Libguestfs] [PATCH 2/3] daemon/selinux-relabel: search for "invalid option" in setfiles output

2023-04-26 Thread Richard W.M. Jones
On Wed, Apr 26, 2023 at 04:37:21PM +0200, Laszlo Ersek wrote: > On 4/26/23 14:59, Andrey Drobyshev wrote: > > 'X' in the setiles' stderr doesn't necessarily mean that option 'X' > > doesn't exist. For instance, when passing '-T' we get: "setfiles: > > option requires an argument -- 'T'". > > > >

Re: [Libguestfs] [PATCH 3/3] daemon/selinux-relabel: run setfiles with "-T 0", if supported

2023-04-26 Thread Richard W.M. Jones
Series looks good, so also: Reviewed-by: Richard W.M. Jones I'll get around to this in a bit, let's just wait a few hours in case there are further comments. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog

Re: [Libguestfs] Specify partition when using virt-customize --copy-in, copy file to boot partition

2023-04-24 Thread Richard W.M. Jones
On Mon, Apr 24, 2023 at 08:56:45AM +0200, Ingo Weinmann wrote: > Using virt-customize of libguestfs, I can copy a file from the host to the > root > partition of an image like this: > > virt-customize -a 2023-02-21-raspios-bullseye-arm64-lite.img --copy-in > cmdline.txt:/boot/ > > But

Re: [Libguestfs] [COMMON PATCH 0/1] mlcustomize: skip SELinux relabeling if it's disabled

2023-04-24 Thread Richard W.M. Jones
On Mon, Apr 24, 2023 at 12:47:37PM +0200, Denis V. Lunev wrote: > On 4/24/23 10:46, Richard W.M. Jones wrote: > >On Fri, Apr 21, 2023 at 09:01:40PM +0300, Andrey Drobyshev wrote: > >>This patch effectively limits the number of cases when we would want to > >>do a

Re: [Libguestfs] [COMMON PATCH 0/1] mlcustomize: skip SELinux relabeling if it's disabled

2023-04-24 Thread Richard W.M. Jones
On Mon, Apr 24, 2023 at 12:08:57PM +0200, Laszlo Ersek wrote: > On 4/24/23 10:46, Richard W.M. Jones wrote: > > On Fri, Apr 21, 2023 at 09:01:40PM +0300, Andrey Drobyshev wrote: > >> This patch effectively limits the number of cases when we would want to > >> do a

Re: [Libguestfs] [COMMON PATCH 0/1] mlcustomize: skip SELinux relabeling if it's disabled

2023-04-24 Thread Richard W.M. Jones
On Fri, Apr 21, 2023 at 09:01:40PM +0300, Andrey Drobyshev wrote: > This patch effectively limits the number of cases when we would want to > do a complete SELinux relabeling on Linux guest conversion. > > This was brought to my attention as we've recently had a support case > when the conversion

Re: [Libguestfs] [COMMON PATCH 1/1] mlcustomize: skip SELinux relabeling if it's disabled

2023-04-22 Thread Richard W.M. Jones
Upstream in libguestfs-common: 70c10a079..38e6988c1 and in virt-v2v: 6db3b26d2f..e83de8abe6 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

Re: [Libguestfs] [COMMON PATCH 1/1] mlcustomize: skip SELinux relabeling if it's disabled

2023-04-22 Thread Richard W.M. Jones
On Fri, Apr 21, 2023 at 09:01:41PM +0300, Andrey Drobyshev wrote: > From: Roman Kagan > > Even if SELinux config file and policy tools are present, SELinux may be > turned off by a setting in that config file, "SELINUX", having a value > of "disabled". > > Detect this case and skip relabeling.

Re: [Libguestfs] [PATCH nbdkit] rust: Add implementation of after_fork() method

2023-04-21 Thread Richard W.M. Jones
On Fri, Apr 21, 2023 at 06:30:52AM -0700, alan somers wrote: > On Fri, Apr 21, 2023 at 2:32 AM Laszlo Ersek wrote: > > > > On 4/21/23 11:20, Richard W.M. Jones wrote: > > > See: https://github.com/libguestfs/nbdkit/issues/21 > > > > > > Tested by applying

Re: [Libguestfs] [libnbd PATCH v2 4/4] generator: indent C argument list 2 spaces relative to function designator

2023-04-21 Thread Richard W.M. Jones
Patches 3 & 4 look good. For the series: Reviewed-by: Richard W.M. Jones Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. Tiny pro

Re: [Libguestfs] [PATCH nbdkit] rust: Add implementation of after_fork() method

2023-04-21 Thread Richard W.M. Jones
On Fri, Apr 21, 2023 at 10:20:35AM +0100, Richard W.M. Jones wrote: > impl Server for RamDisk { > +fn after_fork() -> Result<()> { > +// A place to start background threads. > +eprintln!("forked"); Alan, this reminds me that there is no bin

Re: [Libguestfs] [PATCH nbdkit] rust: Add implementation of after_fork() method

2023-04-21 Thread Richard W.M. Jones
On Fri, Apr 21, 2023 at 11:32:31AM +0200, Laszlo Ersek wrote: > On 4/21/23 11:20, Richard W.M. Jones wrote: > > See: https://github.com/libguestfs/nbdkit/issues/21 > > > > Tested by applying the following patch to the example plugin and > > running it with verbose enab

[Libguestfs] [PATCH nbdkit] rust: Add implementation of after_fork() method

2023-04-21 Thread Richard W.M. Jones
See: https://github.com/libguestfs/nbdkit/issues/21 Tested by applying the following patch to the example plugin and running it with verbose enabled: --- a/plugins/rust/examples/ramdisk.rs +++ b/plugins/rust/examples/ramdisk.rs @@ -43,6 +43,12 @@ struct RamDisk { } impl Server for RamDisk { +

Re: [Libguestfs] [libnbd PATCH 2/3] scripts/git.orderfile: put *.mli first among generator files

2023-04-20 Thread Richard W.M. Jones
t.orderfile > @@ -38,6 +38,7 @@ common/*.h > common/*/*.h > > # Generator files. > +generator/*.mli > generator/* > > # Source files. > Reviewed-by: Richard W.M. Jones Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read m

Re: [Libguestfs] [libnbd PATCH 1/3] scripts/git.orderfile: drop "generator/generator"

2023-04-20 Thread Richard W.M. Jones
4 > --- a/scripts/git.orderfile > +++ b/scripts/git.orderfile > @@ -38,7 +38,6 @@ common/*.h > common/*/*.h > > # Generator files. > -generator/generator > generator/* Reviewed-by: Richard W.M. Jones Rich. -- Richard Jones, Virtualization Group, Red Hat http://people

Re: [Libguestfs] [libnbd PATCH 3/3] generator: indent C argument list 2 spaces relative to function designator

2023-04-20 Thread Richard W.M. Jones
On Thu, Apr 20, 2023 at 04:04:58PM +0200, Laszlo Ersek wrote: > Change the optional "parens" parameter of "print_arg_list" from bool to a > new union type. The new union type has three data constructors, NoParens > (matching the previous "false" value), ParensSameLine (matching the > previous

Re: [Libguestfs] [libnbd PATCH 16/18] tests/requires: wrap source code at 80 characters

2023-04-19 Thread Richard W.M. Jones
On Wed, Apr 19, 2023 at 03:53:57PM +0200, Laszlo Ersek wrote: > On 4/19/23 15:37, Eric Blake wrote: > > On Tue, Apr 18, 2023 at 07:26:29PM +0200, Laszlo Ersek wrote: > >> Embedding a shell script in a multi-line C string literal is an exercise > >> in pain. I can see why the original author (whom

Re: [Libguestfs] [libnbd PATCH 08/18] lib/internal.h: wrap source code at 80 characters

2023-04-19 Thread Richard W.M. Jones
On Tue, Apr 18, 2023 at 07:26:21PM +0200, Laszlo Ersek wrote: > (The changes in this patch are simple, but likely more controversial than > the rest.) > > The following four components don't play nice together: > > - Needlessly spelling out "extern" for function declarations in header > files.

Re: [Libguestfs] [libnbd PATCH 18/18] ublk/tgt: wrap source code at 80 characters

2023-04-19 Thread Richard W.M. Jones
Looks fine. I agree with Eric about "newstyle fixed", that ought not to be split. For the series: Reviewed-by: Richard W.M. Jones Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wor

Re: [Libguestfs] [PATCH v3 6/6] RFC: spec: Introduce NBD_REPLY_TYPE_OFFSET_HOLE_EXT

2023-04-18 Thread Richard W.M. Jones
On Tue, Apr 18, 2023 at 02:33:41PM +0200, Wouter Verhelst wrote: > On Thu, Apr 13, 2023 at 05:02:41PM -0500, Eric Blake wrote: > > Rather than requiring all servers and clients to have a 32-bit limit > > on maximum NBD_CMD_READ/WRITE sizes, we can choose to standardize > > support for a 64-bit

Re: [Libguestfs] [PATCH nbdkit] server: Fix exit with parent behaviour if flag is not specified

2023-04-18 Thread Richard W.M. Jones
On Tue, Apr 18, 2023 at 11:09:48AM +0100, Richard W.M. Jones wrote: > On Tue, Apr 18, 2023 at 12:00:22PM +0200, Laszlo Ersek wrote: > > On 4/18/23 09:25, Richard W.M. Jones wrote: > > > Commit 6b03ec8ad6 ("common: Move exit-with-parent code from include/ > &g

Re: [Libguestfs] [PATCH nbdkit] server: Fix exit with parent behaviour if flag is not specified

2023-04-18 Thread Richard W.M. Jones
On Tue, Apr 18, 2023 at 12:00:22PM +0200, Laszlo Ersek wrote: > On 4/18/23 09:25, Richard W.M. Jones wrote: > > Commit 6b03ec8ad6 ("common: Move exit-with-parent code from include/ > > to utils/") was supposed to be a largely neutral refactoring of the > > --exit-wi

[Libguestfs] [PATCH nbdkit] server: Fix exit with parent behaviour if flag is not specified

2023-04-18 Thread Richard W.M. Jones
Commit 6b03ec8ad6 ("common: Move exit-with-parent code from include/ to utils/") was supposed to be a largely neutral refactoring of the --exit-with-parent flag. However I made a mistake in one hunk of that patch: -#ifdef HAVE_EXIT_WITH_PARENT - if (exit_with_parent) { -if

Re: [Libguestfs] [PATCH libnbd v2] README: Document additional packages

2023-04-17 Thread Richard W.M. Jones
On Mon, Apr 17, 2023 at 07:44:31PM +0300, Nir Soffer wrote: > When building from git we need autoconf, automake and libtool. > > Signed-off-by: Nir Soffer > --- > > Changes sinve v1: > - Remove `,` between package namses (Laszlo) > > README.md | 7 +++ > 1 file changed, 7 insertions(+) >

Re: [Libguestfs] [libnbd PATCH v2 3/3] copy: rewrap error message about stuck NBD server

2023-04-14 Thread Richard W.M. Jones
For this series (which I much prefer over v1): Reviewed-by: Richard W.M. Jones Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com nbdkit - Flexible, fast NBD server with plugins https

Re: [Libguestfs] [PATCH v3 6/6] RFC: spec: Introduce NBD_REPLY_TYPE_OFFSET_HOLE_EXT

2023-04-14 Thread Richard W.M. Jones
So I read through the whole series this morning and it all seems reasonable. Therefore: Reviewed-by: Richard W.M. Jones Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder

Re: [Libguestfs] [libnbd PATCH 1/4] copy: rename (LONG|SHORT)_OPTIONS to (LONG|SHORT)_OPTIONS_OPTION

2023-04-14 Thread Richard W.M. Jones
On Fri, Apr 14, 2023 at 10:21:31AM +0200, Laszlo Ersek wrote: > In the strictest sense, I only need to shorten > DESTINATION_IS_ZERO_OPTION by three characters. Should I rename it to > DEST_IS_ZERO_OPTION, or TARGET_IS_ZERO_OPTION? (The latter is better, > because we already have a

Re: [Libguestfs] [libnbd PATCH 4/4] copy: rewrap error message about stuck NBD server

2023-04-14 Thread Richard W.M. Jones
On Fri, Apr 14, 2023 at 09:59:56AM +0200, Laszlo Ersek wrote: > Wrap "copy/nbd-ops.c" at 80 characters. > > I couldn't find a way to test that this change is unobservable. > > Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2172516 > Signed-off-by: Laszlo Ersek > --- > copy/nbd-ops.c | 5

Re: [Libguestfs] [libnbd PATCH 2/4] copy: rename _OPTION to OPT_

2023-04-14 Thread Richard W.M. Jones
On Fri, Apr 14, 2023 at 09:59:54AM +0200, Laszlo Ersek wrote: > Rename _OPTION to OPT_ for two reasons: > > - it is more idiomatic for enum constants to have the same prefix than for > them to have the same suffix, > > - we hew away three characters (length-wise) from each option name, which >

Re: [Libguestfs] [libnbd PATCH 1/4] copy: rename (LONG|SHORT)_OPTIONS to (LONG|SHORT)_OPTIONS_OPTION

2023-04-14 Thread Richard W.M. Jones
On Fri, Apr 14, 2023 at 09:59:53AM +0200, Laszlo Ersek wrote: > Two of the enum constants that denote command line options are > inconsistently named with the rest: all identifiers should be > _OPTION, but LONG_OPTIONS and SHORT_OPTIONS (which are supposed > to list the long and short options)

Re: [Libguestfs] [PATCH nbdkit] tests: Add a test of floppy plugin + size parameter

2023-04-13 Thread Richard W.M. Jones
On Thu, Apr 13, 2023 at 06:05:56PM +0200, Laszlo Ersek wrote: > On 4/13/23 16:32, Richard W.M. Jones wrote: > > See: https://listman.redhat.com/archives/libguestfs/2023-April/031243.html > > Updates: commit c6d6113fa1f38389dbc27f000d06c425cbe912cd > > --- > > tes

[Libguestfs] [PATCH nbdkit] tests: Add a test of floppy plugin + size parameter

2023-04-13 Thread Richard W.M. Jones
See: https://listman.redhat.com/archives/libguestfs/2023-April/031243.html Updates: commit c6d6113fa1f38389dbc27f000d06c425cbe912cd --- tests/Makefile.am | 10 +-- tests/test-floppy-size.sh | 61 +++ 2 files changed, 69 insertions(+), 2 deletions(-)

Re: [Libguestfs] [nbdkit PATCH 17/17] server: wrap source code at 80 chars

2023-04-13 Thread Richard W.M. Jones
This series looks fine to me. 'make check' still passes? It contains some --help validation tests. I was preparing to do a 1.34 (new stable) release, so it's best to get this in sooner rather than later, otherwise it will miss the release. I will look at adding a test for

Re: [Libguestfs] [nbdkit PATCH 11/17] plugins/floppy: wrap source code at 80 chars

2023-04-13 Thread Richard W.M. Jones
On Thu, Apr 13, 2023 at 04:03:40PM +0200, Laszlo Ersek wrote: > Note that this patch is untested. In "make check", "tests/test-floppy.sh" > passes. However, that test does not seem to pass the "size=..." option to > the plugin, and the code being modified in create_virtual_floppy() is > related to

Re: [Libguestfs] [V2V PATCH v3 5/6] v2v, in-place: introduce --block-driver command line option

2023-04-11 Thread Richard W.M. Jones
On Fri, Mar 17, 2023 at 02:03:55PM +0100, Laszlo Ersek wrote: > On 3/17/23 13:46, Andrey Drobyshev wrote: > > Am I missing > > something here? And having all that said: wouldn't it be beneficial and > > more robust to explicitly set libguestfs backend when running the test > > suite? > > Yes, I

Re: [Libguestfs] [V2V PATCH v3 5/6] v2v, in-place: introduce --block-driver command line option

2023-04-11 Thread Richard W.M. Jones
On Thu, Mar 16, 2023 at 06:14:05PM +0200, Andrey Drobyshev wrote: > Thanks for the detailed overview. That is actually the answer to my > original question: I was looking for a sub-target which would check the > docs, and failed to see that instead there's a separate test for that > purpose. And

Re: [Libguestfs] How to resolve OCaml-augeas dependency for Guestfs build on Ubuntu 22.04

2023-04-06 Thread Richard W.M. Jones
On Wed, Apr 05, 2023 at 04:29:19PM +, Chintan Patel wrote: > Hi Libguestfs team, > > I'm trying to build guestfs on Ubuntu 22.04, but getting below error. > #17 8.021 checking for OCaml findlib package augeas... not found > #17 8.024 configure: error: the OCaml module 'augeas' is required >

Re: [Libguestfs] [rhel-9.2 v2v PATCH 2/2] detect_kernels: deal with RHEL's kernel-core / kernel-modules-core split

2023-04-06 Thread Richard W.M. Jones
For the series, since this is a straight backport of the upstream patch with the filenames changed: Reviewed-by: Richard W.M. Jones > https://bugzilla.redhat.com/show_bug.cgi?id=2175703 Looks like we're going to do this as a 0-day z-stream backport? You are assignee so I'll leave it al

Re: [Libguestfs] [libguestfs-common PATCH 2/2] detect_kernels: deal with RHEL's kernel-core / kernel-modules-core split

2023-04-05 Thread Richard W.M. Jones
On Mon, Mar 20, 2023 at 12:53:00PM +0100, Laszlo Ersek wrote: > In "kernel-5.14.0-269.el9", the "kernel-modules-core" subpackage got split > from the "kernel-core" subpackage. Therefore, a single binary RPM > containing *both* the "/boot/vmlinuz-5.14.0-269.el9.x86_64" file *and* the >

[Libguestfs] VM name starting with a dash

2023-04-03 Thread Richard W.M. Jones
13:19 < tgolembi[m]> is there a trick how to convert a VM with name that starts with a dash? It's being confused for virt-v2v argument. :) Yes you can do this: $ virt-v2v -o [etc...] -- vmname Note all -options need to come before the "--". For example: $ virt-builder

Re: [Libguestfs] [PATCH RHEL 8 only, common] RHEL 8: If setfiles fails fall back to autorelabel

2023-04-03 Thread Richard W.M. Jones
On Mon, Apr 03, 2023 at 12:00:38PM +0200, Laszlo Ersek wrote: > On 4/3/23 11:16, Richard W.M. Jones wrote: > > SFDC case 03473932, RHEL 8 only. > > > > See discussion in private email thread "Customer case requiring our > > assistance" in 2023. > >

Re: [Libguestfs] [PATCH RHEL 8 only, common] RHEL 8: If setfiles fails fall back to autorelabel

2023-04-03 Thread Richard W.M. Jones
On Mon, Apr 03, 2023 at 11:45:33AM +0200, Laszlo Ersek wrote: > On 4/3/23 11:16, Richard W.M. Jones wrote: > > SFDC case 03473932, RHEL 8 only. > > > > See discussion in private email thread "Customer case requiring our > > assistance" in 2023. > >

[Libguestfs] [PATCH RHEL 8 only, common] RHEL 8: If setfiles fails fall back to autorelabel

2023-04-03 Thread Richard W.M. Jones
SFDC case 03473932, RHEL 8 only. See discussion in private email thread "Customer case requiring our assistance" in 2023. --- mlcustomize/SELinux_relabel.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mlcustomize/SELinux_relabel.ml b/mlcustomize/SELinux_relabel.ml index

Re: [Libguestfs] [V2V PATCH v3 5/6] v2v, in-place: introduce --block-driver command line option

2023-03-14 Thread Richard W.M. Jones
On Tue, Mar 14, 2023 at 04:06:18PM +0200, Andrey Drobyshev wrote: > Speaking of "make check": could you point out, for future reference, > which particular sub-target you're referring to here? I can see these: > check-am, check-recursive, check-slow, check-TESTS, check-valgrind. And > none of

Re: [Libguestfs] [COMMON PATCH v3 4/4] inject_virtio_win: write the proper block controller PCI ID to Win registry

2023-03-10 Thread Richard W.M. Jones
For the full v3 series (common/ and v2v/): Reviewed-by: Richard W.M. Jones I'll give these a little while for others to comment before picking them upstream. Thanks, Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming

Re: [Libguestfs] [COMMON PATCH v2 4/4] inject_virtio_win: write the proper block controller PCI ID to Win registry

2023-03-09 Thread Richard W.M. Jones
On Thu, Mar 09, 2023 at 04:38:44PM +0200, Andrey Drobyshev wrote: > On 3/8/23 22:45, Richard W.M. Jones wrote: > > On Tue, Mar 07, 2023 at 09:40:26PM +0200, Andrey Drobyshev wrote: > >> In case when we are injecting virtio-scsi device driver into the guest > >> (rather

Re: [Libguestfs] [V2V PATCH v2 0/5] Bring support for virtio-scsi back to Windows

2023-03-09 Thread Richard W.M. Jones
On Thu, Mar 09, 2023 at 05:03:02PM +0200, Andrey Drobyshev wrote: > On 3/9/23 16:50, Andrey Drobyshev wrote: > > On 3/8/23 22:46, Richard W.M. Jones wrote: > >> > >> The patch series looks generally fine, but it really needs a test ... > >> > >>

Re: [Libguestfs] [V2V PATCH v2 1/1] convert_windows: add firstboot script to install drivers with pnputil

2023-03-09 Thread Richard W.M. Jones
) = > +let fb_script = "@echo off\n\ > + \n\ > + echo Wait for VirtIO drivers to be installed\n\ > + %systemroot%\\Sysnative\\PnPutil -i -a \ > + %systemroot%\\Drivers\\Virtio\\*.inf \ > +" in > + F

Re: [Libguestfs] [V2V PATCH 1/1] convert_windows: add firstboot script to install drivers with pnputil

2023-03-09 Thread Richard W.M. Jones
On Thu, Mar 09, 2023 at 03:47:10PM +0200, Andrey Drobyshev wrote: > On 3/8/23 22:52, Richard W.M. Jones wrote: > > On Wed, Mar 08, 2023 at 08:05:35PM +0200, Andrey Drobyshev wrote: > >> During conversion we copy the necessary drivers to the directory > >> "%sys

Re: [Libguestfs] [PATCH libnbd v4] lib/errors.c: Fix assert fail in exit path in multi-threaded code

2023-03-09 Thread Richard W.M. Jones
On Thu, Mar 09, 2023 at 11:11:50AM +, Daniel P. Berrangé wrote: > On Thu, Mar 09, 2023 at 09:50:00AM +0000, Richard W.M. Jones wrote: > > When a highly multi-threaded program such as nbdcopy encounters an > > error, there is a race condition in the library which can cause a

Re: [Libguestfs] [PATCH libnbd v3] lib/errors.c: Fix assert fail in exit path in multi-threaded code

2023-03-09 Thread Richard W.M. Jones
On Thu, Mar 09, 2023 at 09:13:24AM +, Daniel P. Berrangé wrote: > On Thu, Mar 09, 2023 at 08:44:51AM +0000, Richard W.M. Jones wrote: > > When a highly multi-threaded program such as nbdcopy encounters an > > error, there is a race condition in the library which can cause a

[Libguestfs] [PATCH libnbd v4] lib/errors.c: Fix assert fail in exit path in multi-threaded code

2023-03-09 Thread Richard W.M. Jones
When a highly multi-threaded program such as nbdcopy encounters an error, there is a race condition in the library which can cause an assertion failure and thus a core dump: (1) An error occurs on one of the threads. nbdcopy calls exit(3). (2) In lib/errors.c, the destructor calls

Re: [Libguestfs] [PATCH libnbd v3] lib/errors.c: Fix assert fail in exit path in multi-threaded code

2023-03-09 Thread Richard W.M. Jones
This causes a different problem. We actually hit the problem in this test: https://gitlab.com/nbdkit/libnbd/-/blob/master/tests/dlopen.c (1) The thread calls dlclose(), unmapping the library but leaving the pthread_key_t in place, which contains a pointer to free_errors_key in the unmapped

[Libguestfs] [PATCH libnbd v3] lib/errors.c: Fix assert fail in exit path in multi-threaded code

2023-03-09 Thread Richard W.M. Jones
This version simply removes the call to pthread_key_destroy. It fixes the problem and allows us to leave the asserts alone so we can still catch real errors. Of course this leaks pthread_key_t in the case where you dlclose() the library. glibc has a limit of 128 thread-specific keys (and the

[Libguestfs] [PATCH libnbd v3] lib/errors.c: Fix assert fail in exit path in multi-threaded code

2023-03-09 Thread Richard W.M. Jones
When a highly multi-threaded program such as nbdcopy encounters an error, there is a race condition in the library which can cause an assertion failure and thus a core dump: (1) An error occurs on one of the threads. nbdcopy calls exit(3). (2) In lib/errors.c, the destructor calls

Re: [Libguestfs] [libnbd PATCH v2] lib/errors.c: Fix assert fail in exit path in multi-threaded code

2023-03-08 Thread Richard W.M. Jones
n > nbdkit 1.32.5) > - various fuse/* (not sure if we can address that; cleaning up FUSE is > tricky) > > This reverts a small part of commit 831cbf7ee14c ("generator: Allow > DEAD state actions to run"). > > Thanks: Richard W.M. Jones > Signed-off-by: Eric

Re: [Libguestfs] [PATCH libnbd] lib/errors.c: Fix assert fail in exit path in multi-threaded code

2023-03-08 Thread Richard W.M. Jones
On Wed, Mar 08, 2023 at 08:29:41PM +, Richard W.M. Jones wrote: > diff --git a/generator/states.c b/generator/states.c > index fa0f8d716e..c0cf5a7f26 100644 > --- a/generator/states.c > +++ b/generator/states.c > @@ -191,8 +191,6 @@ STATE_MACHINE { >retu

Re: [Libguestfs] [V2V PATCH 1/1] convert_windows: add firstboot script to install drivers with pnputil

2023-03-08 Thread Richard W.M. Jones
On Wed, Mar 08, 2023 at 08:05:35PM +0200, Andrey Drobyshev wrote: > During conversion we copy the necessary drivers to the directory > "%systemroot%\Drivers\Virtio", adding it to the DevicePath registry > value. As documented in [1], this should be enough for Windows to find > device drivers and

Re: [Libguestfs] [V2V PATCH v2 0/5] Bring support for virtio-scsi back to Windows

2023-03-08 Thread Richard W.M. Jones
The patch series looks generally fine, but it really needs a test ... We find that having tests prevents unnoticed regressions from happening later. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog:

Re: [Libguestfs] [COMMON PATCH v2 4/4] inject_virtio_win: write the proper block controller PCI ID to Win registry

2023-03-08 Thread Richard W.M. Jones
On Tue, Mar 07, 2023 at 09:40:26PM +0200, Andrey Drobyshev wrote: > In case when we are injecting virtio-scsi device driver into the guest > (rather than the default virtio-blk), make sure we write the right PCI ID > value into the Windows guest registry. This is essential for the guest > to be

Re: [Libguestfs] [V2V PATCH v2 2/5] convert_windows: add Inject_virtio_win.Virtio_SCSI as a possible block type

2023-03-08 Thread Richard W.M. Jones
On Tue, Mar 07, 2023 at 09:40:07PM +0200, Andrey Drobyshev wrote: > Signed-off-by: Andrey Drobyshev > --- > convert/convert_windows.ml | 1 + > 1 files changed, 1 insertions(+) > > diff --git a/convert/convert_windows.ml b/convert/convert_windows.ml > index 9d8d271d..4f672487 100644 > ---

[Libguestfs] [PATCH libnbd] lib/errors.c: Fix assert fail in exit path in multi-threaded code

2023-03-08 Thread Richard W.M. Jones
When a highly multi-threaded program such as nbdcopy encounters an error, there is a race condition in the library which can cause an assertion failure and thus a core dump: (1) An error occurs on one of the threads. nbdcopy calls exit(3). (2) In lib/errors.c, the destructor calls

Re: [Libguestfs] [COMMON PATCH v2 2/4] inject_virtio_win: add Virtio_SCSI to block_type

2023-03-08 Thread Richard W.M. Jones
On Wed, Mar 08, 2023 at 04:00:10PM +0200, Andrey Drobyshev wrote: > Sure, thanks for pointing out. Will do as soon as Richard leaves his > notes on the series. I'm giving a talk this afternoon, but I should be able to look at it later. Rich. -- Richard Jones, Virtualization Group, Red Hat

Re: [Libguestfs] [PATCH v2v] convert: Allow preferred block driver to be specified on the command line

2023-03-07 Thread Richard W.M. Jones
On Tue, Mar 07, 2023 at 11:26:37AM +0100, Laszlo Ersek wrote: > On 3/7/23 09:35, Richard W.M. Jones wrote: > > On Tue, Mar 07, 2023 at 08:48:56AM +0100, Laszlo Ersek wrote: > >> On 3/6/23 17:52, Richard W.M. Jones wrote: > >> > >>> diff --git

<    1   2   3   4   5   6   7   8   9   10   >