Re: [Libguestfs] [nbdkit PATCH v3] vddk: Drive library loading from libdir parameter.

2020-02-13 Thread Eric Blake
On 2/13/20 4:46 PM, Eric Blake wrote: Instead, we can fix the problem by relying on the fact that Linux provides dlmopen(), which opens a shared library in a new namespace. We first load a shim library into this namespace which overrides the dlopen() present in the main executable, then load

[Libguestfs] [nbdkit PATCH] vddk: Make 'file=' a magic key

2020-02-13 Thread Eric Blake
Since it is required, it might as well be magic ;) Signed-off-by: Eric Blake --- As written, applies on top of my v3 patch for dlopen; but it would be easy enough to rebase and take this one now even if we aren't sure about the dlopen stuff plugins/vddk/nbdkit-vddk-plugin.pod | 5 -

[Libguestfs] [nbdkit PATCH v3] vddk: Drive library loading from libdir parameter.

2020-02-13 Thread Eric Blake
From: "Richard W.M. Jones" Do not use LD_LIBRARY_PATH to locate the VDDK library. Setting this always causes problems because VDDK comes bundled with broken replacements for system libraries, such as libcrypto.so and libstdc++.so. Two problems this causes which we have seen in the real world:

[Libguestfs] [PATCH v3 0/1] tools: add '--blocksize' option for C-based tools

2020-02-13 Thread Mykola Ivanets
From: Nikolay Ivanets This patch depends on changes in 'common' sub-module posted here: https://www.redhat.com/archives/libguestfs/2020-February/msg00150.html v3 fixes issue found during code review: - options now appear in alphabetical order v2: Almost the same as v1 except '--blocksize'

[Libguestfs] [PATCH v3 1/1] tools: add '--blocksize' option for C-based tools

2020-02-13 Thread Mykola Ivanets
From: Nikolay Ivanets This patch adds '--blocksize' command line option for guestfish and other C-based tools. This option allows specifying disk sector size. --- align/Makefile.am | 1 + align/scan.c | 8 align/virt-alignment-scan.pod | 2 ++

[Libguestfs] [common PATCH v4 1/1] options: add '--blocksize' option for C-based tools

2020-02-13 Thread Mykola Ivanets
From: Nikolay Ivanets This patch adds '--blocksize' command line option parsing and handling for guestfish and other C-based tools which share the same code from this sub-module. '--blocksize' will be a common for almost all libguestfs-based tools and thus parameter description will be repeated

[Libguestfs] [common PATCH v4 0/1] options: add '--blocksize' option for C-based tools

2020-02-13 Thread Mykola Ivanets
From: Nikolay Ivanets v4 fixes issues found during code review: - whitespace-change-only hunks are removed - options are alphabetically orderred now v3 is just a spelling correction spotted by Eric Blake https://www.redhat.com/archives/libguestfs/2020-February/msg00111.html In v2 I've moved

Re: [Libguestfs] [PATCH nbdkit v2 2/3] NOT WORKING: vddk: Drive library loading from libdir parameter.

2020-02-13 Thread Eric Blake
On 2/13/20 10:04 AM, Richard W.M. Jones wrote: I couldn't get this to work in the end. This is the latest non-working version. This email documents what doesn't work for the permanent record. The central problem is that VDDK InitEx() appears to dlopen() various of its own plugins. Although I

[Libguestfs] [PATCH nbdkit v2 2/3] NOT WORKING: vddk: Drive library loading from libdir parameter.

2020-02-13 Thread Richard W.M. Jones
Do not use LD_LIBRARY_PATH to locate the VDDK library. Setting this always causes problems because VDDK comes bundled with broken replacements for system libraries, such as libcrypto.so and libstdc++.so. Two problems this causes which we have seen in the real world: (1) User does ‘export

[Libguestfs] [PATCH nbdkit v2 3/3] NOT WORKING vddk: Use dlmopen to isolate VDDK.

2020-02-13 Thread Richard W.M. Jones
--- configure.ac| 5 + plugins/vddk/vddk.c | 4 2 files changed, 9 insertions(+) diff --git a/configure.ac b/configure.ac index d71f06e4..57626a76 100644 --- a/configure.ac +++ b/configure.ac @@ -321,6 +321,11 @@ AC_SEARCH_LIBS([dlsym], [dl dld], [ ]) LIBS="$old_LIBS"

[Libguestfs] [PATCH nbdkit v2 2/3] NOT WORKING: vddk: Drive library loading from libdir parameter.

2020-02-13 Thread Richard W.M. Jones
I couldn't get this to work in the end. This is the latest non-working version. This email documents what doesn't work for the permanent record. The central problem is that VDDK InitEx() appears to dlopen() various of its own plugins. Although I wasn't able to capture exactly what dlopen()

[Libguestfs] [PATCH nbdkit v2 1/3] vddk: Delay loading VDDK until config_complete.

2020-02-13 Thread Richard W.M. Jones
We were previously dlopen-ing it in the load() method. This is very early and in particular means that the only possible way to configure where we find the library is through environment variables and not through config parameters. Also it's not necessary as we don't call any functions from the

Re: [Libguestfs] [PATCH nbdkit 2/2] vddk: Drive library loading from libdir parameter.

