Displaying 11 results from an estimated 11 matches for "free_listening_socket".
Did you mean:
free_listening_sockets
2019 Nov 04
3
[PATCH nbdkit 0/3] server: Fix crash on close.
This fixes the long-standing crash on close when nbdkit exits.
I did try first to fix threads so we're using a proper thread pool,
but that's difficult to implement. So this does the minimal change
needed to fix the crash instead.
There are still two segfaults that happen during running the test
suite. One is deliberately caused (tests/test-captive.sh). The other
appears to be an
2019 Oct 18
0
[PATCH nbdkit] Add support for AF_VSOCK.
...ibute__((__nonnull__ (1)));
extern int *bind_tcpip_socket (size_t *)
__attribute__((__nonnull__ (1)));
+extern int *bind_vsock (size_t *)
+ __attribute__((__nonnull__ (1)));
extern void accept_incoming_connections (int *socks, size_t nr_socks)
__attribute__((__nonnull__ (1)));
extern void free_listening_sockets (int *socks, size_t nr_socks)
diff --git a/server/main.c b/server/main.c
index 5623149..115fa98 100644
--- a/server/main.c
+++ b/server/main.c
@@ -45,6 +45,11 @@
#include <syslog.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/socket.h>
+
+#ifdef HAVE_LINU...
2019 Oct 18
1
[PATCH nbdkit v2] Add support for AF_VSOCK.
v1 was discussed here:
https://www.redhat.com/archives/libguestfs/2019-October/thread.html#00100
v2:
- Bind to VMADDR_CID_ANY (instead of HOST) and update the
documentation accordingly.
- Don't bother with SOCK_CLOEXEC fallback path that can
never be used.
Rich.
2019 Oct 11
0
[PATCH NOT WORKING nbdkit v2 1/2] server: Add .ready_to_serve plugin method.
...ain.c
+++ b/server/main.c
@@ -857,6 +857,7 @@ start_serving (void)
for (i = 0; i < nr_socks; ++i)
socks[i] = FIRST_SOCKET_ACTIVATION_FD + i;
change_user ();
+ backend->ready_to_serve (backend);
write_pidfile ();
accept_incoming_connections (socks, nr_socks);
free_listening_sockets (socks, nr_socks); /* also closes them */
@@ -866,6 +867,7 @@ start_serving (void)
/* Handling a single connection on stdin/stdout. */
if (listen_stdin) {
change_user ();
+ backend->ready_to_serve (backend);
write_pidfile ();
threadlocal_new_server_thread ();
if (ha...
2019 Oct 18
2
[PATCH nbdkit] Add support for AF_VSOCK.
This is a series of patches to libnbd and nbdkit adding AF_VSOCK
support.
On the host side it allows you to start an nbdkit instance which
listens on a virtio-vsock socket:
$ ./nbdkit -fv --vsock memory 1G
...
nbdkit: debug: bound to vsock 2:10809
On the guest side you can then use libnbd to connect to the server:
$ ./run nbdsh -c 'h.connect_vsock(2, 10809)' -c
2019 Sep 18
1
[PATCH nbdkit] server: Remove useless thread local sockaddr.
...get_sockaddr ();*/
extern void threadlocal_set_error (int err);
extern int threadlocal_get_error (void);
extern void *threadlocal_buffer (size_t size);
diff --git a/server/sockets.c b/server/sockets.c
index dfaa3ea..3514c69 100644
--- a/server/sockets.c
+++ b/server/sockets.c
@@ -260,8 +260,6 @@ free_listening_sockets (int *socks, size_t nr_socks)
struct thread_data {
int sock;
size_t instance_num;
- struct sockaddr addr;
- socklen_t addrlen;
};
static void *
@@ -274,7 +272,6 @@ start_thread (void *datav)
/* Set thread-local data. */
threadlocal_new_server_thread ();
threadlocal_set_instan...
2019 Jan 02
0
[PATCH nbdkit v2 1/2] Annotate internal function parameters with attribute((nonnull)).
...conn)
+ __attribute__((__nonnull__ (1)));
extern void lock_unload (void);
extern void unlock_unload (void);
/* sockets.c */
-extern int *bind_unix_socket (size_t *);
-extern int *bind_tcpip_socket (size_t *);
-extern void accept_incoming_connections (int *socks, size_t nr_socks);
-extern void free_listening_sockets (int *socks, size_t nr_socks);
+extern int *bind_unix_socket (size_t *)
+ __attribute__((__nonnull__ (1)));
+extern int *bind_tcpip_socket (size_t *)
+ __attribute__((__nonnull__ (1)));
+extern void accept_incoming_connections (int *socks, size_t nr_socks)
+ __attribute__((__nonnull__ (1)));
+e...
2019 Jan 02
4
[PATCH nbdkit v2 0/2] Use of attribute(()).
v1 was here:
https://www.redhat.com/archives/libguestfs/2019-January/msg00008.html
In v2 I have provided two patches:
The first patch extends attribute((nonnull)) to most internal
functions, but not to the external API.
The second patch uses a macro so that attribute((format)) is only used
in the public API on GCC or Clang. At least in theory these headers
could be used by a C compiler which
2017 Jan 31
0
[PATCH nbdkit] Add support for socket activation.
...* nr_socks);
+ if (socks == NULL) {
+ perror ("malloc");
+ exit (EXIT_FAILURE);
+ }
+ for (i = 0; i < nr_socks; ++i)
+ socks[i] = FIRST_SOCKET_ACTIVATION_FD + i;
+ change_user ();
+ write_pidfile ();
+ accept_incoming_connections (socks, nr_socks);
+ free_listening_sockets (socks, nr_socks); /* also closes them */
+ return;
+ }
+
/* Handling a single connection on stdin/stdout. */
if (listen_stdin) {
change_user ();
@@ -752,3 +806,60 @@ parsegroup (const char *id)
return grp->gr_gid;
}
+
+/* Returns 0 if no socket activation, or the number of...
2019 Oct 11
3
[PATCH NOT WORKING nbdkit v2 0/2] vddk: Restructure plugin to allow greater parallelism.
This is my second attempt at this. The first version (also not
working) was here:
https://www.redhat.com/archives/libguestfs/2019-October/msg00062.html
In part 1/2 I introduce a new .ready_to_serve plugin method which is
called after forking and just before accepting any client connection.
The idea would be that plugins could start background threads here.
However this doesn't work well in
2019 Jan 14
6
[PATCH nbdkit incomplete 0/5] Port to Windows.
This is an incomplete port to Windows. Currently the server compiles
and starts up successfully, but goes into an infinite loop when you
connect to it. Nevertheless I think the approach is ready for
feedback. This being Windows the changes go quite deep.
Rich.