search for: 2ae9c74

Displaying 5 results from an estimated 5 matches for "2ae9c74".

2016 Feb 02
6
[PATCH 1/3] launch: add internal helper for socket paths creation
Introduce an internal helper to create paths for sockets; will be useful for changing later the logic for placing sockets. --- src/guestfs-internal.h | 1 + src/launch-direct.c | 4 +++- src/launch-libvirt.c | 10 ++++++---- src/launch.c | 15 +++++++++++++++ 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/guestfs-internal.h b/src/guestfs-internal.h index
2016 Feb 02
0
[PATCH 2/3] lib: extract lazy tmpdir creation helper
...creation of a temporary directory, so it can be used for more directories as well. This is just code motion, with no behaviour changes. --- src/tmpdirs.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/tmpdirs.c b/src/tmpdirs.c index 9154d8b..2ae9c74 100644 --- a/src/tmpdirs.c +++ b/src/tmpdirs.c @@ -119,6 +119,22 @@ guestfs_impl_get_cachedir (guestfs_h *g) return safe_strdup (g, str); } +static int +lazy_make_tmpdir (guestfs_h *g, char *(*getdir) (guestfs_h *g), char **dest) +{ + if (!*dest) { + CLEANUP_FREE char *tmpdir = getdir (g)...
2016 Feb 02
0
[PATCH 3/3] New API: get-sockdir
...; + return -1; + } - snprintf (*sockpath, UNIX_PATH_MAX-1, "%s/%s", path, filename); + snprintf (*sockpath, UNIX_PATH_MAX-1, "%s/%s", g->sockdir, filename); (*sockpath)[UNIX_PATH_MAX-1] = '\0'; return 0; diff --git a/src/tmpdirs.c b/src/tmpdirs.c index 2ae9c74..e66ab9c 100644 --- a/src/tmpdirs.c +++ b/src/tmpdirs.c @@ -76,6 +76,12 @@ guestfs_int_set_env_tmpdir (guestfs_h *g, const char *tmpdir) } int +guestfs_int_set_env_runtimedir (guestfs_h *g, const char *runtimedir) +{ + return set_abs_path (g, runtimedir, &g->env_runtimedir); +} + +int...
2016 Feb 03
0
[PATCH v2 2/2] New API: get-sockdir
...g: %s/%s"), g->sockdir, filename); return -1; } - snprintf (*sockpath, UNIX_PATH_MAX, "%s/%s", g->tmpdir, filename); + snprintf (*sockpath, UNIX_PATH_MAX, "%s/%s", g->sockdir, filename); return 0; } diff --git a/src/tmpdirs.c b/src/tmpdirs.c index 2ae9c74..e66ab9c 100644 --- a/src/tmpdirs.c +++ b/src/tmpdirs.c @@ -76,6 +76,12 @@ guestfs_int_set_env_tmpdir (guestfs_h *g, const char *tmpdir) } int +guestfs_int_set_env_runtimedir (guestfs_h *g, const char *runtimedir) +{ + return set_abs_path (g, runtimedir, &g->env_runtimedir); +} + +int...
2016 Feb 03
4
[PATCH v2 1/2] launch: add internal helper for socket paths creation
Introduce an internal helper to create paths for sockets -- will be useful for changing later the logic for placing sockets. Futhermore, check that the length of sockets won't overflow the buffer for their filenames. --- src/guestfs-internal.h | 1 + src/launch-direct.c | 4 +++- src/launch-libvirt.c | 10 ++++++---- src/launch.c | 17 +++++++++++++++++ 4 files changed, 27