2020-02-13 Thread Richard W.M. Jones
On Thu, Feb 13, 2020 at 08:23:32AM -0600, Eric Blake wrote: > On 2/13/20 8:01 AM, Richard W.M. Jones wrote: > >Do not use LD_LIBRARY_PATH to locate the VDDK library. Setting this > >always causes problems because VDDK comes bundled with broken > >replacements for system libraries, such as

Re: [Libguestfs] [PATCH nbdkit 2/2] vddk: Drive library loading from libdir parameter.

2020-02-13 Thread Eric Blake
On 2/13/20 8:01 AM, Richard W.M. Jones wrote: Do not use LD_LIBRARY_PATH to locate the VDDK library. Setting this always causes problems because VDDK comes bundled with broken replacements for system libraries, such as libcrypto.so and libstdc++.so. Two problems this causes which we have seen

Re: [Libguestfs] [PATCH nbdkit] NOT WORKING vddk: Use dlmopen to isolate VDDK.

2020-02-13 Thread Richard W.M. Jones
On Thu, Feb 13, 2020 at 02:06:47PM +, Richard W.M. Jones wrote: > --- > configure.ac| 5 + > plugins/vddk/vddk.c | 4 > 2 files changed, 9 insertions(+) > > diff --git a/configure.ac b/configure.ac > index d71f06e4..57626a76 100644 > --- a/configure.ac > +++ b/configure.ac >

[Libguestfs] [PATCH nbdkit] NOT WORKING vddk: Use dlmopen to isolate VDDK.

2020-02-13 Thread Richard W.M. Jones
--- configure.ac| 5 + plugins/vddk/vddk.c | 4 2 files changed, 9 insertions(+) diff --git a/configure.ac b/configure.ac index d71f06e4..57626a76 100644 --- a/configure.ac +++ b/configure.ac @@ -321,6 +321,11 @@ AC_SEARCH_LIBS([dlsym], [dl dld], [ ]) LIBS="$old_LIBS"

[Libguestfs] [PATCH nbdkit 2/2] vddk: Drive library loading from libdir parameter.

2020-02-13 Thread Richard W.M. Jones
Do not use LD_LIBRARY_PATH to locate the VDDK library. Setting this always causes problems because VDDK comes bundled with broken replacements for system libraries, such as libcrypto.so and libstdc++.so. Two problems this causes which we have seen in the real world: (1) User does ‘export

[Libguestfs] [PATCH nbdkit 1/2] vddk: Delay loading VDDK until config_complete.

2020-02-13 Thread Richard W.M. Jones
We were previously dlopen-ing it in the load() method. This is very early and in particular means that the only possible way to configure where we find the library is through environment variables and not through config parameters. Also it's not necessary as we don't call any functions from the

Re: [Libguestfs] [PATCH 2/2] firstboot: schedule firstboot as delayed task

2020-02-13 Thread Tomáš Golembiovský
> > I have really no clue about this. > > > > What is "~dpnx0"? > > I wanted to documented that in a comment at first. But then I decided > against that as it seemed that as it seemed such patterns are used in > multiple places in the code (ergo everyone knows). > > Looking now I see two

Re: [Libguestfs] [PATCH 2/2] firstboot: schedule firstboot as delayed task

2020-02-13 Thread Tomáš Golembiovský
On Tue, 11 Feb 2020 14:36:24 + "Richard W.M. Jones" wrote: > On Thu, Nov 21, 2019 at 12:04:18PM +0100, Tomáš Golembiovský wrote: > > Instead of running firstboot scripts during early boot schedule a task > > delayed for 1-2 minute. > > > > During the first boot, after virt-v2v conversion,

Re: [Libguestfs] [PATCH v2 0/1] tools: add '--blocksize' option for C-based tools

2020-02-13 Thread Richard W.M. Jones
On Wed, Feb 12, 2020 at 03:02:40AM +0200, Mykola Ivanets wrote: > From: Nikolay Ivanets > > This patch depends on changes in 'common' sub-module posted here: > https://www.redhat.com/archives/libguestfs/2020-February/msg00099.html > > v2: > Almost the same as v1 except '--blocksize' option

Re: [Libguestfs] [common PATCH v2 1/1] options: add '--blocksize' option for C-based tools

2020-02-13 Thread Richard W.M. Jones
This version fixes the trailing whitespace problem, and having the "blocksize-option.pod" file makes sense as well. (One day we should do the same for --format and other options). Still a certain amount of whitespace-change-only hunks going on though. Rich. -- Richard Jones, Virtualization

Re: [Libguestfs] [PATCH 1/1] tools: add '--blocksize' option for C-based tools

2020-02-13 Thread Richard W.M. Jones
On Tue, Feb 11, 2020 at 11:51:17PM +0200, Mykola Ivanets wrote: > diff --git a/align/scan.c b/align/scan.c > index b9f29868c..5a456d3d6 100644 > --- a/align/scan.c > +++ b/align/scan.c > @@ -90,6 +90,8 @@ usage (int status) >" -c|--connect uri Specify libvirt URI for -d

Re: [Libguestfs] [common PATCH] options: add '--blocksize' option for C-based tools

2020-02-13 Thread Richard W.M. Jones
On Tue, Feb 11, 2020 at 11:41:20PM +0200, Mykola Ivanets wrote: > diff --git a/options/options.h b/options/options.h > index 9b78302..9f3a1e7 100644 > --- a/options/options.h > +++ b/options/options.h > @@ -65,6 +65,7 @@ struct drv { >const char *format; /* format (NULL == autodetect) */