search for: sockdir

Displaying 18 results from an estimated 18 matches for "sockdir".

Did you mean: lockdir
2016 Feb 03
0
[PATCH v2 2/2] New API: get-sockdir
...ad-only API to get a path where to store temporary sockets: this is different from tmpdir, as we need short paths for sockets (due to sockaddr_un::sun_path), and it is either XDG_RUNTIME_DIR if set, or /tmp; adapt guestfs_int_create_socketname to create sockets in that location. Furthermore, print sockdir and XDG_RUNTIME_DIR in test-tool for debugging. --- fish/guestfish.pod | 11 +++++++++++ generator/actions.ml | 16 ++++++++++++++++ src/guestfs-internal.h | 7 ++++++- src/guestfs.pod | 11 +++++++++++ src/handle.c | 9 ++++++++- src/launch.c | 9 ++++++--- src...
2016 Feb 02
0
[PATCH 3/3] New API: get-sockdir
...different than tmpdir, as we need short paths for sockets (due to sockaddr_un::sun_path), and is either XDG_RUNTIME_DIR if set, or /tmp. Adapt guestfs_int_create_socketname to create sockets in that location, checking whether the resulting path still fits in the limited buffer. Furthermore, print sockdir and XDG_RUNTIME_DIR in test-tool for debugging. --- fish/guestfish.pod | 11 +++++++++++ generator/actions.ml | 16 ++++++++++++++++ src/guestfs-internal.h | 7 ++++++- src/handle.c | 9 ++++++++- src/launch.c | 10 ++++++++-- src/tmpdirs.c | 33 +++++++++++++++...
2016 Feb 08
2
Re: [PATCH v2 2/2] New API: get-sockdir
...e to store temporary > sockets: this is different from tmpdir, as we need short paths for > sockets (due to sockaddr_un::sun_path), and it is either > XDG_RUNTIME_DIR if set, or /tmp; adapt guestfs_int_create_socketname > to create sockets in that location. > > Furthermore, print sockdir and XDG_RUNTIME_DIR in test-tool for > debugging. As you saw, there were a few problems with this patch. However I also found something more fundamental. On machines where XDG_RUNTIME_DIR is set to /run/user/$UID, it fails badly when run as root: Original error from libvirt: internal error...
2016 Jan 29
0
[PATCH 6/6] launch: avoid too long paths for sockets
...guestfs_set_tmpdir or NULL */ char *int_cachedir; /* $LIBGUESTFS_CACHEDIR or guestfs_set_cachedir or NULL */ + /* Optional socket directory - this is created on demand only when + * creating a socket whose absolute path in tmpdir would not fit + * into sockaddr_un::sun_path. + */ + char *sockdir; /* Error handler, plus stack of old error handlers. */ guestfs_error_handler_cb error_cb; @@ -758,7 +763,9 @@ extern void guestfs_int_call_callbacks_array (guestfs_h *g, uint64_t event, cons /* tmpdirs.c */ extern int guestfs_int_set_env_tmpdir (guestfs_h *g, const char *tmpdir); exte...
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
2016 Jan 29
7
[PATCH 1/6] launch: unix: check for length of sockets
Error out early if the path to the socket will not fit into sockaddr_un::sun_path, as we will not be able to connect to it. --- src/launch-unix.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/launch-unix.c b/src/launch-unix.c index 740c554..973e14b 100644 --- a/src/launch-unix.c +++ b/src/launch-unix.c @@ -47,6 +47,12 @@ launch_unix (guestfs_h *g, void *datav, const char
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 Jan 29
1
Re: [PATCH 6/6] launch: avoid too long paths for sockets
...> char *int_cachedir; /* $LIBGUESTFS_CACHEDIR or guestfs_set_cachedir or NULL */ > + /* Optional socket directory - this is created on demand only when > + * creating a socket whose absolute path in tmpdir would not fit > + * into sockaddr_un::sun_path. > + */ > + char *sockdir; > > /* Error handler, plus stack of old error handlers. */ > guestfs_error_handler_cb error_cb; > @@ -758,7 +763,9 @@ extern void guestfs_int_call_callbacks_array (guestfs_h *g, uint64_t event, cons > /* tmpdirs.c */ > extern int guestfs_int_set_env_tmpdir (guestfs_h...
2016 Feb 09
0
Re: [PATCH v2 2/2] New API: get-sockdir
...sockets: this is different from tmpdir, as we need short paths for > > sockets (due to sockaddr_un::sun_path), and it is either > > XDG_RUNTIME_DIR if set, or /tmp; adapt guestfs_int_create_socketname > > to create sockets in that location. > > > > Furthermore, print sockdir and XDG_RUNTIME_DIR in test-tool for > > debugging. > > As you saw, there were a few problems with this patch. However I also > found something more fundamental. > > On machines where XDG_RUNTIME_DIR is set to /run/user/$UID, it fails > badly when run as root: > >...
2020 May 22
0
[PATCH nbdkit 4/4] fua: Add unsafe fuamode=discard.
...t; - cat fua3.log || : - echo "Log 4 file contents:" - cat fua4.log || : - echo "Log 5 file contents:" - cat fua5.log || : + for i in {1..6}; do + echo "Log $i file contents:" + cat fua$i.log || : + done rm -f $files rm -rf $sockdir } @@ -77,6 +72,7 @@ cleanup_fn cleanup # 3: fuamode=native: log shows that blocksize preserves fua # 4: fuamode=force: log shows that fua is always enabled # 5: fuamode=pass: fua flag and flush unchanged +# 6: fuamode=discard: discard all fua and flush start_nbdkit -P fua1.pid -U $sockdir/fua1...
2020 May 22
6
[PATCH nbdkit 0/4] Add fuamode=pass and fuamode=discard
Two hopefully useful additions to the fua filter. The second one is kind of like cache=unsafe in qemu, in that it exchanges correctness for speed. Useful for data which is easily recreated in the event of a crash or for people who like living on the edge and have good backups. Rich.
2016 Feb 09
2
[PATCH 1/2] tmpdirs: centralize permissions handling
...+ if (geteuid () == 0 && chmod (tmppath, 0755) == -1) { + perrorf (g, "chmod: %s", tmppath); + free (tmppath); + return -1; + } *dest = tmppath; } return 0; @@ -178,24 +189,7 @@ guestfs_int_lazy_make_tmpdir (guestfs_h *g) int guestfs_int_lazy_make_sockdir (guestfs_h *g) { - int ret; - uid_t euid = geteuid (); - - ret = lazy_make_tmpdir (g, guestfs_get_sockdir, &g->sockdir); - if (ret == -1) - return ret; - - if (euid == 0) { - /* Allow qemu (which may be running as qemu.qemu) to read the socket - * temporary directory. (RHBZ#...
2016 May 12
0
[PATCH 2/4] src/tmpdirs.c: Add internal documentation.
...cachedir> API. + * + * Note this actually calculates the cachedir, so it never returns C<NULL>. + */ char * guestfs_impl_get_cachedir (guestfs_h *g) { @@ -126,7 +140,12 @@ guestfs_impl_get_cachedir (guestfs_h *g) return safe_strdup (g, str); } -/* Note this actually calculates the sockdir, so it never returns NULL. */ +/** + * Implements the C<guestfs_get_sockdir> API. + * + * Note this actually calculates the sockdir, so it never returns + * C<NULL>. + */ char * guestfs_impl_get_sockdir (guestfs_h *g) { @@ -176,9 +195,10 @@ lazy_make_tmpdir (guestfs_h *g, char *(*get...
2018 Feb 07
1
[PATCH] tmpdirs: Make the ‘su broken’ error message actionable.
...31e2b10875. Replace with an actionable error message. --- lib/tmpdirs.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/tmpdirs.c b/lib/tmpdirs.c index bda3ee694..804c58be0 100644 --- a/lib/tmpdirs.c +++ b/lib/tmpdirs.c @@ -180,18 +180,22 @@ guestfs_impl_get_sockdir (guestfs_h *g) } static int -lazy_make_tmpdir (guestfs_h *g, char *(*getdir) (guestfs_h *g), char **dest) +lazy_make_tmpdir (guestfs_h *g, + char *(*getdir) (guestfs_h *g), int is_runtime_dir, + char **dest) { if (!*dest) { CLEANUP_FREE char *tmpdir =...
2020 Apr 06
4
[v2v PATCH 1/2] v2v: nbdkit: change base dir for nbdkit sockets/pidfiles
Since this new temporary directory will contain UNIX sockets for communicating with nbdkit, then its path must not be too long. Use the existing directory that libguestfs exposes for this, i.e. sockdir. --- v2v/nbdkit.ml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/v2v/nbdkit.ml b/v2v/nbdkit.ml index 65317f9b..46b20c9d 100644 --- a/v2v/nbdkit.ml +++ b/v2v/nbdkit.ml @@ -103,9 +103,12 @@ let add_filter_if_available cmd filter = if probe_filter filter then add_filte...
2016 May 12
7
[PATCH 0/4] lib: qemu: Memoize qemu feature detection.
Doing qemu feature detection in the direct backend takes ~100ms because we need to run `qemu -help' and `qemu -devices ?', and each of those interacts with glibc's very slow link loader. Fixing the link loader is really hard. Instead memoize the output of those two commands. This patch series first separates all the code dealing with qemu into a separate module (src/qemu.c) and
2017 May 04
4
[PATCH 0/3] generator: Allow returned strings to be annotated as devices.
If we want to permit more than 255 drives to be added, then we will have to add the disks to the same virtio-scsi target using different unit (LUN) numbers. Unfortunately SCSI LUN enumeration in the Linux is not deterministic (eg. two disks with target=0, lun=[0,1] can be enumerated as /dev/sda or /dev/sdb randomly). Dealing with that will require some very complex device name translation on the
2017 Feb 18
8
[PATCH 0/6] generator: Split up generator/actions.ml
Split up the huge generator/actions.ml into several smaller files. Rich.