Displaying 20 results from an estimated 37 matches for "nbdkit_parse_unsigned".
2020 Aug 18
1
Re: [PATCH nbdkit 8/9] include: Prefix all exports with NBDKIT_DLLEXPORT.
...e/nbdkit-common.h | 86 ++++++++++++++++++++++++-----------------
> include/nbdkit-filter.h | 42 +++++++++++++-------
> include/nbdkit-plugin.h | 6 +--
> server/main.c | 2 +
> 4 files changed, 83 insertions(+), 53 deletions(-)
ACK.
> +extern NBDKIT_DLLEXPORT int nbdkit_parse_unsigned (const char *what,
> + const char *str,
> + unsigned *r);
This leads to some awkward-looking hanging. Should we reformat
differently, similar to:
extern NBDKIT_DLLEXPORT int
nbdkit_parse_un...
2019 Sep 21
2
[PATCH nbdkit] server: public: Add nbdkit_parse_* functions for safely parsing integers.
...re several functions for parsing numbers. These all deal
+correctly with overflow, out of range and parse errors, and you should
+use them instead of unsafe functions like L<sscanf(3)>, L<atoi(3)> and
+similar.
+
+ int nbdkit_parse_int (const char *what, const char *str, int *r);
+ int nbdkit_parse_unsigned (const char *what,
+ const char *str, unsigned *r);
+ 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);
+ int nbdkit_parse_int16_t (...
2019 Sep 23
2
[PATCH nbdkit v2] server: public: Add nbdkit_parse_* functions for safely parsing integers.
...re several functions for parsing numbers. These all deal
+correctly with overflow, out of range and parse errors, and you should
+use them instead of unsafe functions like L<sscanf(3)>, L<atoi(3)> and
+similar.
+
+ int nbdkit_parse_int (const char *what, const char *str, int *r);
+ int nbdkit_parse_unsigned (const char *what,
+ const char *str, unsigned *r);
+ int nbdkit_parse_int8_t (const char *what,
+ const char *str, int8_t *r);
+ int nbdkit_parse_uint8_t (const char *what,
+ const char *str, uint8_t *r);
+ int nbdkit_pa...
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 32- and 64-bit platforms, at
> which point, it's often better to explici...
2019 Sep 23
0
Re: [PATCH nbdkit] server: public: Add nbdkit_parse_* functions for safely parsing integers.
...ng numbers. These all deal
> +correctly with overflow, out of range and parse errors, and you should
> +use them instead of unsafe functions like L<sscanf(3)>, L<atoi(3)> and
> +similar.
> +
> + int nbdkit_parse_int (const char *what, const char *str, int *r);
> + int nbdkit_parse_unsigned (const char *what,
> + const char *str, unsigned *r);
> + 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 r...
2020 Aug 18
0
[PATCH nbdkit 8/9] include: Prefix all exports with NBDKIT_DLLEXPORT.
...TE_FORMAT_PRINTF (1, 0);
-extern char *nbdkit_absolute_path (const char *path);
-extern int64_t nbdkit_parse_size (const char *str);
-extern int nbdkit_parse_bool (const char *str);
-extern int nbdkit_parse_int (const char *what, const char *str,
- int *r);
-extern int nbdkit_parse_unsigned (const char *what, const char *str,
- unsigned *r);
-extern int nbdkit_parse_int8_t (const char *what, const char *str,
- int8_t *r);
-extern int nbdkit_parse_uint8_t (const char *what, const char *str,
-...
2020 Mar 26
0
[PATCH nbdkit 5/9 patch split 2/5] lib: Move code for parsing, passwords and paths into libnbdkit.so.
...leep;
- nbdkit_parse_bool;
- nbdkit_parse_int8_t;
- nbdkit_parse_int16_t;
- nbdkit_parse_int32_t;
- nbdkit_parse_int64_t;
- nbdkit_parse_int;
- nbdkit_parse_size;
- nbdkit_parse_uint8_t;
- nbdkit_parse_uint16_t;
- nbdkit_parse_uint32_t;
- nbdkit_parse_uint64_t;
- nbdkit_parse_unsigned;
nbdkit_peer_name;
- nbdkit_read_password;
- nbdkit_realpath;
nbdkit_set_error;
nbdkit_shutdown;
nbdkit_vdebug;
nbdkit_verror;
-
+ # -D server.* flags must be visible to nbdkit itself.
nbdkit_debug_*;
# Everything else is hidden.
diff --git a/server/publi...
2020 Mar 23
0
[PATCH nbdkit 2/3] server: Inject API functions for Windows
...;verror = nbdkit_verror;
+ functions->vdebug = nbdkit_vdebug;
+ functions->absolute_path = nbdkit_absolute_path;
+ functions->parse_size = nbdkit_parse_size;
+ functions->parse_bool = nbdkit_parse_bool;
+ functions->parse_int = nbdkit_parse_int;
+ functions->parse_unsigned = nbdkit_parse_unsigned;
+ functions->parse_int8_t = nbdkit_parse_int8_t;
+ functions->parse_uint8_t = nbdkit_parse_uint8_t;
+ functions->parse_int16_t = nbdkit_parse_int16_t;
+ functions->parse_uint16_t = nbdkit_parse_uint16_t;
+ functions->parse_int32_t = nbdkit_parse_int32_t;
+ functions->parse_...
2020 Mar 25
0
Re: nbdkit / mingw support
...st char *str, int8_t *rp)
server/public.c:nbdkit_parse_int16_t (const char *what, const char *str, int16_t *rp)
server/public.c:nbdkit_parse_int32_t (const char *what, const char *str, int32_t *rp)
server/public.c:nbdkit_parse_int64_t (const char *what, const char *str, int64_t *rp)
server/public.c:nbdkit_parse_unsigned (const char *what, const char *str, unsigned *rp)
server/public.c:nbdkit_parse_uint8_t (const char *what, const char *str, uint8_t *rp)
server/public.c:nbdkit_parse_uint16_t (const char *what, const char *str, uint16_t *rp)
server/public.c:nbdkit_parse_uint32_t (const char *what, const char *str, u...
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 06
1
Re: [PATCH nbdkit v2] New filter: limit: Limit number of clients that can connect.
...Client limit (0 = filter is disabled). */
> +static unsigned limit = 1;
> +
> +static int
> +limit_config (nbdkit_next_config *next, nbdkit_backend *nxdata,
> + const char *key, const char *value)
> +{
> + if (strcmp (key, "limit") == 0) {
> + if (nbdkit_parse_unsigned ("limit", value, &limit) == -1)
> + return -1;
> + return 0;
> + }
> +
> + return next (nxdata, key, value);
> +}
> +
> +static void
> +too_many_clients_error (void)
> +{
> + nbdkit_error ("limit: too many clients connected, connection...
2020 Mar 04
2
[PATCH nbdkit v2] New filter: limit: Limit number of clients that can connect.
This is a second version of the limit filter. v1 was posted here:
https://www.redhat.com/archives/libguestfs/2020-March/msg00015.html
I didn't bother to repost the other three patches because they are the
same.
The difference is this version of the filter takes security more
seriously. It shouldn't be possible for malicious clients to connect
more than limit=N times to the plugin now,
2020 Oct 03
0
[PATCH nbdkit v2 1/3] server: Add new APIs for reading the client’s SO_PEERCRED.
...nbdkit_shutdown, (void));
NBDKIT_EXTERN_DECL (const char *, nbdkit_strdup_intern,
diff --git a/server/nbdkit.syms b/server/nbdkit.syms
index 1eb18bb0..3d6b2235 100644
--- a/server/nbdkit.syms
+++ b/server/nbdkit.syms
@@ -67,7 +67,10 @@
nbdkit_parse_uint32_t;
nbdkit_parse_uint64_t;
nbdkit_parse_unsigned;
+ nbdkit_peer_gid;
nbdkit_peer_name;
+ nbdkit_peer_pid;
+ nbdkit_peer_uid;
nbdkit_printf_intern;
nbdkit_read_password;
nbdkit_realpath;
diff --git a/server/public.c b/server/public.c
index 7636a16b..8b7ca437 100644
--- a/server/public.c
+++ b/server/public.c
@@ -47,6 +...
2020 Mar 26
3
Re: [PATCH nbdkit 5/9 patch split 2/5] lib: Move code for parsing, passwords and paths into libnbdkit.so.
...t16_t;
> + nbdkit_parse_int32_t;
> + nbdkit_parse_int64_t;
> + nbdkit_parse_int8_t;
> + nbdkit_parse_int;
> + nbdkit_parse_size;
> + nbdkit_parse_uint16_t;
> + nbdkit_parse_uint32_t;
> + nbdkit_parse_uint64_t;
> + nbdkit_parse_uint8_t;
> + nbdkit_parse_unsigned;
> + nbdkit_read_password;
> + nbdkit_realpath;
Are we brave enough to list nbdkit_*? Or is being explicit on each
symbol still a good idea?
Are we planning on having any nbdkit_debug_* symbols in libnbdkit.so (in
addition to the ones in the nbdkit server proper), in which case tho...
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
2019 Nov 14
1
ANNOUNCE: libnbd 1.2 & nbdkit 1.16 - high performance NBD client and server
...ame" server function for reading the export name
passed by the client.
New "nbdkit_peer_name" server function to return the client address
(like getpeername(2)).
New server functions for safely parsing integers: "nbdkit_parse_int",
"nbdkit_parse_unsigned", "nbdkit_parse_int8_t", "nbdkit_parse_uint8_t",
"nbdkit_parse_int16_t", "nbdkit_parse_uint16_t",
"nbdkit_parse_int32_t", "nbdkit_parse_uint32_t",
"nbdkit_parse_int64_t", "nbdkit_parse_uint64_t"...
2020 Mar 26
0
[PATCH nbdkit 5/9 patch split 5/5] server: Indirect slow path, non-self-contained functions through the server.
...dkit_export_name;
nbdkit_extents_count;
nbdkit_extents_free;
nbdkit_extents_new;
nbdkit_get_extent;
+ nbdkit_nanosleep;
nbdkit_parse_bool;
nbdkit_parse_int16_t;
nbdkit_parse_int32_t;
@@ -58,8 +60,11 @@
nbdkit_parse_uint64_t;
nbdkit_parse_uint8_t;
nbdkit_parse_unsigned;
+ nbdkit_peer_name;
nbdkit_read_password;
nbdkit_realpath;
+ nbdkit_set_error;
+ nbdkit_shutdown;
nbdkit_vdebug;
nbdkit_verror;
--
2.25.0
2020 Aug 06
5
[PATCH nbdkit NOT WORKING 0/2] vddk: Relax threading model.
I believe this roughly implements Nir's proposal here:
https://www.redhat.com/archives/libguestfs/2020-August/msg00028.html
Unfortunately it doesn't work for me. It actually slows things down
quite a lot, for reasons I don't understand. Note the adjustment of
the pool-max parameter and how it affects the total time. The results
are quite reproducible.
$ ./nbdkit -r -U - vddk
2020 Aug 06
0
[PATCH nbdkit 2/2] vddk: Relax thread model to PARALLEL and implement a disk handle pool.
...-link */
static const char *snapshot_moref; /* snapshot */
@@ -233,6 +235,12 @@ vddk_config (const char *key, const char *value)
if (nbdkit_parse_uint16_t ("port", value, &port) == -1)
return -1;
}
+ else if (strcmp (key, "pool-max") == 0) {
+ if (nbdkit_parse_unsigned ("pool-max", value, &pool_max) == -1)
+ return -1;
+ if (pool_max < 1)
+ pool_max = 1;
+ }
else if (strcmp (key, "reexeced_") == 0) {
/* Special name because it is only for internal use. */
reexeced = (char *)value;
@@ -482,20 +490,37 @@ vddk_du...