search for: nbdkit_verror

Displaying 20 results from an estimated 64 matches for "nbdkit_verror".

Did you mean: nbdkit_error
2020 Mar 26
0
[PATCH nbdkit 3/9] server: Add log_verror function.
...*/ extern void log_stderr_verror (const char *fs, va_list args) __attribute__((__format__ (printf, 1, 0))); diff --git a/server/log.c b/server/log.c index 73493563..37de3dd2 100644 --- a/server/log.c +++ b/server/log.c @@ -40,11 +40,11 @@ #include "internal.h" -/* Call the right nbdkit_verror function depending on log_sink. +/* Call the right log_*_verror function depending on log_sink. * Note: preserves the previous value of errno. */ void -nbdkit_verror (const char *fs, va_list args) +log_verror (const char *fs, va_list args) { switch (log_to) { case LOG_TO_DEFAULT: @@ -65...
2020 Mar 23
0
[PATCH nbdkit 1/3] include: Function indirection for PE DLL
...#define NBDKIT_EXTENT_HOLE (1<<0) /* Same as NBD_STATE_HOLE */ #define NBDKIT_EXTENT_ZERO (1<<1) /* Same as NBD_STATE_ZERO */ +#if defined(NBDKIT_INTERNAL) || !defined(WINDOWS_COMPAT) extern void nbdkit_error (const char *msg, ...) ATTRIBUTE_FORMAT_PRINTF (1, 2); extern void nbdkit_verror (const char *msg, va_list args) ATTRIBUTE_FORMAT_PRINTF (1, 0); @@ -113,9 +118,133 @@ extern const char *nbdkit_export_name (void); extern int nbdkit_peer_name (struct sockaddr *addr, socklen_t *addrlen); extern void nbdkit_shutdown (void); -struct nbdkit_extents; extern int nbdkit_add_exte...
2020 Aug 18
0
[PATCH nbdkit 8/9] include: Prefix all exports with NBDKIT_DLLEXPORT.
...UESTS 2 @@ -76,49 +78,63 @@ extern "C" { #define NBDKIT_EXTENT_HOLE (1<<0) /* Same as NBD_STATE_HOLE */ #define NBDKIT_EXTENT_ZERO (1<<1) /* Same as NBD_STATE_ZERO */ -extern void nbdkit_error (const char *msg, ...) ATTRIBUTE_FORMAT_PRINTF (1, 2); -extern void nbdkit_verror (const char *msg, va_list args) +extern NBDKIT_DLLEXPORT void nbdkit_error (const char *msg, ...) + ATTRIBUTE_FORMAT_PRINTF (1, 2); +extern NBDKIT_DLLEXPORT void nbdkit_verror (const char *msg, va_list args) ATTRIBUTE_FORMAT_PRINTF (1, 0); -extern void nbdkit_debug (const char *msg, ...) ATTRIB...
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.
2018 Nov 29
6
[nbdkit PATCH 0/3] Fix %m usage on BSD
Our use of "%m" in various error messages is testament to the project's initial life on Linux - but other than Cygwin, I know of no other platforms supporting that glibc extension. We COULD audit the code and manually turn "%m" into "%s"/strerror(errno), but that's a lot of churn. Instead, let's fix the few outliers that can't be easily wrapped, then
2018 Dec 21
1
[nbdkit PATCH] connections: Don't use uninit memory on early client EOF
...on a message boundary. + */ +static int __attribute__ ((format (printf, 4, 5))) +conn_recv_full (struct connection *conn, void *buf, size_t len, + const char *fmt, ...) +{ + int r = conn->recv (conn, buf, len); + va_list args; + + if (r == -1) { + va_start (args, fmt); + nbdkit_verror (fmt, args); + va_end (args); + return -1; + } + if (r == 0) { + /* During negotiation, client EOF on message boundary is less + * severe than failure in the middle of the buffer. */ + debug ("client closed input socket, closing connection"); + return -1; + } + retu...
2017 Nov 17
0
[nbdkit PATCH 1/4] errors: Avoid interleaved errors from parallel threads
...dkit_debug (const char *fs, ...) if (!verbose) return; + lock (); prologue ("debug"); va_start (args, fs); @@ -95,6 +118,7 @@ nbdkit_debug (const char *fs, ...) va_end (args); fprintf (stderr, "\n"); + unlock (); errno = err; } @@ -105,11 +129,13 @@ nbdkit_verror (const char *fs, va_list args) { int err = errno; + lock (); prologue ("error"); vfprintf (stderr, fs, args); fprintf (stderr, "\n"); + unlock (); errno = err; } @@ -121,6 +147,7 @@ nbdkit_error (const char *fs, ...) va_list args; int err = errno; +...
2019 Jan 02
0
[PATCH nbdkit v2 2/2] include: Only use attribute((format)) on GCC or Clang.
...57,11 +64,9 @@ extern "C" { #define NBDKIT_FUA_EMULATE 1 #define NBDKIT_FUA_NATIVE 2 -extern void nbdkit_error (const char *msg, ...) - __attribute__((__format__ (__printf__, 1, 2))); +extern void nbdkit_error (const char *msg, ...) ATTRIBUTE_FORMAT_PRINTF (1, 2); extern void nbdkit_verror (const char *msg, va_list args); -extern void nbdkit_debug (const char *msg, ...) - __attribute__((__format__ (__printf__, 1, 2))); +extern void nbdkit_debug (const char *msg, ...) ATTRIBUTE_FORMAT_PRINTF (1, 2); extern void nbdkit_vdebug (const char *msg, va_list args); extern char *nbdkit_ab...
2019 Dec 12
0
[PATCH nbdkit 4/7] server: Allow -D nbdkit.* debug flags for the core server.
...ebug_flags (NULL, "nbdkit"); + /* Check all debug flags were used, and free them. */ free_debug_flags (); diff --git a/server/nbdkit.syms b/server/nbdkit.syms index 390972e..96c22c0 100644 --- a/server/nbdkit.syms +++ b/server/nbdkit.syms @@ -67,6 +67,8 @@ nbdkit_vdebug; nbdkit_verror; + nbdkit_debug_*; + # Everything else is hidden. local: *; }; -- 2.23.0
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.
2018 Jan 23
3
[nbdkit PATCH 0/2] Miscellaneous patches
These are relatively independent enough from my ongoing work to add FUA support that I'll post them now. Eric Blake (2): todo: More items include: Properly decorate attributes in public headers TODO | 15 ++++++++++++++- include/nbdkit-common.h | 4 ++-- 2 files changed, 16 insertions(+), 3 deletions(-) -- 2.14.3
2020 Mar 23
0
[PATCH nbdkit 2/3] server: Inject API functions for Windows
...+{ + nbdkit_error ("nbdkit_peer_name not implemented on this platform"); + return -1; +} + +static void init_functions () +{ + functions = malloc (sizeof *functions); + if (functions == NULL) { + perror ("malloc"); + exit (EXIT_FAILURE); + } + functions->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;...
2020 Mar 25
0
Re: nbdkit / mingw support
...server/extents.c:nbdkit_extents_free (struct nbdkit_extents *exts) server/extents.c:nbdkit_extents_count (const struct nbdkit_extents *exts) server/extents.c:nbdkit_get_extent (const struct nbdkit_extents *exts, size_t i) server/extents.c:nbdkit_add_extent (struct nbdkit_extents *exts, server/log.c:nbdkit_verror (const char *fs, va_list args) server/log.c:nbdkit_error (const char *fs, ...) server/log.c:nbdkit_vfprintf(FILE *f, const char *fmt, va_list args) server/plugins.c:nbdkit_set_error (int err) server/public.c:nbdkit_absolute_path (const char *path) server/public.c:nbdkit_realpath (const char *path)...
2020 Mar 26
0
[PATCH nbdkit 2/9] server: Rename replacement vfprintf function.
...og_syslog_verror (const char *fs, va_list args) - __attribute__((__format__ (printf, 1, 0))); /* backend.c */ struct backend { diff --git a/server/log.c b/server/log.c index a801aa2e..73493563 100644 --- a/server/log.c +++ b/server/log.c @@ -77,27 +77,3 @@ nbdkit_error (const char *fs, ...) nbdkit_verror (fs, args); va_end (args); } - -#if !HAVE_VFPRINTF_PERCENT_M -/* Work around lack of %m in BSD */ -#undef vfprintf - -/* Call the real vfprintf after first changing %m into strerror(errno). */ -int -nbdkit_vfprintf(FILE *f, const char *fmt, va_list args) -{ - char *repl = NULL; - char *p = st...
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
2020 Apr 14
0
[nbdkit PATCH v2 1/3] server: Add nbdkit_stdio_safe
...(unsigned sec, unsigned nsec); diff --git a/server/nbdkit.syms b/server/nbdkit.syms index 111223f2..20c390a9 100644 --- a/server/nbdkit.syms +++ b/server/nbdkit.syms @@ -65,6 +65,7 @@ nbdkit_realpath; nbdkit_set_error; nbdkit_shutdown; + nbdkit_stdio_safe; nbdkit_vdebug; nbdkit_verror; diff --git a/server/public.c b/server/public.c index 3fd11253..4bb1f2e0 100644 --- a/server/public.c +++ b/server/public.c @@ -1,5 +1,5 @@ /* nbdkit - * Copyright (C) 2013-2019 Red Hat Inc. + * Copyright (C) 2013-2020 Red Hat Inc. * * Redistribution and use in source and binary forms, with o...
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 Apr 04
0
[nbdkit PATCH 1/2] server: Add nbdkit_stdio_safe
...exit (EXIT_FAILURE); } diff --git a/server/nbdkit.syms b/server/nbdkit.syms index 111223f2..20c390a9 100644 --- a/server/nbdkit.syms +++ b/server/nbdkit.syms @@ -65,6 +65,7 @@ nbdkit_realpath; nbdkit_set_error; nbdkit_shutdown; + nbdkit_stdio_safe; nbdkit_vdebug; nbdkit_verror; diff --git a/server/public.c b/server/public.c index 3fd11253..f19791bc 100644 --- a/server/public.c +++ b/server/public.c @@ -1,5 +1,5 @@ /* nbdkit - * Copyright (C) 2013-2019 Red Hat Inc. + * Copyright (C) 2013-2020 Red Hat Inc. * * Redistribution and use in source and binary forms, with o...
2017 Jan 26
0
[nbdkit PATCH v2 4/6] plugins: Add new nbdkit_set_error() utility function
...ce and binary forms, with or without @@ -82,6 +82,7 @@ struct nbdkit_plugin { /* int (*set_exportname) (void *handle, const char *exportname); */ }; +extern void nbdkit_set_error (int err); extern void nbdkit_error (const char *msg, ...) __attribute__((format (printf, 1, 2))); extern void nbdkit_verror (const char *msg, va_list args); diff --git a/src/connections.c b/src/connections.c index c0f0567..83c863e 100644 --- a/src/connections.c +++ b/src/connections.c @@ -602,6 +602,19 @@ validate_request (struct connection *conn, return 1; /* Commands validates. */ } +/* Grab t...
2020 Mar 26
0
[PATCH nbdkit 5/9 patch split 5/5] server: Indirect slow path, non-self-contained functions through the server.
...&verbose, + do_nbdkit_export_name, + do_nbdkit_nanosleep, + do_nbdkit_peer_name, + do_nbdkit_set_error, + do_nbdkit_shutdown, do_nbdkit_verror, threadlocal_get_name, threadlocal_get_instance_num); diff --git a/server/nbdkit.syms b/server/nbdkit.syms index ea46ac3e..5b665f85 100644 --- a/server/nbdkit.syms +++ b/server/nbdkit.syms @@ -34,11 +34,6 @@ { global: - nbdkit_export_na...