Eric Blake
2020-Feb-13 22:49 UTC
[Libguestfs] [nbdkit PATCH] vddk: Make 'file=' a magic key
Since it is required, it might as well be magic ;) Signed-off-by: Eric Blake <eblake@redhat.com> --- 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 ++++- plugins/vddk/vddk.c | 3 ++- tests/test-vddk.sh | 3 +-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/vddk/nbdkit-vddk-plugin.pod b/plugins/vddk/nbdkit-vddk-plugin.pod index f0748def..11d12c3f 100644 --- a/plugins/vddk/nbdkit-vddk-plugin.pod +++ b/plugins/vddk/nbdkit-vddk-plugin.pod @@ -4,7 +4,7 @@ nbdkit-vddk-plugin - nbdkit VMware VDDK plugin =head1 SYNOPSIS - nbdkit vddk file=FILENAME + nbdkit vddk [file=]FILENAME [config=FILENAME] [cookie=COOKIE] [libdir=LIBRARY] [nfchostport=PORT] [single-link=true] [password=PASSWORD | password=- | password=+FILENAME @@ -135,6 +135,9 @@ If a VM has multiple disks, nbdkit can only serve one at a time. To serve more than one you must run multiple copies of nbdkit. (See L</NOTES> below). +C<file=> is a magic config key and may be omitted in most cases. +See L<nbdkit(1)/Magic parameters>. + =item B<libdir=>PATHNAME This sets the path of the VMware VDDK distribution. diff --git a/plugins/vddk/vddk.c b/plugins/vddk/vddk.c index 6deb0a0b..344b4e6b 100644 --- a/plugins/vddk/vddk.c +++ b/plugins/vddk/vddk.c @@ -416,7 +416,7 @@ vddk_config_complete (void) } #define vddk_config_help \ - "file=<FILENAME> (required) The filename (eg. VMDK file) to serve.\n" \ + "[file=]<FILENAME> (required) The filename (eg. VMDK file) to serve.\n" \ "Many optional parameters are supported, see nbdkit-vddk-plugin(3)." static void @@ -901,6 +901,7 @@ static struct nbdkit_plugin plugin = { .config = vddk_config, .config_complete = vddk_config_complete, .config_help = vddk_config_help, + .magic_config_key = "file", .dump_plugin = vddk_dump_plugin, .open = vddk_open, .close = vddk_close, diff --git a/tests/test-vddk.sh b/tests/test-vddk.sh index d99ebf88..6933f716 100755 --- a/tests/test-vddk.sh +++ b/tests/test-vddk.sh @@ -48,8 +48,7 @@ grep ^vddk_default_libdir= test-vddk.out # a load that we know will fail, but the important part is that dlopen's # error message lists an absolute file even though we passed a relative # name, showing that our shim did adjust it. -nbdkit vddk libdir=.libs \ - file=/dev/null --run ':' 2> test-vddk.err || : +nbdkit vddk libdir=.libs /dev/null --run ':' 2> test-vddk.err || : cat test-vddk.err grep '/.libs/nosuch' test-vddk.err -- 2.24.1
Richard W.M. Jones
2020-Feb-17 12:45 UTC
Re: [Libguestfs] [nbdkit PATCH] vddk: Make 'file=' a magic key
On Thu, Feb 13, 2020 at 04:49:59PM -0600, Eric Blake wrote:> Since it is required, it might as well be magic ;) > > Signed-off-by: Eric Blake <eblake@redhat.com> > --- > > 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 ++++- > plugins/vddk/vddk.c | 3 ++- > tests/test-vddk.sh | 3 +-- > 3 files changed, 7 insertions(+), 4 deletions(-) > > diff --git a/plugins/vddk/nbdkit-vddk-plugin.pod b/plugins/vddk/nbdkit-vddk-plugin.pod > index f0748def..11d12c3f 100644 > --- a/plugins/vddk/nbdkit-vddk-plugin.pod > +++ b/plugins/vddk/nbdkit-vddk-plugin.pod > @@ -4,7 +4,7 @@ nbdkit-vddk-plugin - nbdkit VMware VDDK plugin > > =head1 SYNOPSIS > > - nbdkit vddk file=FILENAME > + nbdkit vddk [file=]FILENAME > [config=FILENAME] [cookie=COOKIE] [libdir=LIBRARY] > [nfchostport=PORT] [single-link=true] > [password=PASSWORD | password=- | password=+FILENAME > @@ -135,6 +135,9 @@ If a VM has multiple disks, nbdkit can only serve one at a time. To > serve more than one you must run multiple copies of nbdkit. (See > L</NOTES> below). > > +C<file=> is a magic config key and may be omitted in most cases. > +See L<nbdkit(1)/Magic parameters>. > + > =item B<libdir=>PATHNAME > > This sets the path of the VMware VDDK distribution. > diff --git a/plugins/vddk/vddk.c b/plugins/vddk/vddk.c > index 6deb0a0b..344b4e6b 100644 > --- a/plugins/vddk/vddk.c > +++ b/plugins/vddk/vddk.c > @@ -416,7 +416,7 @@ vddk_config_complete (void) > } > > #define vddk_config_help \ > - "file=<FILENAME> (required) The filename (eg. VMDK file) to serve.\n" \ > + "[file=]<FILENAME> (required) The filename (eg. VMDK file) to serve.\n" \ > "Many optional parameters are supported, see nbdkit-vddk-plugin(3)." > > static void > @@ -901,6 +901,7 @@ static struct nbdkit_plugin plugin = { > .config = vddk_config, > .config_complete = vddk_config_complete, > .config_help = vddk_config_help, > + .magic_config_key = "file", > .dump_plugin = vddk_dump_plugin, > .open = vddk_open, > .close = vddk_close, > diff --git a/tests/test-vddk.sh b/tests/test-vddk.sh > index d99ebf88..6933f716 100755 > --- a/tests/test-vddk.sh > +++ b/tests/test-vddk.sh > @@ -48,8 +48,7 @@ grep ^vddk_default_libdir= test-vddk.out > # a load that we know will fail, but the important part is that dlopen's > # error message lists an absolute file even though we passed a relative > # name, showing that our shim did adjust it. > -nbdkit vddk libdir=.libs \ > - file=/dev/null --run ':' 2> test-vddk.err || : > +nbdkit vddk libdir=.libs /dev/null --run ':' 2> test-vddk.err || : > cat test-vddk.err > > grep '/.libs/nosuch' test-vddk.errYup, this 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-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/
Richard W.M. Jones
2020-Feb-17 12:48 UTC
Re: [Libguestfs] [nbdkit PATCH] vddk: Make 'file=' a magic key
On Mon, Feb 17, 2020 at 12:45:58PM +0000, Richard W.M. Jones wrote:> On Thu, Feb 13, 2020 at 04:49:59PM -0600, Eric Blake wrote: > > Since it is required, it might as well be magic ;) > > > > Signed-off-by: Eric Blake <eblake@redhat.com> > > --- > > > > 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 ++++- > > plugins/vddk/vddk.c | 3 ++- > > tests/test-vddk.sh | 3 +-- > > 3 files changed, 7 insertions(+), 4 deletions(-) > > > > diff --git a/plugins/vddk/nbdkit-vddk-plugin.pod b/plugins/vddk/nbdkit-vddk-plugin.pod > > index f0748def..11d12c3f 100644 > > --- a/plugins/vddk/nbdkit-vddk-plugin.pod > > +++ b/plugins/vddk/nbdkit-vddk-plugin.pod > > @@ -4,7 +4,7 @@ nbdkit-vddk-plugin - nbdkit VMware VDDK plugin > > > > =head1 SYNOPSIS > > > > - nbdkit vddk file=FILENAME > > + nbdkit vddk [file=]FILENAME > > [config=FILENAME] [cookie=COOKIE] [libdir=LIBRARY] > > [nfchostport=PORT] [single-link=true] > > [password=PASSWORD | password=- | password=+FILENAME > > @@ -135,6 +135,9 @@ If a VM has multiple disks, nbdkit can only serve one at a time. To > > serve more than one you must run multiple copies of nbdkit. (See > > L</NOTES> below). > > > > +C<file=> is a magic config key and may be omitted in most cases. > > +See L<nbdkit(1)/Magic parameters>. > > + > > =item B<libdir=>PATHNAME > > > > This sets the path of the VMware VDDK distribution. > > diff --git a/plugins/vddk/vddk.c b/plugins/vddk/vddk.c > > index 6deb0a0b..344b4e6b 100644 > > --- a/plugins/vddk/vddk.c > > +++ b/plugins/vddk/vddk.c > > @@ -416,7 +416,7 @@ vddk_config_complete (void) > > } > > > > #define vddk_config_help \ > > - "file=<FILENAME> (required) The filename (eg. VMDK file) to serve.\n" \ > > + "[file=]<FILENAME> (required) The filename (eg. VMDK file) to serve.\n" \ > > "Many optional parameters are supported, see nbdkit-vddk-plugin(3)." > > > > static void > > @@ -901,6 +901,7 @@ static struct nbdkit_plugin plugin = { > > .config = vddk_config, > > .config_complete = vddk_config_complete, > > .config_help = vddk_config_help, > > + .magic_config_key = "file", > > .dump_plugin = vddk_dump_plugin, > > .open = vddk_open, > > .close = vddk_close, > > diff --git a/tests/test-vddk.sh b/tests/test-vddk.sh > > index d99ebf88..6933f716 100755 > > --- a/tests/test-vddk.sh > > +++ b/tests/test-vddk.sh > > @@ -48,8 +48,7 @@ grep ^vddk_default_libdir= test-vddk.out > > # a load that we know will fail, but the important part is that dlopen's > > # error message lists an absolute file even though we passed a relative > > # name, showing that our shim did adjust it. > > -nbdkit vddk libdir=.libs \ > > - file=/dev/null --run ':' 2> test-vddk.err || : > > +nbdkit vddk libdir=.libs /dev/null --run ':' 2> test-vddk.err || : > > cat test-vddk.err > > > > grep '/.libs/nosuch' test-vddk.err > > Yup, this is fine, ACK.Actually it doesn't apply - maybe depends on something else? Anyway the change itself is still fine. 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. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/
Possibly Parallel Threads
- Re: [nbdkit PATCH] vddk: Make 'file=' a magic key
- Re: [nbdkit PATCH] vddk: Make 'file=' a magic key
- [PATCH nbdkit v2 2/3] NOT WORKING: vddk: Drive library loading from libdir parameter.
- [PATCH NOT WORKING nbdkit v2 0/2] vddk: Restructure plugin to allow greater parallelism.
- [nbdkit PATCH v7 0/2] vddk: Drive library loading from libdir parameter.