[Libguestfs] [PATCH nbdkit 6/9] lib: Use replacement strategy for get_current_dir_name.
Richard W.M. Jones
rjones at redhat.com
Tue Aug 18 14:06:44 UTC 2020
On Tue, Aug 18, 2020 at 08:24:30AM -0500, Eric Blake wrote:
> On 8/18/20 5:50 AM, Richard W.M. Jones wrote:
> >This is really a replacement for a missing platform function, so use
> >the same LIBOBJS mechanism to replace it.
> >---
> > configure.ac | 2 +-
> > common/include/Makefile.am | 6 ---
> > common/replacements/Makefile.am | 10 ++++
> > plugins/floppy/Makefile.am | 1 +
> > common/replacements/get_current_dir_name.h | 49 +++++++++++++++++++
> > server/public.c | 2 +-
> > .../get_current_dir_name.c} | 10 ++--
> > .../test-current-dir-name.c | 2 +-
> > plugins/floppy/virtual-floppy.c | 2 +-
> > .gitignore | 2 +-
> > 10 files changed, 69 insertions(+), 17 deletions(-)
>
> ACK 4-6.
>
> Reminds me of an unrelated question - when a user writes:
>
> nbdkit memory --run './command'
>
> rather than
>
> nbdkit memory --run '/path/to/command'
>
> do we guarantee that the --run snippet will use the current working
> directory that nbdkit started under, even though nbdkit itself
> chdir's away to / as part of starting the plugin? (If we do
> guarantee it, do we test it? If we haven't yet guaranteed it, should
> we?)
Yes. We do test it, although rather as a side-effect of many
other tests.
> >+++ b/common/replacements/get_current_dir_name.h
> >@@ -0,0 +1,49 @@
> >+/* nbdkit
> >+ * Copyright (C) 2018 Red Hat Inc.
> >+ * All rights reserved.
>
> 2020, lose 'All rights reserved'...
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 monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top
More information about the Libguestfs
mailing list