search for: nbd_connect_unix

Displaying 20 results from an estimated 61 matches for "nbd_connect_unix".

2019 May 23
2
Re: [PATCH libnbd v2 1/6] api: Synchronous connect waits til all connections are connected.
On 5/22/19 4:50 AM, Richard W.M. Jones wrote: > 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 con...
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 conn...
2019 May 21
2
Re: [PATCH libnbd] api: Synchronous connect waits til all connections are connected.
On 5/21/19 3:44 PM, Richard W.M. Jones wrote: > 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 con...
2019 Apr 29
3
[nbdkit PATCH 0/2] Let nbd plugin connect to TCP socket
Accepting only Unix sockets can be a bit limiting; let's be more flexible. Eric Blake (2): nbd: Refactor Unix socket connection nbd: Support TCP socket plugins/nbd/nbdkit-nbd-plugin.pod | 36 ++++-- plugins/nbd/nbd.c | 175 ++++++++++++++++++++++-------- TODO | 3 - 3 files changed, 161 insertions(+), 53 deletions(-) -- 2.20.1
2019 Aug 14
3
[libnbd PATCH 0/2] Drop generated file from git
Rich recently patched things to generate one man page per function rather than libnbd-api.3 (nice), but in doing so got stumped by a problem with a fresh git clone (automake fails for any 'include' directive that does not already exist). I've figured out how to hack around it, but the hack requires GNU make. We already use GNU make constructs elsewhere (such as $(wildcard)), but
2019 May 22
0
Re: [PATCH libnbd] api: Synchronous connect waits til all connections are connected.
On Tue, May 21, 2019 at 05:08:05PM -0500, Eric Blake wrote: > On 5/21/19 3:44 PM, Richard W.M. Jones wrote: > > 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 > >...
2019 Apr 29
0
[nbdkit PATCH 2/2] nbd: Support TCP socket
...andle *h) ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&h->trans_lock); if (!h->dead) { nbdkit_debug ("permanent failure while talking to server %s: %m", - sockname); + servname); h->dead = true; } else if (!err) @@ -861,6 +901,45 @@ nbd_connect_unix(struct handle *h) return 0; } +/* Connect to a TCP socket */ +static int +nbd_connect_tcp(struct handle *h) +{ + struct addrinfo hints = { .ai_family = AF_UNSPEC, + .ai_socktype = SOCK_STREAM, }; + struct addrinfo *result, *rp; + int r; + const int optval = 1; +...
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. H...
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. H...
2019 May 22
8
[PATCH libnbd v2 0/6] Test connection states.
Patch 1/6 was posted before and I didn't change it: https://www.redhat.com/archives/libguestfs/2019-May/thread.html#00134 That doesn't necessarily mean I shouldn't change it, I'm posting it again because the other patches depend on it. The main change in this series is we add three new API functions: nbd_aio_is_created - connection has just been created
2019 Oct 01
3
[PATCH libnbd 0/2] Change qemu-nbd interop tests to use socket activation.
Now that we have implemented systemd socket activation, we can use this to run qemu-nbd in tests. The first patch leaves some dead code around (the -DSERVE_OVER_TCP=1 path). It's possible we might want to use this to test against a putative future NBD server that only supports TCP, but on the other hand maybe we should just remove it. Tests & valgrind still pass for me. Rich.
2019 Oct 18
0
[PATCH libnbd 2/2] api: Add support for AF_VSOCK.
...NTPOINT[/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 @@ -294,6 +301,7 @@ L<nbd_connect_socket(3)>, L<nbd_connect_systemd_socket_activation(3)>, L<n...
2019 Jun 04
0
[PATCH libnbd v2 4/4] examples: Add concurrent writer example.
...t to check if the server supports writes and multi-conn. */ + if (argc == 2) { + if (strstr (argv[1], "://")) { + if (nbd_connect_uri (nbd, argv[1]) == -1) { + fprintf (stderr, "%s\n", nbd_get_error ()); + exit (EXIT_FAILURE); + } + } + else if (nbd_connect_unix (nbd, argv[1]) == -1) { + fprintf (stderr, "%s\n", nbd_get_error ()); + exit (EXIT_FAILURE); + } + } + else { + if (nbd_connect_tcp (nbd, argv[1], argv[2]) == -1) { + fprintf (stderr, "%s\n", nbd_get_error ()); + exit (EXIT_FAILURE); + } + } + +...
2019 Jun 05
1
[libnbd PATCH] api: Add nbd_supports_tls
...function may be called regardless of whether TLS is +supported, but will have no effect unless C<nbd_set_tls> +is also used to request or require TLS."; }; (* Can't implement this because we need a way to return string that @@ -1112,7 +1130,9 @@ C<nbd_connect_tcp> or C<nbd_connect_unix>. This call returns when the connection has been made. This call will fail if libnbd was not compiled with libxml2; you can -test whether this is the case with C<nbd_supports_uri>."; +test whether this is the case with C<nbd_supports_uri>. Support for +URIs that require TLS...
2019 Jun 03
0
[PATCH libnbd discussion only 5/5] examples: Add concurrent writer example.
...t to check if the server supports writes and multi-conn. */ + if (argc == 2) { + if (strstr (argv[1], "://")) { + if (nbd_connect_uri (nbd, argv[1]) == -1) { + fprintf (stderr, "%s\n", nbd_get_error ()); + exit (EXIT_FAILURE); + } + } + else if (nbd_connect_unix (nbd, argv[1]) == -1) { + fprintf (stderr, "%s\n", nbd_get_error ()); + exit (EXIT_FAILURE); + } + } + else { + if (nbd_connect_tcp (nbd, argv[1], argv[2]) == -1) { + fprintf (stderr, "%s\n", nbd_get_error ()); + exit (EXIT_FAILURE); + } + } + +...
2019 Aug 14
0
[libnbd PATCH 2/2] docs: Drop docs/Makefile.inc from git
...andle_name \ - nbd_set_export_name \ - nbd_get_export_name \ - nbd_set_tls \ - nbd_get_tls \ - nbd_set_tls_certificates \ - nbd_set_tls_verify_peer \ - nbd_get_tls_verify_peer \ - nbd_set_tls_username \ - nbd_get_tls_username \ - nbd_set_tls_psk_file \ - nbd_add_meta_context \ - nbd_connect_uri \ - nbd_connect_unix \ - nbd_connect_tcp \ - nbd_connect_command \ - nbd_is_read_only \ - nbd_can_flush \ - nbd_can_fua \ - nbd_is_rotational \ - nbd_can_trim \ - nbd_can_zero \ - nbd_can_df \ - nbd_can_multi_conn \ - nbd_can_cache \ - nbd_can_meta_context \ - nbd_get_size \ - nbd_pread \ - nbd_pread_structured \ - nbd...
2020 Jul 20
0
[PATCH libnbd PROPOSAL] Add APIs for listing exports from an NBD server.
...de in the handle. */ + nbd_set_list_exports (nbd, 1); + + /* Connect to the NBD server over a + * Unix domain socket. A side effect of + * connecting is to list the exports. + * This operation can fail normally, so + * we need to check the return value and + * error code. + */ + r = nbd_connect_unix (nbd, argv[1]); + if (r == -1 && nbd_get_errno () == ENOTSUP) { + fprintf (stderr, "%s\n", nbd_get_error ()); + exit (EXIT_FAILURE); + } + + if (nbd_get_nr_list_exports (nbd) == 0) { + fprintf (stderr, "Server does not support " + "listing ex...
2020 Jul 20
2
[PATCH libnbd PROPOSAL] Add APIs for listing exports from an NBD server.
Proposal for new APIs to list exports. The general shape of the API can probably best be seen from the examples/list-exports.c example. Rich.
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
2019 Aug 15
1
[PATCH libnbd] docs: Change docs/Makefile.inc back to a regular include, readd to git.
...andle_name \ + nbd_set_export_name \ + nbd_get_export_name \ + nbd_set_tls \ + nbd_get_tls \ + nbd_set_tls_certificates \ + nbd_set_tls_verify_peer \ + nbd_get_tls_verify_peer \ + nbd_set_tls_username \ + nbd_get_tls_username \ + nbd_set_tls_psk_file \ + nbd_add_meta_context \ + nbd_connect_uri \ + nbd_connect_unix \ + nbd_connect_tcp \ + nbd_connect_command \ + nbd_is_read_only \ + nbd_can_flush \ + nbd_can_fua \ + nbd_is_rotational \ + nbd_can_trim \ + nbd_can_zero \ + nbd_can_df \ + nbd_can_multi_conn \ + nbd_can_cache \ + nbd_can_meta_context \ + nbd_get_size \ + nbd_pread \ + nbd_pread_structured \ + nbd...