search for: connect_tcp

Displaying 20 results from an estimated 29 matches for "connect_tcp".

2019 Oct 18
0
[PATCH libnbd 2/2] api: Add support for AF_VSOCK.
...bdfuse.pod @@ -19,6 +19,8 @@ Other modes: nbdfuse MOUNTPOINT[/FILENAME] --unix SOCKET + nbdfuse MOUNTPOINT[/FILENAME] --vsock CID PORT + =head1 DESCRIPTION nbdfuse presents a Network Block Device as a local file inside a FUSE @@ -230,6 +232,11 @@ unencrypted TCP socket. See also L<nbd_connect_tcp(3)>. Select Unix mode. Connect to an NBD server on a Unix domain socket. See also L<nbd_connect_unix(3)>. +=item B<--vsock> CID PORT + +Select vsock mode. Connect to an NBD server on a C<AF_VSOCK> socket. +See also L<nbd_connect_vsock(3)>. + =back =head1 NOTES @...
2019 Sep 12
2
[PATCH libnbd 1/2] nbd_connect_tcp: Try to return errno from underlying connect(2) call.
When we make a TCP connection we have to make multiple underlying connect(2) calls, once for each address returned by getaddrinfo. Unfortunately this meant that we lost the errno from any of these calls: $ nbdsh -c 'h.connect_tcp ("localhost", "nbd")' nbd.Error: nbd_connect_tcp: connect: localhost:nbd: could not connect to remote host This commit saves the errno from the first failed connect(2): $ ./run nbdsh -c 'h.connect_tcp ("localhost", "nbd")' nbd.Error: nbd_connect...
2019 Jun 04
2
Re: [PATCH libnbd v2 3/4] api: Implement concurrent writer.
...thought about. Let's see if I can remember them all ... (1) This I experienced: nbd_aio_get_fd deadlocks if there are concurrent synchronous APIs going on. A typical case is where you set up the concurrent writer thread before connecting, and then call a synchronous connect function such as connect_tcp. The synchronous function grabs h->lock, then writes something, which eventually invokes the writer thread which calls nbd_aio_get_fd and deadlocks on h->lock. -> Probably the writer thread should be forbidden from using nbd_handle. (2) The writer thread calls nbd_aio_get_fd, but the fd...
2019 Oct 18
5
[PATCH libnbd 0/2] api: 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
2023 Jan 31
1
[libnbd PATCH v2 3/3] nbdsh: Improve --help and initial banner contents.
...the error when it breaks? $ rpm -qf /usr/bin/nbdsh python3-libnbd-1.15.9-2.fc38.x86_64 $ nbdsh Welcome to nbdsh, the shell for interacting with Network Block Device (NBD) servers. The ?nbd? module has already been imported and there is an open NBD handle called ?h? in state 'START'. h.connect_tcp("remote", "10809") # Connect to a remote server. h.get_size() # Get size of the remote disk. buf = h.pread(512, 0) # Read the first sector. exit() or Ctrl-D # Quit the shell help(nbd) # Display docum...
2023 Jan 31
1
[libnbd PATCH v2 3/3] nbdsh: Improve --help and initial banner contents.
...; python3-libnbd-1.15.9-2.fc38.x86_64 > > $ nbdsh > > Welcome to nbdsh, the shell for interacting with > Network Block Device (NBD) servers. > > The ?nbd? module has already been imported and there > is an open NBD handle called ?h? in state 'START'. > > h.connect_tcp("remote", "10809") # Connect to a remote server. > h.get_size() # Get size of the remote disk. > buf = h.pread(512, 0) # Read the first sector. > exit() or Ctrl-D # Quit the shell > help(nbd)...
2019 Jun 17
2
[nbdkit PATCH] extents: Cap maximum reply length
...the bug. For a full 9M # query, this produces ~100M for nbdkit to parse, and in turn tries to # produce a 72M reply chunk if we don't cap extents. for ((i=$4;i<$4+$3;i++)); do echo $i 1 $((i&1)) done ;; *) exit 2 ;; esac EOF $ ~/libnbd/run sh/nbdsh ... nbd> h.connect_tcp("localhost","10809") nbd> def f(data,metacontext,offset,e): ... print ("entries:%d" % len(e)) ... nbd> h.block_status(9*1024*1024,0,0,f) Traceback (most recent call last): File "/usr/lib64/python3.7/code.py", line 90, in runcode exec(code, self.l...
2019 Jun 29
1
Re: [libnbd PATCH 2/6] generator: Allow DEAD state actions to run
This wasn't exactly how I imagined it - I thought we'd change the generator so that ‘return -1’ wouldn't stop the state machine, but would save an error indication, keep running the machine until it blocks, then return an error. However this is fine, so ACK. If I was going to improve this patch in some way (and didn't implement the idea above) then: I'd add a new macro for
2019 Sep 26
0
[PATCH libnbd 2/2] api: Implement local command with systemd socket activation.
...rs are escaped. diff --git a/generator/generator b/generator/generator index 3b63665..d0b4d46 100755 --- a/generator/generator +++ b/generator/generator @@ -95,6 +95,7 @@ type external_event = | CmdConnectUnix (* [nbd_aio_connect_unix] *) | CmdConnectTCP (* [nbd_aio_connect_tcp] *) | CmdConnectCommand (* [nbd_aio_connect_command] *) + | CmdConnectSA (* [nbd_aio_connect_socket_activation] *) | CmdIssue (* issuing an NBD command *) type location = string * int (* source location: file, line number *) @@ -168,13 +169,1...
2023 Jan 31
1
[libnbd PATCH v2 3/3] nbdsh: Improve --help and initial banner contents.
On Tue, Jan 31, 2023 at 12:34 AM Richard W.M. Jones <rjones at redhat.com> wrote: > > On Fri, Nov 04, 2022 at 04:18:31PM -0500, Eric Blake wrote: > > Document all options in --help output. If -n is not in use, then > > enhance the banner to print the current state of h, and further tailor > > the advice given on useful next steps to take to mention opt_go when >
2019 May 21
0
[PATCH libnbd] api: Synchronous connect waits til all connections are connected.
If not using multi-conn then obviously the synchronous connection calls ‘nbd_connect_unix’, ‘nbd_connect_tcp’ and ‘nbd_connect_command’ should only return when the (one) connection object is connected. In the multi-conn case it's not very clear what these synchronous calls should do. Previously I had it so that they would return as soon as at least one connection was connected. However this is a pr...
2019 May 22
0
[PATCH libnbd v2 1/6] api: Synchronous connect waits til all connections are connected.
If not using multi-conn then obviously the synchronous connection calls ‘nbd_connect_unix’, ‘nbd_connect_tcp’ and ‘nbd_connect_command’ should only return when the (one) connection object is connected. In the multi-conn case it's not very clear what these synchronous calls should do. Previously I had it so that they would return as soon as at least one connection was connected. However this is a pr...
2019 Sep 05
0
[PATCH libnbd] generator: Move first_version fields to a single table.
...(1, 0); + "set_tls_username", (1, 0); + "get_tls_username", (1, 0); + "set_tls_psk_file", (1, 0); + (*"get_tls_psk_file", (1, 0);*) + "add_meta_context", (1, 0); + "connect_uri", (1, 0); + "connect_unix", (1, 0); + "connect_tcp", (1, 0); + "connect_command", (1, 0); + "is_read_only", (1, 0); + "can_flush", (1, 0); + "can_fua", (1, 0); + "is_rotational", (1, 0); + "can_trim", (1, 0); + "can_zero", (1, 0); + "can_df", (1, 0); + &qu...
2020 Aug 14
0
[libnbd PATCH v2 12/13] wip: api: Give aio_opt_go a completion callback
Squash this into opt_go? into opt_info? Standalone? Testing: why does python not throw an exception: $ ./run nbdsh Welcome to nbdsh, the shell for interacting with Network Block Device (NBD) servers. The ‘nbd’ module has already been imported and there is an open NBD handle called ‘h’. h.connect_tcp ("remote", "10809") # Connect to a remote server. h.get_size () # Get size of the remote disk. buf = h.pread (512, 0, 0) # Read the first sector. exit() or Ctrl-D # Quit the shell help (nbd) # Display...
2019 Sep 30
0
[PATCH libnbd v2 2/2] api: Implement local command with systemd socket activation.
...export-name.c \ diff --git a/generator/generator b/generator/generator index 2fd2907..7a6b980 100755 --- a/generator/generator +++ b/generator/generator @@ -95,6 +95,7 @@ type external_event = | CmdConnectUnix (* [nbd_aio_connect_unix] *) | CmdConnectTCP (* [nbd_aio_connect_tcp] *) | CmdConnectCommand (* [nbd_aio_connect_command] *) + | CmdConnectSA (* [nbd_aio_connect_socket_activation] *) | CmdIssue (* issuing an NBD command *) type location = string * int (* source location: file, line number *) @@ -168,13 +169,1...
2019 Sep 05
3
[PATCH libnbd] generator: Move first_version fields to a single table.
This doesn't include Eric's new APIs, but if you push those then I can rebase this one on top. Rich.
2022 Nov 04
3
[libnbd PATCH v2 0/3] Improve nbdsh -u handling
v1 was here: https://listman.redhat.com/archives/libguestfs/2022-October/030216.html Since then, I've incorporated changes based on Rich's feedback: swap order of patches 2 and 3 less change in patch 1 (including no unsafe eval(%s) for --uri) in patch 2, include -c in list of snippets to store, and use dict of lambdas to map back to the desired action Eric Blake (3): nbdsh:
2023 Mar 23
1
[libnbd PATCH v3 14/19] CONNECT_COMMAND.START: plug child process leak on error
...ator/states-connect.c | 48 +++++++++++--------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/generator/states-connect.c b/generator/states-connect.c index 0fe44f6d44d5..4dce7e01f457 100644 --- a/generator/states-connect.c +++ b/generator/states-connect.c @@ -239,103 +239,109 @@ CONNECT_TCP.NEXT_ADDRESS: CONNECT_COMMAND.START: enum state next; + bool parentfd_transferred; int sv[2]; - pid_t pid; int flags; struct socket *sock; + pid_t pid; assert (!h->sock); assert (h->argv.ptr); assert (h->argv.ptr[0]); next = %.DEAD; + parentfd_transferre...
2019 May 28
6
[RFC libnbd PATCH 0/4] Add CMD_FLAG_DF support
RFC because this is an API break, but we haven't declared stable API yet. If we like it, I'm working on using libnbd to implement the nbdkit-nbd plugin; knowing whether it is API version 0.1 or 0.2 will be useful. I also dabbled with allowing optional parameters in python, although my OCaml is weak enough that there may be cleaner ways to approach that. Eric Blake (4): api: Add flags
2019 May 21
2
[PATCH libnbd] api: Synchronous connect waits til all connections are connected.
nbd_connect_unix|tcp had a tricky failure case. This is a consequence of allowing callers to mix synchronous and asynchronous calls, with multi-conn thrown into the mix. I think the new behaviour proposed here is better. We could do with a better way of classifying the state of connections, such as are they connectING. Rich.