Displaying 20 results from an estimated 72 matches for "nbd_connect_command".
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 connection was connected. However this is a
>...
2019 Aug 15
2
Re: [PATCH libnbd v2 10/10] generator: Check requirements for BytesPersistIn/Out and completion callbacks.
...y one.
> + * And it must have an OClosure completion optarg.
> + *)
I like it. Other than the unintended semantic change in patch 4, I
think this series is ready to go.
We still had another potential API change to squeeze into 0.9.8:
Right now, the API is overloading 'command':
nbd_connect_command/nbd_kill_command
vs.
nbd_aio_command_completed/nbd_aio_peek_command_completed
Keeping nbd_connect_command may be okay (it takes a command line to
create a subprocess), but we may want to rename nbd_kill_command to
nbd_kill_child or similar, to make it obvious that it is NOT associated
with attempt...
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.
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 connection was connected. However this is a
>...
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
> > soon as at least one connection was connecte...
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
problem if you are using the...
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
problem if you are using the...
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 Jun 28
3
[libnbd PATCH] tests: Enhance errors test
...(nbd_poll (nbd, 1000) != -1) {
+ fprintf (stderr, "%s: test failed: "
+ "nbd_poll did not fail prior to connection\n",
+ argv[0]);
+ }
+ check (EINVAL, "nbd_poll: ");
+
+ /* Connect to a working server, then try to connect again. */
+ if (nbd_connect_command (nbd, (char **) cmd) == -1) {
+ fprintf (stderr, "%s: %s\n", argv[0], nbd_get_error ());
+ exit (EXIT_FAILURE);
+ }
+ if (nbd_connect_command (nbd, (char **) cmd) != -1) {
+ fprintf (stderr, "%s: test failed: "
+ "nbd_connect_command did not reject re...
2019 Aug 15
0
Re: [PATCH libnbd v2 10/10] generator: Check requirements for BytesPersistIn/Out and completion callbacks.
On Thu, Aug 15, 2019 at 07:01:49AM -0500, Eric Blake wrote:
> We still had another potential API change to squeeze into 0.9.8:
> Right now, the API is overloading 'command':
> nbd_connect_command/nbd_kill_command
> vs.
> nbd_aio_command_completed/nbd_aio_peek_command_completed
>
> Keeping nbd_connect_command may be okay (it takes a command line to
> create a subprocess), but we may want to rename nbd_kill_command to
> nbd_kill_child or similar, to make it obvious that it...
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 Jul 25
4
[PATCH libnbd] api: New nbd_kill_command API for sending a signal to the command subprocess.
..."kill_command", {
+ default_call with
+ args = [ Int "signal" ]; ret = RErr;
+ shortdesc = "kill server running as a subprocess";
+ longdesc = "\
+This call may be used to kill the server running as a subprocess
+that was previously created using C<nbd_connect_command>. You
+do not need to use this call. It is only needed if the server
+does not exit when the socket is closed.
+
+The C<signal> flag is the optional signal number to send
+(see L<signal(7)>). If signal is C<0> then C<SIGTERM> is sent.";
+ };
+
"supports_t...
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.
2020 Aug 14
0
[libnbd PATCH v2 06/13] api: Add nbd_opt_abort and nbd_aio_opt_abort
...pace
- * Copyright (C) 2013-2019 Red Hat Inc.
+ * Copyright (C) 2013-2020 Red Hat Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -178,6 +178,15 @@ main (int argc, char *argv[])
}
check (EINVAL, "nbd_connect_command: ");
+ /* nbd_opt_abort can only be called during negotiation. */
+ if (nbd_opt_abort (nbd) != -1) {
+ fprintf (stderr, "%s: test failed: "
+ "nbd_opt_abort did not reject attempt in wrong state\n",
+ argv[0]);
+ exit (EXIT_FAILURE);
+ }
+...
2019 Jun 03
0
[PATCH libnbd discussion only 1/5] docs: Document NBD URI support.
...meter — can
also accept a single NBD connection on stdin/stdout. You can run
these servers as a subprocess of your main program. This example
@@ -237,6 +239,23 @@ as the libnbd handle is closed:
char *argv[] = { "nbdkit", "-s", "memory", "1G", NULL };
nbd_connect_command (nbd, argv);
+=head2 Connecting to a URI
+
+libnbd supports the NBD URI specification.
+
+This specification is currently evolving, and discussion about it can
+be found on the L<NBD mailing list|https://lists.debian.org/nbd/>. A
+final link to the specification will be added to this docum...
2019 Jul 25
0
Re: [PATCH libnbd] api: New nbd_kill_command API for sending a signal to the command subprocess.
...gt; + default_call with
> + args = [ Int "signal" ]; ret = RErr;
> + shortdesc = "kill server running as a subprocess";
> + longdesc = "\
> +This call may be used to kill the server running as a subprocess
> +that was previously created using C<nbd_connect_command>. You
> +do not need to use this call. It is only needed if the server
> +does not exit when the socket is closed.
> +
> +The C<signal> flag is the optional signal number to send
> +(see L<signal(7)>). If signal is C<0> then C<SIGTERM> is sent.";
[...
2019 Jul 25
4
Re: [PATCH libnbd v3 1/2] lib: Implement closure lifetimes.
...tement). Testing for >0 is sufficient, testing for a
specific value would be fragile as we may add or remove debug calls in
future refactorings.
> +
> + /* Test command callbacks are freed when the command is retired. */
> + nbd = nbd_create ();
> + assert (nbd);
> + assert (nbd_connect_command (nbd, nbdkit) == 0);
Side effects in an assert. Nasty. (Maybe you can get away with it if we
explicitly #undef NDEBUG at the top of this file, so the test still
works if someone does ./configure CFLAGS=-DNDEBUG, but splitting the
side effects from the test validation seems wise)
> +
> + co...
2019 Oct 01
0
Re: [PATCH libnbd v2 2/2] api: Implement local command with systemd socket activation.
...(in
future) always returns true.
> >+ if (h->argv)
> >+ nbd_internal_free_string_list (h->argv);
>
> How can h->argv ever be previously set?
Probably not right now, but it might happen if we ever implement error
recovery for either nbd_connect_socket_activation or
nbd_connect_command. At the moment these functions move the handle to
the DEAD state if they fail, but that's not really necessary in all
cases.
> >--- a/lib/handle.c
> >+++ b/lib/handle.c
> >@@ -129,6 +129,16 @@ nbd_close (struct nbd_handle *h)
> > free_cmd_list (h->cmds_in_flight)...
2020 Aug 19
0
[libnbd PATCH 2/2] info: Use nbd_opt_info for fewer handles during --list
...rly shut down the session (calling gnutls_bye).
Performance: Chart it over various buffer sizes and threads, as that
@@ -71,12 +67,3 @@ Suggested API improvements:
maybe nbd_shutdown should wait for the subprocess or there
should be another API to do this
- capture error message when nbd_connect_command fails
-
- list exports
- - It should be possible to get details from each export without
- needing to reconnect. This would make nbdinfo --list much more
- efficient. This involves issuing an NBD_OPT_INFO request per
- export (but only in list mode). See how qemu-nbd -L is
- implem...
2019 Sep 30
0
[PATCH libnbd v2 1/2] lib: Don't use perror after fork in nbd_connect_callback.
...ODO
index 6c03736..2f23a34 100644
--- a/TODO
+++ b/TODO
@@ -57,3 +57,4 @@ Suggested API improvements:
- it should be possible to use nbd_close and never block, so
maybe nbd_shutdown should wait for the subprocess or there
should be another API to do this
+ - capture error message when nbd_connect_command fails
diff --git a/configure.ac b/configure.ac
index 6296ccf..35a4fed 100644
--- a/configure.ac
+++ b/configure.ac
@@ -77,6 +77,16 @@ AC_CHECK_HEADERS([\
stdatomic.h \
sys/endian.h])
+dnl Check for sys_errlist (optional).
+AC_MSG_CHECKING([for sys_errlist])
+AC_TRY_LINK([], [extern int...