Displaying 20 results from an estimated 24 matches for "nr_socks".
Did you mean:
nr_blocks
2019 Nov 04
3
[PATCH nbdkit 0/3] server: Fix crash on close.
...:
#0 0x00007f12b8783a1f in __GI___poll (fds=0x55771f18c550, nfds=nfds at entry=2, timeout=timeout at entry=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1 0x00005577156b9646 in poll (__timeout=-1, __nfds=2, __fds=<optimized out>) at /usr/include/bits/poll2.h:46
#2 check_sockets_and_quit_fd (nr_socks=1, socks=0x55771f18c2e0) at sockets.c:466
#3 accept_incoming_connections (socks=0x55771f18c2e0, nr_socks=1) at sockets.c:494
#4 0x00005577156ac6ac in start_serving () at main.c:914
#5 main (argc=<optimized out>, argv=0x7ffd0bcb15d8) at main.c:685
Thread 1 (Thread 0x7f12b820e700 (LWP 23146...
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 Oct 18
0
[PATCH nbdkit] Add support for AF_VSOCK.
...+454,8 @@ extern int *bind_unix_socket (size_t *)
__attribute__((__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>
#incl...
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 Sep 05
2
[PATCH nbdkit] Ban use of stack Variable Length Arrays (VLAs).
...pdir) >= 0)
+ system (cmd);
free (script);
}
diff --git a/server/sockets.c b/server/sockets.c
index 26d65c6..dfaa3ea 100644
--- a/server/sockets.c
+++ b/server/sockets.c
@@ -366,10 +366,16 @@ accept_connection (int listen_sock)
static void
check_sockets_and_quit_fd (int *socks, size_t nr_socks)
{
- struct pollfd fds[nr_socks + 1];
size_t i;
int r;
+ CLEANUP_FREE struct pollfd *fds =
+ malloc (sizeof (struct pollfd) * (nr_socks+1));
+ if (fds == NULL) {
+ perror ("malloc");
+ exit (EXIT_FAILURE);
+ }
+
for (i = 0; i < nr_socks; ++i) {
fds[i].fd =...
2017 Jan 31
0
[PATCH nbdkit] Add support for socket activation.
...;%s: cannot use socket activation with -U flag\n",
+ program_name);
+ exit (EXIT_FAILURE);
+ }
if (strcmp (optarg, "-") == 0)
unixsocket = make_random_fifo ();
else
@@ -454,6 +486,7 @@ start_serving (void)
{
int *socks;
size_t nr_socks;
+ size_t i;
/* If the user has mixed up -p/-U/-s options, then give an error.
*
@@ -470,6 +503,27 @@ start_serving (void)
set_up_signals ();
+ /* Socket activation -- we are handling connections on pre-opened
+ * file descriptors [FIRST_SOCKET_ACTIVATION_FD ..
+ * FIRST_SOCKE...
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.
2019 Oct 18
2
Re: [PATCH nbdkit] Add support for AF_VSOCK.
...ng requires a guest.
> +If you see the error C<unable to open vhost-vsock device> then you may
> +have to unload the VMCI transport:
> +
> + modprobe -r vmw_vsock_vmci_transport
Is that in the host or in the guest?
> @@ -826,15 +842,22 @@ start_serving (void)
> size_t nr_socks;
> size_t i;
>
> - /* If the user has mixed up -p/-U/-s options, then give an error.
> + /* If the user has mixed up -p/--run/-s/-U/--vsock options, then
> + * give an error.
> *
> * XXX Actually the server could easily be extended to handle both
>...
2019 Sep 05
0
Re: [PATCH nbdkit] Ban use of stack Variable Length Arrays (VLAs).
...eating $TMPDIR/nbdkitshXXXXXX instead of
/tmp/nbdkitshXXXXXX), then we'd need shell quoting here. But doesn't
change this patch.
> +++ b/server/sockets.c
> @@ -366,10 +366,16 @@ accept_connection (int listen_sock)
> static void
> check_sockets_and_quit_fd (int *socks, size_t nr_socks)
> {
> - struct pollfd fds[nr_socks + 1];
> size_t i;
> int r;
>
> + CLEANUP_FREE struct pollfd *fds =
> + malloc (sizeof (struct pollfd) * (nr_socks+1));
This is indeed safer, but adds a malloc() in a loop. Thankfully, the
loop of accept_incoming_connections()...
2019 Oct 11
0
[PATCH NOT WORKING nbdkit v2 1/2] server: Add .ready_to_serve plugin method.
...readonly);
int (*prepare) (struct backend *, struct connection *conn, void *handle,
int readonly);
diff --git a/server/main.c b/server/main.c
index 5623149..935d422 100644
--- a/server/main.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...
2020 Mar 19
2
Re: Anyone seen build hangs (esp armv7, s390x) in Fedora?
...) from /lib64/libpthread.so.0
#7 0x00007fabc05cc063 in clone () from /lib64/libc.so.6
Thread 1 (Thread 0x7fabc002ca40 (LWP 3955770)):
#0 0x00007fabc06a3b02 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x00005583f90d6dbf in accept_incoming_connections (socks=0x5584020bf010, nr_socks=1) at sockets.c:501
#2 0x00005583f90ca441 in start_serving () at main.c:936
#3 main (argc=<optimized out>, argv=<optimized out>) at main.c:702
The stack trace of [1] at the hang is:
Thread 2 (Thread 0x7f30ac822700 (LWP 3955798)):
#0 0x00007f30b32a384c in recv () from /lib64/libpthr...
2017 Nov 20
10
[nbdkit PATCH v2 0/8] Support parallel transactions within single connection
I've posted some of these patches or ideas before; but now I'm
confident enough with the series that it should be ready to push;
at any rate, I can now run test-socket-activation in a tight loop
without triggering any crashes or hangs.
With this in place, I'm going back to work on making the nbd
forwarder wort with the parallel thread model.
Eric Blake (8):
sockets: Use
2019 Jan 02
0
[PATCH nbdkit v2 1/2] Annotate internal function parameters with attribute((nonnull)).
...est (struct connection *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)
+...
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
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 Sep 18
1
[PATCH nbdkit] server: Remove useless thread local sockaddr.
..._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_instance_num (data->instance_num)...
2019 Sep 15
2
[PATCH nbdkit v2] common/bitmap: Don't fail on realloc (ptr, 0)
v1 was here:
https://www.redhat.com/archives/libguestfs/2019-September/msg00100.html
In v2 I've changed the patch so it avoids calling realloc at all in
this case.
The patch is a bit longer this way. But I don't see any other
alternative if we are to avoid having a "realloc wrapper" of some kind
that we use everywhere, which I guess we should avoid because it makes
plugins
2020 Aug 18
15
[PATCH nbdkit 0/9] Port to Windows.
Also available here:
https://github.com/rwmjones/nbdkit/tree/2020-windows-mingw
This is the port to Windows using native Windows APIs (not MSYS or
Cygwin).
This patch series is at the point where it basically now works. I can
run the server with the memory plugin, and access it remotely using
guestfish, creating filesystems and so on without any apparent
problems.
Nevertheless there are many
2020 Feb 22
2
Re: Plans for nbdkit 1.18 release?
Eric:
Did you want to take this one any further? It might be one that we
save for > 1.18:
https://www.redhat.com/archives/libguestfs/2020-February/thread.html#00206
Another thing I've been thinking about for some time is splitting
.config_complete into .config_complete + .get_ready (new name TBD).
At the moment .config_complete is both the place where we finish
processing config, and
2019 Nov 04
3
[PATCH nbdkit v2 0/2] Implement fuzzing using Clang's libFuzzer.
v1 was here:
https://www.redhat.com/archives/libguestfs/2019-November/msg00003.html
This version depends on:
https://www.redhat.com/archives/libguestfs/2019-November/msg00004.html
and this series:
https://www.redhat.com/archives/libguestfs/2019-November/msg00009.html
The delta has been reduced slightly because of changes made possible
by cleaning up and fixing the quit path in nbdkit. It's