Displaying 20 results from an estimated 3000 matches similar to: "[PATCH nbdkit] server: public: Add nbdkit_parse_* functions for safely parsing integers."
2019 Sep 23
0
Re: [PATCH nbdkit] server: public: Add nbdkit_parse_* functions for safely parsing integers.
On 9/21/19 6:56 AM, Richard W.M. Jones wrote:
> 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
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 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 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 +++++++
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
15
[PATCH nbdkit 0/9] Create libnbdkit.so
This creates libnbdkit.so as discussed in the following thread:
https://www.redhat.com/archives/libguestfs/2020-March/thread.html#00203
test-delay-shutdown.sh fails for unclear reasons.
This series starts by reverting "tests: Don't strand hung nbdkit
processes" which is because several other tests fail randomly unless I
revert this patch. I didn't investigate this yet so it
2019 Sep 23
0
Re: [PATCH nbdkit] server: public: Add nbdkit_parse_* functions for safely parsing integers.
On 9/23/19 12:52 PM, Richard W.M. Jones wrote:
> 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
2020 Aug 18
0
[PATCH nbdkit 8/9] include: Prefix all exports with NBDKIT_DLLEXPORT.
This is #defined as empty at the moment, but it allows the Windows
port to define this __declspec(dllexport), which is necessary for
symbols to be exported in DLLs.
---
include/nbdkit-common.h | 86 ++++++++++++++++++++++++-----------------
include/nbdkit-filter.h | 42 +++++++++++++-------
include/nbdkit-plugin.h | 6 +--
server/main.c | 2 +
4 files changed, 83 insertions(+), 53
2020 Mar 25
0
Re: nbdkit / mingw support
I think I understand now that libnbdkit.so won't break the ABI for
existing plugins. Does it require that plugins for newer nbdkit use
-lnbdkit (which would be a source API break) or would it still be
possible to compile without this? I guess as long as plugins do not
start using -no-undefined then it would still work, so it wouldn't be
a source API break.
I had a look into how we might
2020 Oct 03
2
[PATCH nbdkit 0/2] ip: Add filtering by process ID, user ID and group ID.
These two commits add new APIs and enhance nbdkit-ip-filter to allow
filtering of Unix domain sockets by the client's PID, UID or GID. eg:
nbdkit -U sock --filter=ip ... allow=uid:`id -u` deny=all
Rich.
2020 Mar 23
0
[PATCH nbdkit 2/3] server: Inject API functions for Windows
From: Yifan Gu <gyf304@gmail.com>
Windows PE DLL needs function indirection, this patch injects API
functions for plugins / filters if on Windows.
Note that nbdkit_peer_name is explicitly disabled due to potential ABI
incompatibilities.
---
server/main.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 73 insertions(+)
diff --git a/server/main.c b/server/main.c
2020 Mar 23
6
[PATCH nbdkit 0/3] msys2 support for review
I pushed a few of the msys2 patches upstream. I changed the way that
$(SHARED_LDFLAGS) works so it's more to my liking, and the others were
pushed unchanged. Three patches remain which I'm posting on the
mailing list for proper review.
Rich.
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 Oct 03
7
[PATCH nbdkit v2 0/3] ip: Add filtering by process ID, user ID and group ID.
This is just a simple update to:
https://www.redhat.com/archives/libguestfs/2020-October/msg00015.html
rebased on top of current nbdkit master because I pushed a few simple
refactorings.
Rich.
2018 Feb 07
3
[nbdkit PATCH v2 0/2] Improve nbdkit_parse_size
Take two, this time split into two patches. I liked Rich's
suggestion of unit-testing src/ files directly in src/, and
automake is a lot happier with this than with my v1 attempt
that tried to compile .c files across directories.
It's still enough of a change that I'm not pushing it right
away.
Eric Blake (2):
build: Add unit-testing of internal files
utils: Revamp
2018 Dec 28
0
[PATCH nbdkit 9/9] cache: Implement cache-max-size and method of reclaiming space from the cache.
The original plan was to have a background thread doing the reclaim.
However that cannot work given the design of filters, because a
background thread cannot access the next_ops struct which is only
available during requests.
Therefore we spread the work over the request threads. Each blk_*
function checks whether there is work to do, and if there is will
reclaim up to two blocks from the cache
[PATCH nbdkit v2 4/4] cache: Implement cache-max-size and method of reclaiming space from the cache.
2019 Jan 01
0
[PATCH nbdkit v2 4/4] cache: Implement cache-max-size and method of reclaiming space from the cache.
The original plan was to have a background thread doing the reclaim.
However that cannot work given the design of filters, because a
background thread cannot access the next_ops struct which is only
available during requests.
Therefore we spread the work over the request threads. Each blk_*
function checks whether there is work to do, and if there is will
reclaim up to two blocks from the cache
2020 Aug 18
2
Re: [PATCH nbdkit 1/9] server: Add libnbdkit.so.
On 8/18/20 8:53 AM, Richard W.M. Jones wrote:
> On Tue, Aug 18, 2020 at 07:48:43AM -0500, Eric Blake wrote:
>>> +extern int nbdkit_main (int argc, char *argv[]);
>>
>> A bit odd to declare this in a .c; but I don't see any existing
>> decent .h to put it in, nor is it worth adding a new one just for
>> this. So it is fine right here.
>
> Yup, better
[PATCH nbdkit v3 2/2] cache: Implement cache-max-size and method of reclaiming space from the cache.
2019 Jan 03
0
[PATCH nbdkit v3 2/2] cache: Implement cache-max-size and method of reclaiming space from the cache.
The original plan was to have a background thread doing the reclaim.
However that cannot work given the design of filters, because a
background thread cannot access the next_ops struct which is only
available during requests.
Therefore we spread the work over the request threads. Each blk_*
function checks whether there is work to do, and if there is will
reclaim up to two blocks from the cache
2020 Mar 23
0
[PATCH nbdkit 1/3] include: Function indirection for PE DLL
From: Yifan Gu <gyf304@gmail.com>
This patch adds in indirection for API functions, as PE DLL loader
does not resolve undefined symbols.
This patch only includes header changes.
---
include/nbdkit-common.h | 133 +++++++++++++++++++++++++++++++++++++++-
include/nbdkit-compat.h | 97 +++++++++++++++++++++++++++++
include/nbdkit-filter.h | 39 ++++++++++++
include/nbdkit-plugin.h | 27