search for: prepare_socket_activation_environ

Displaying 17 results from an estimated 17 matches for "prepare_socket_activation_environ".

2023 Jan 30
2
[PATCH libnbd v2 4/4] generator/states-connect-socket-activation.c: Set LISTEN_FDNAMES
...STEN_PID, LISTEN_FDS or LISTEN_FDNAAMES, and + * replaces them with new variables. + * + * env[0] is "LISTEN_PID=..." which is filled in by CONNECT_SA.START + * + * env[1] is "LISTEN_FDS=1" + * + * env[2] (if used) is "LISTEN_FDNAMES=" + h->sa_name */ static int -prepare_socket_activation_environment (string_vector *env) +prepare_socket_activation_environment (struct nbd_handle *h, + string_vector *env) { char *p; size_t i; + const bool using_name = h->sa_name != NULL; assert (env->len == 0); - /* Reserve slots env[0]..env[1] */ -...
2023 Mar 23
20
[libnbd PATCH v3 00/19] pass LISTEN_FDNAMES with systemd socket activation
V3 was here: <http://mid.mail-archive.com/20230215141158.2426855-1-lersek at redhat.com>. See the Notes section on each patch for the v4 updates. The series is nearly ready for merging: every patch has at least one R-b tag, except "socket activation: avoid manipulating the sign bit". The series builds, and passes "make check" and "make check-valgrind", at
2023 Mar 25
4
[libnbd PATCH v5 0/4] pass LISTEN_FDNAMES with systemd socket activation
V4 was here (incorrectly versioned on the mailing list as v3): <http://mid.mail-archive.com/20230323121016.1442655-1-lersek at redhat.com>. See the Notes section on each patch for the v5 updates. Laszlo Ersek (2): socket activation: generalize environment construction socket activation: set LISTEN_FDNAMES Richard W.M. Jones (2): common/include: Copy ascii-ctype functions from nbdkit
2023 Mar 24
2
[libnbd PATCH v3 19/19] socket activation: set LISTEN_FDNAMES
...m_vars, > >> "LISTEN_FDS=", "1", NULL); > >> + if (h->sact_name != NULL) > >> + SACT_VAR_PUSH (sact_var, &num_vars, > >> + "LISTEN_FDNAMES=", h->sact_name, NULL); > >> if (prepare_socket_activation_environment (&env, sact_var, num_vars) == -1) > > > > If I'm reading this correctly, this does wipe an inherited > > LISTEN_FDNAMES from the environment in the case where the application > > linked with libnbd started life with a (different) socket activation, > > but...
2023 Mar 23
1
[libnbd PATCH v3 07/19] socket activation: replace execvp() call with fork-safe variant
...ler as a whole succeeded or not. (The context is only a temporary resource.) Signed-off-by: Laszlo Ersek <lersek at redhat.com> Reviewed-by: Richard W.M. Jones <rjones at redhat.com> --- Notes: v4: - pick up Rich's R-b - resolve rebase conflict near the prepare_socket_activation_environment() call site, due to keeping set_error() internal to that callee, in patch "socket activation: clean up responsibilities of prep.sock.act.env.()" context:-U11 generator/states-connect-socket-activation.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 d...
2023 Jan 28
1
[PATCH libnbd] generator: Pass LISTEN_FDNAMES=nbd with systemd socket activation
...ot;. + * any existing LISTEN_PID, LISTEN_FDS or LISTEN_FDNAMES, and replaces + * them with new variables. + * + * env[0] is "LISTEN_PID=..." which is filled in by CONNECT_SA.START + * + * env[1] is "LISTEN_FDS=1" + * + * env[2] is "LISTEN_FDNAMES=nbd" */ static int prepare_socket_activation_environment (string_vector *env) @@ -53,26 +55,29 @@ prepare_socket_activation_environment (string_vector *env) assert (env->len == 0); - /* Reserve slots env[0] and env[1]. */ + /* Reserve slots env[0]..env[2] */ + if (string_vector_reserve (env, 3) == -1) + goto err; p = strdup ("...
2019 Nov 15
1
Re: [PATCH libnbd v2 2/2] api: Implement local command with systemd socket activation.
...for calling execvp when doing systemd socket * activation. Takes the current environment and copies it. Removes * any existing LISTEN_PID or LISTEN_FDS and replaces them with new * variables. env[0] is "LISTEN_PID=..." which is filled in by @@ -45,7 +47,6 @@ static char ** prepare_socket_activation_environment (void) { - extern char **environ; char **env = NULL; char *p0 = NULL, *p1 = NULL; size_t i, len; @@ -97,7 +98,6 @@ prepare_socket_activation_environment (void) STATE_MACHINE { CONNECT_SA.START: -#ifdef HAVE_EXECVPE int s; struct sockaddr_un addr; char **env; @@...
2023 Jan 31
1
[PATCH libnbd] generator: Pass LISTEN_FDNAMES=nbd with systemd socket activation
...STEN_FDNAMES, and replaces > + * them with new variables. > + * > + * env[0] is "LISTEN_PID=..." which is filled in by CONNECT_SA.START > + * > + * env[1] is "LISTEN_FDS=1" > + * > + * env[2] is "LISTEN_FDNAMES=nbd" > */ > static int > prepare_socket_activation_environment (string_vector *env) > @@ -53,26 +55,29 @@ prepare_socket_activation_environment (string_vector *env) > > assert (env->len == 0); > > - /* Reserve slots env[0] and env[1]. */ > + /* Reserve slots env[0]..env[2] */ > + if (string_vector_reserve (env, 3) == -1) >...
2023 Jan 30
4
[PATCH libnbd v2 0/4] Pass LISTEN_FDNAMES with systemd socket activation
This is an alternative approach to https://listman.redhat.com/archives/libguestfs/2023-January/030535.html After discussing this with Dan Berrange we came to the conclusion that you really might want to set LISTEN_FDNAMES to arbitrary short strings (or not set it). Especially when talking to qemu-storage-daemon which would allow you to use these names on the command line. Rich.
2019 Oct 01
2
Re: [PATCH libnbd v2 2/2] api: Implement local command with systemd socket activation.
...t; + * CONNECT_SA.START, and env[1] is "LISTEN_FDS=1". > + */ I know that getenv()/setenv()/putenv() tend to prefer sorted environ, but I also think that exec HAS to handle a hand-built environ that is not sorted, so you should be okay with this shortcut. > +static char ** > +prepare_socket_activation_environment (void) > +{ > + char **env = NULL; > + char *p0 = NULL, *p1 = NULL; > + size_t i, len; > + void *vp; > + > + p0 = strdup ("LISTEN_PID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); > + if (p0 == NULL) > + goto err; > + p1 = strdup ("LISTEN_FDS=1"...
2023 Jan 31
1
[PATCH libnbd] generator: Pass LISTEN_FDNAMES=nbd with systemd socket activation
...new variables. > > + * > > + * env[0] is "LISTEN_PID=..." which is filled in by CONNECT_SA.START > > + * > > + * env[1] is "LISTEN_FDS=1" > > + * > > + * env[2] is "LISTEN_FDNAMES=nbd" > > */ > > static int > > prepare_socket_activation_environment (string_vector *env) > > @@ -53,26 +55,29 @@ prepare_socket_activation_environment (string_vector *env) > > > > assert (env->len == 0); > > > > - /* Reserve slots env[0] and env[1]. */ > > + /* Reserve slots env[0]..env[2] */ > > + if (string_v...
2023 Mar 23
1
[libnbd PATCH v3 19/19] socket activation: set LISTEN_FDNAMES
...fs); > SACT_VAR_PUSH (sact_var, &num_vars, > "LISTEN_FDS=", "1", NULL); > + if (h->sact_name != NULL) > + SACT_VAR_PUSH (sact_var, &num_vars, > + "LISTEN_FDNAMES=", h->sact_name, NULL); > if (prepare_socket_activation_environment (&env, sact_var, num_vars) == -1) If I'm reading this correctly, this does wipe an inherited LISTEN_FDNAMES from the environment in the case where the application linked with libnbd started life with a (different) socket activation, but now the user wants to connect to an nbd server wi...
2023 Feb 15
1
[libnbd PATCH v3 05/29] vector: (mostly) factor out DEFINE_VECTOR_EMPTY
...lly declare name##_empty() that will work with all vector types? That is, should we consider instead doing something like: DEFINE_VECTOR_TYPE (string_vector, char *, free); DEFINE_VECTOR_TYPE (int_vector, int, noop); > +++ b/generator/states-connect-socket-activation.c > @@ -91,8 +91,7 @@ prepare_socket_activation_environment (string_vector *env) > > err: > set_error (errno, "malloc"); > - string_vector_iter (env, (void *) free); > - free (env->ptr); > + string_vector_empty (env); > return -1; At any rate, I like how the callers look improved, even if we aren't qui...
2019 Sep 30
4
[PATCH libnbd v2 0/2] Implement systemd socket activation.
v1 was posted here: https://www.redhat.com/archives/libguestfs/2019-September/thread.html#00337 v2: - Drop the first patch. - Hopefully fix the multiple issues with fork-safety and general behaviour on error paths. Note this requires execvpe for which there seems to be no equivalent on FreeBSD, except some kind of tedious path parsing (but can we assign to environ?) Rich.
2023 Mar 24
4
[libnbd PATCH v3 19/19] socket activation: set LISTEN_FDNAMES
...R_PUSH (sact_var, &num_vars, >> "LISTEN_FDS=", "1", NULL); >> + if (h->sact_name != NULL) >> + SACT_VAR_PUSH (sact_var, &num_vars, >> + "LISTEN_FDNAMES=", h->sact_name, NULL); >> if (prepare_socket_activation_environment (&env, sact_var, num_vars) == -1) > > If I'm reading this correctly, this does wipe an inherited > LISTEN_FDNAMES from the environment in the case where the application > linked with libnbd started life with a (different) socket activation, > but now the user wants to con...
2019 Sep 30
0
[PATCH libnbd v2 2/2] api: Implement local command with systemd socket activation.
...+ * activation. Takes the current environment and copies it. Removes + * any existing LISTEN_PID or LISTEN_FDS and replaces them with new + * variables. env[0] is "LISTEN_PID=..." which is filled in by + * CONNECT_SA.START, and env[1] is "LISTEN_FDS=1". + */ +static char ** +prepare_socket_activation_environment (void) +{ + char **env = NULL; + char *p0 = NULL, *p1 = NULL; + size_t i, len; + void *vp; + + p0 = strdup ("LISTEN_PID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); + if (p0 == NULL) + goto err; + p1 = strdup ("LISTEN_FDS=1"); + if (p1 == NULL) + goto err; + + /* Copy...
2020 Oct 27
6
[PATCH libnbd 0/5] info: --map: Coalesce adjacent extents of the same type.
This adds coalescing of adjacent extents of the same type, as mentioned by Eric Blake in the commit message here: https://github.com/libguestfs/libnbd/commit/46072f6611f80245846a445766da071e457b00cd The patch series is rather long because it detours through adding the <vector.h> library from nbdkit into libnbd and replacing ad hoc uses of realloc, char ** etc in various places. Rich.