search for: getdir

Displaying 13 results from an estimated 13 matches for "getdir".

Did you mean: getdie
2018 Feb 07
1
[PATCH] tmpdirs: Make the ‘su broken’ error message actionable.
...+++++++----- 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 = getdir (g); char *tmppath = safe_asprintf (g, "%s/libguestfsXXXXXX&quo...
2016 Feb 02
0
[PATCH 2/3] lib: extract lazy tmpdir creation helper
...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); + char *tmppath = safe_asprintf (g, "%s/libguestfsXXXXXX", tmpdir); + if (mkdtemp (tmppath) == NULL) { + perrorf (g, _("%s: cannot create temporary directory"), tmppath); +...
2017 Dec 18
0
[PATCH] tmpdirs: Blame systemd because su is broken.
...ee694 100644 --- a/lib/tmpdirs.c +++ b/lib/tmpdirs.c @@ -24,6 +24,7 @@ #include <stdio.h> #include <stdlib.h> +#include <errno.h> #include <sys/types.h> #include <sys/stat.h> #include <libintl.h> @@ -185,7 +186,12 @@ lazy_make_tmpdir (guestfs_h *g, char *(*getdir) (guestfs_h *g), char **dest) CLEANUP_FREE char *tmpdir = getdir (g); char *tmppath = safe_asprintf (g, "%s/libguestfsXXXXXX", tmpdir); if (mkdtemp (tmppath) == NULL) { - perrorf (g, _("%s: cannot create temporary directory"), tmppath); + int bad_systemd...
2016 Feb 09
2
[PATCH 1/2] tmpdirs: centralize permissions handling
...; - /* Some common debugging information. */ if (g->verbose) { CLEANUP_FREE_VERSION struct guestfs_version *v = diff --git a/src/tmpdirs.c b/src/tmpdirs.c index 76bf1c5..0a36f2f 100644 --- a/src/tmpdirs.c +++ b/src/tmpdirs.c @@ -160,6 +160,17 @@ lazy_make_tmpdir (guestfs_h *g, char *(*getdir) (guestfs_h *g), char **dest) free (tmpdir); return -1; } + /* Allow qemu (which may be running as qemu.qemu) to read in this + * temporary directory; we are storing either sockets, or temporary + * disks which qemu needs to access to. (RHBZ#610880). + * We do thi...
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
2017 Nov 29
0
ls performance on directories with small number of items
...k round trips with fops that don't even fill a standard frame thus each frame has a high percentage of overhead for tcp. Add to that the replica check to ensure you're not getting stale data and you have another round trip for each file. Your 123k directory entries require several frames of getdirent and over 492k frames for the individual fstat calls. That's roughly 16us per frame. Can you eliminate the fstat calls? If you only get the directory listing that should be significantly better. To prove this, do "echo *". You will instantly see your 123k entries. On November 27,...
2005 Apr 18
1
Incorrect "This folder already contains a file named..." error
...alog saying that the file already exists, and asking if it should it be replaced. Needless to say, the file doesn't already exist. I took a look at the logs and the sequence of filesystem events during a drop looks basically like this: GETATTR /testfile returns ENOENT (20-30 getattr and getdirs for "/testfile", "/", and "/*" here - Samba does this for some reason) MKNOD /testfile GETATTR /testfile returns success Now the popup happens: "This folder already contains a file named testfile". Along with an offer to replace the current zero-le...
2016 May 12
0
[PATCH 2/4] src/tmpdirs.c: Add internal documentation.
...dir, 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 *(*getdir) (guestfs_h *g), char **dest) return 0; } -/* The g->tmpdir (per-handle temporary directory) is not created when - * the handle is created. Instead we create it lazily before the - * first time it is used, or during launch. +/** + * The C<g-E<gt>tmpdir> (per-handle temporary d...
2017 Nov 27
4
ls performance on directories with small number of items
Hi, I have a situation where an apache web server is trying to locate the IndexDocument for a directory on a gluster volume. This URL is being hit roughly 20 times per second. There is only 1 file in this directory. However, the parent directory does have a large number of items (+123,000 files and dirs) and we are performing operations to move these files into 2 levels of
2016 Feb 02
0
[PATCH 3/3] New API: get-sockdir
...kdir, so it never returns NULL. */ +char * +guestfs_impl_get_sockdir (guestfs_h *g) +{ + const char *str; + + if (g->env_runtimedir) + str = g->env_runtimedir; + else + str = "/tmp"; + + return safe_strdup (g, str); +} + static int lazy_make_tmpdir (guestfs_h *g, char *(*getdir) (guestfs_h *g), char **dest) { @@ -145,6 +165,12 @@ guestfs_int_lazy_make_tmpdir (guestfs_h *g) return lazy_make_tmpdir (g, guestfs_get_tmpdir, &g->tmpdir); } +int +guestfs_int_lazy_make_sockdir (guestfs_h *g) +{ + return lazy_make_tmpdir (g, guestfs_get_sockdir, &g->sockdir)...
2016 Feb 03
0
[PATCH v2 2/2] New API: get-sockdir
...kdir, so it never returns NULL. */ +char * +guestfs_impl_get_sockdir (guestfs_h *g) +{ + const char *str; + + if (g->env_runtimedir) + str = g->env_runtimedir; + else + str = "/tmp"; + + return safe_strdup (g, str); +} + static int lazy_make_tmpdir (guestfs_h *g, char *(*getdir) (guestfs_h *g), char **dest) { @@ -145,6 +165,12 @@ guestfs_int_lazy_make_tmpdir (guestfs_h *g) return lazy_make_tmpdir (g, guestfs_get_tmpdir, &g->tmpdir); } +int +guestfs_int_lazy_make_sockdir (guestfs_h *g) +{ + return lazy_make_tmpdir (g, guestfs_get_sockdir, &g->sockdir)...
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 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