Displaying 20 results from an estimated 7000 matches similar to: "[nbdkit PATCH] plugin: add and use nbdkit_realpath"
2018 Feb 14
2
[nbdkit PATCH v2] plugin: add and use nbdkit_realpath
Introduce a new helper function to resolve a path name, calling
nbdkit_error on failure: other than doing what nbdkit_absolute_path
does, it also checks that the file exists (and thus avoids errors later
on). To help distinguish it from nbdkit_absolute_path, improve the
documentation of the latter.
Apply it where an existing path is required, both in nbdkit itself and
in plugins.
Related to:
2018 Apr 12
4
[nbdkit PATCH v3 0/2] Add nbdkit_realpath
Hi,
this is the v3 of my series for nbdkit_realpath; this series adds an
extra documentation update to nbdkit_absolute_path, documenting when it
can only be used, and then adds nbdkit_realpath.
Thanks,
Pino Toscano (2):
docs: improve documentation of nbdkit_absolute_path
plugin: add and use nbdkit_realpath
docs/nbdkit-plugin.pod | 24 +++++++++++++++++++++++-
include/nbdkit-common.h
2018 Feb 21
2
Re: [nbdkit PATCH v2] plugin: add and use nbdkit_realpath
On Wednesday, 14 February 2018 18:06:10 CET Eric Blake wrote:
> On 02/14/2018 10:53 AM, Pino Toscano wrote:
> > Introduce a new helper function to resolve a path name, calling
> > nbdkit_error on failure: other than doing what nbdkit_absolute_path
> > does, it also checks that the file exists (and thus avoids errors later
> > on). To help distinguish it from
2018 Feb 14
0
Re: [nbdkit PATCH v2] plugin: add and use nbdkit_realpath
On 02/14/2018 10:53 AM, Pino Toscano wrote:
> Introduce a new helper function to resolve a path name, calling
> nbdkit_error on failure: other than doing what nbdkit_absolute_path
> does, it also checks that the file exists (and thus avoids errors later
> on). To help distinguish it from nbdkit_absolute_path, improve the
> documentation of the latter.
>
> Apply it where an
2018 Feb 21
0
Re: [nbdkit PATCH v2] plugin: add and use nbdkit_realpath
On 02/21/2018 11:13 AM, Pino Toscano wrote:
> On Wednesday, 14 February 2018 18:06:10 CET Eric Blake wrote:
>> On 02/14/2018 10:53 AM, Pino Toscano wrote:
>>> Introduce a new helper function to resolve a path name, calling
>>> nbdkit_error on failure: other than doing what nbdkit_absolute_path
>>> does, it also checks that the file exists (and thus avoids errors
2020 Aug 07
1
Re: [nbdkit PATCH 2/4] file: Add .list_exports support
On Thu, Aug 06, 2020 at 09:23:46PM -0500, Eric Blake wrote:
> + if (!filename == !directory) {
A bit tricksy. In plugins/nbd/nbd.c I used:
int c = !!sockname + !!hostname + !!uri +
(command.size > 0) + (socket_fd >= 0) + !!raw_cid;
/* Check the user passed exactly one connection parameter. */
if (c > 1) {
nbdkit_error ("cannot mix Unix ‘socket’, TCP
2020 Apr 15
0
[PATCH nbdkit 2/9] floppy, iso, split, ssh: Use new vector type to store lists of strings.
These plugins have in common that they store either a list of
allocated strings or a list of constant strings. Define either
string_vector or const_string_vector as appropriate and use it to
store these lists.
---
plugins/iso/Makefile.am | 1 +
plugins/split/Makefile.am | 1 +
plugins/floppy/virtual-floppy.h | 7 +++--
plugins/floppy/directory-lfn.c | 35 +++++++++-------------
2019 Sep 23
2
Re: [PATCH nbdkit] server: public: Add nbdkit_parse_* functions for safely parsing integers.
On Mon, Sep 23, 2019 at 12:05:11PM -0500, Eric Blake wrote:
> > + int nbdkit_parse_long (const char *what, const char *str, long *r);
> > + int nbdkit_parse_unsigned_long (const char *what,
> > + const char *str, unsigned long *r);
>
> Do we really want to encourage the use of parse_long and
> parse_unsigned_long? Those differ between
2019 Sep 21
2
[PATCH nbdkit] server: public: Add nbdkit_parse_* functions for safely parsing integers.
sscanf is sadly not safe (because it doesn't handle integer overflow
correctly), and strto*l functions are a pain to use correctly.
Therefore add some functions to hide the pain of parsing integers from
the command line.
The simpler uses of sscanf and strto*l are replaced. There are still
a few where we are using advanced features of sscanf.
---
docs/nbdkit-plugin.pod | 48
2018 Feb 14
0
Re: [nbdkit PATCH] plugin: add and use nbdkit_realpath
On 02/13/2018 09:44 AM, Pino Toscano wrote:
> Introduce a new helper function to resolve a path name, calling
> nbdkit_error on failure: other than doing what nbdkit_absolute_path
> does, it also checks that the file exist (and thus avoid errors later
s/exist/exists/
s/avoid/avoids/
> on).
>
> Apply it where an existing path is required, both in nbdkit itself and
> in
2020 Feb 17
5
[nbdkit PATCH v5 0/4] vddk: Drive library loading from libdir parameter.
Differences from v4:
Patch 1 is simplified: I realized that since we already use -rdynamic
for nbdkit (after all, we WANT our dlopen()d plugins to be able to
call our nbdkit_* exports), it is only a matter of adding dlopen to
the set of symbols that we export. With that done, there is no
separate shared library needed; our dlopen shim is now part of nbdkit
proper, and we don't have to tweak
2019 Jan 01
3
[PATCH nbdkit] include: Annotate function parameters with attribute((nonnull)).
Should we use attribute((nonnull)) at all? There's a very interesting
history of this in libvirt -- try looking at commit eefb881 plus the
commits referencing eefb881 -- but it does seem to work for me using
recent GCC and Clang.
I only did a few functions because annotating them gets old quickly...
Rich.
2020 Sep 01
1
Re: [nbdkit PATCH v2 4/8] api: Add nbdkit_str[n]dup_intern helper
On Wed, Aug 26, 2020 at 09:16:48PM -0500, Eric Blake wrote:
> Implementing .default_export with its 'const char *' return is tricky
> in the sh plugin: we must return dynamic memory, but must avoid a
> use-after-free. And we don't want to change the return type of
> .default_export to 'char *', because that would make our choice of
> malloc()/free() part of the
2018 Oct 30
2
Re: [PATCH nbdkit 4/4] Add floppy plugin.
On 10/28/18 5:13 AM, Richard W.M. Jones wrote:
> Create a virtual FAT-formatted floppy disk from a directory of files.
>
> For example:
>
> nbdkit floppy /path/to/directory
>
> The implementation of this is quite different from nbdkit-iso-plugin
> since we cannot use an external program. Instead this plugin
> synthesizes the MBR partition and FAT32 structures that
2019 Sep 23
2
[PATCH nbdkit v2] server: public: Add nbdkit_parse_* functions for safely parsing integers.
On Mon, Sep 23, 2019 at 01:23:28PM -0500, Eric Blake wrote:
> > Hopefully it will warn us if uid_t stops being int. (Also
> > we're assuming pid_t == int).
>
> 64-bit mingw has had a long-standing bug that pid_t was declared as
> 64-bit, even though getpid() returns a 32-bit 'int'; I wish they'd fix
> their headers, but it violates the assumption of pid_t
2020 Feb 16
6
[nbdkit PATCH v4 0/4] vddk: Drive library loading from libdir parameter.
I'm a lot happier with this version: no mucking with dlmopen(). It
does add a bit more coupling between nbdkit proper and the vddk plugin
(namely, nbdkit now exports a new function that the vddk plugin relies
on), but patch 2 adds testsuite coverage of the new function so we
shouldn't regress.
Patch 1 and 2 are new, patch 3 is unchanged from when Rich posted it
in v2, and patch 4 is
2020 Mar 24
2
Re: nbdkit / mingw support
On 3/24/20 3:12 PM, Eric Blake wrote:
>> (For non-mingw platforms) this breaks the source API promises rather
>> seriously, so if I understand your proposal correctly I don't think
>> this is a good idea. It's possibly something we can consider for
>> internal plugins, or for the V3 API.
>
> How does it break API to request that someone link against a
2020 Mar 26
9
[PATCH nbdkit 5/9 patch split 1/5] Create libnbdkit.so.
This is the previous 5/9 patch posted earlier today, split into
reviewable chunks. This passes bisection with -x 'make && make
check', but I didn't work very hard on the commit messages, so I refer
you back to the original patch to explain how it works:
https://www.redhat.com/archives/libguestfs/2020-March/msg00248.html
Rich.
2020 Mar 26
0
[PATCH nbdkit 5/9 patch split 2/5] lib: Move code for parsing, passwords and paths into libnbdkit.so.
---
lib/Makefile.am | 27 ++
server/Makefile.am | 24 --
server/nbdkit.syms | 28 +--
server/public.c | 459 +---------------------------------
{server => lib}/extents.c | 4 +-
lib/parse.c | 341 +++++++++++++++++++++++++
lib/password.c | 152 +++++++++++
lib/path.c | 97 +++++++
2017 Nov 14
0
[nbdkit PATCH v2 1/2] nbd: Add new nbd forwarding plugin
This is a minimal implementation of an NBD forwarder; it lets us
convert between old and newstyle connections (great if a client
expects one style but the real server only provides the other),
or add TLS safety on top of a server without having to rewrite
that server. Right now, the real server is expected to live
on a named Unix socket with no encryption, and the transactions
are serialized