search for: mountable_to_str

Displaying 20 results from an estimated 33 matches for "mountable_to_str".

2015 Jun 23
2
[PATCH] daemon: Rewrite prog_exists so it uses the actual PATH, not hard-coded list.
...hat.com/show_bug.cgi?id=502074#c5 - * - * NOTE: if you change $PATH, you must also change 'prog_exists' - * function below. */ setenv ("PATH", "/sbin:/usr/sbin:/bin:/usr/bin", 1); setenv ("SHELL", "/bin/sh", 1); @@ -1440,22 +1437,34 @@ mountable_to_string (const mountable_t *mountable) } } -/* Check program exists and is executable on $PATH. Actually, we - * just assume PATH contains the default entries (see main() above). - */ +/* Check program exists and is executable on $PATH. */ int prog_exists (const char *prog) { - static const c...
2014 Dec 11
1
Re: [PATCH v2 01/11] daemon: btrfs: add helper functions mount and umount
...dir (fs_buf) == -1 && errno != ENOENT) { > - reply_with_error ("rmdir: %m\n"); > - goto cmderror; > - } > - } > + if (umount (fs_buf, fs) != 0) > + return NULL; > > if (r == -1) { > CLEANUP_FREE char *fs_desc = mountable_to_string (fs); > @@ -401,7 +409,7 @@ do_btrfs_subvolume_list (const mountable_t *fs) > fprintf (stderr, "malloc: %m"); > } > reply_with_error ("%s: %s", fs_desc ? fs_desc : "malloc", errout); > - goto cmderror; > + return NU...
2015 Jun 23
0
Re: [PATCH] daemon: Rewrite prog_exists so it uses the actual PATH, not hard-coded list.
...gt; - * > - * NOTE: if you change $PATH, you must also change 'prog_exists' > - * function below. > */ > setenv ("PATH", "/sbin:/usr/sbin:/bin:/usr/bin", 1); > setenv ("SHELL", "/bin/sh", 1); > @@ -1440,22 +1437,34 @@ mountable_to_string (const mountable_t *mountable) > } > } > > -/* Check program exists and is executable on $PATH. Actually, we > - * just assume PATH contains the default entries (see main() above). > - */ > +/* Check program exists and is executable on $PATH. */ > int > prog_e...
2014 Dec 12
0
[PATCH v3 01/11] daemon: btrfs: add helper functions mount and umount
...goto cmderror; - } - - if (rmdir (fs_buf) == -1 && errno != ENOENT) { - reply_with_error ("rmdir: %m\n"); - goto cmderror; - } - } + if (umount (fs_buf, fs) != 0) + return NULL; if (r == -1) { CLEANUP_FREE char *fs_desc = mountable_to_string (fs); @@ -401,7 +411,7 @@ do_btrfs_subvolume_list (const mountable_t *fs) fprintf (stderr, "malloc: %m"); } reply_with_error ("%s: %s", fs_desc ? fs_desc : "malloc", errout); - goto cmderror; + return NULL; } lines = spli...
2014 Dec 11
0
[PATCH v2 01/11] daemon: btrfs: add helper functions mount and umount
...goto cmderror; - } - - if (rmdir (fs_buf) == -1 && errno != ENOENT) { - reply_with_error ("rmdir: %m\n"); - goto cmderror; - } - } + if (umount (fs_buf, fs) != 0) + return NULL; if (r == -1) { CLEANUP_FREE char *fs_desc = mountable_to_string (fs); @@ -401,7 +409,7 @@ do_btrfs_subvolume_list (const mountable_t *fs) fprintf (stderr, "malloc: %m"); } reply_with_error ("%s: %s", fs_desc ? fs_desc : "malloc", errout); - goto cmderror; + return NULL; } lines = spli...
2015 Jul 17
1
[PATCH] daemon: add a space after func/macro to fit code-style
...++ b/daemon/guestfsd.c @@ -1203,7 +1203,7 @@ print_shell_quote (FILE *stream, const char *str = *((const char **) (args[0])); for (i = len = 0; str[i]; ++i) { - if (!SAFE(str[i])) { + if (!SAFE (str[i])) { putc ('\\', stream); len ++; } @@ -1399,8 +1399,8 @@ mountable_to_string (const mountable_t *mountable) return strdup (mountable->device); case MOUNTABLE_BTRFSVOL: - if (asprintf(&desc, "btrfsvol:%s/%s", - mountable->device, mountable->volume) == -1) + if (asprintf (&desc, "btrfsvol:%s/%s"...
2017 Jul 21
0
[PATCH v2 15/23] daemon: Reimplement ‘btrfs_subvolume_list’ and ‘btrfs_subvolume_get_default’ in OCaml.
...ot;list"); - ADD_ARG (argv, i, fs_buf); - ADD_ARG (argv, i, NULL); - - CLEANUP_FREE char *out = NULL, *errout = NULL; - int r = commandv (&out, &errout, argv); - - if (umount (fs_buf, fs) != 0) - return NULL; - - if (r == -1) { - CLEANUP_FREE char *fs_desc = mountable_to_string (fs); - if (fs_desc == NULL) { - fprintf (stderr, "malloc: %m"); - } - reply_with_error ("%s: %s", fs_desc ? fs_desc : "malloc", errout); - return NULL; - } - - lines = split_lines (out); - if (!lines) return NULL; - } - - /* Ou...
2017 Jul 14
0
[PATCH 18/27] daemon: Reimplement ‘btrfs_subvolume_list’ and ‘btrfs_subvolume_get_default’ in OCaml.
...ot;list"); - ADD_ARG (argv, i, fs_buf); - ADD_ARG (argv, i, NULL); - - CLEANUP_FREE char *out = NULL, *errout = NULL; - int r = commandv (&out, &errout, argv); - - if (umount (fs_buf, fs) != 0) - return NULL; - - if (r == -1) { - CLEANUP_FREE char *fs_desc = mountable_to_string (fs); - if (fs_desc == NULL) { - fprintf (stderr, "malloc: %m"); - } - reply_with_error ("%s: %s", fs_desc ? fs_desc : "malloc", errout); - return NULL; - } - - lines = split_lines (out); - if (!lines) return NULL; - } - - /* Ou...
2019 Sep 23
6
[PATCH v2 0/5] remove unused gnulib modules
This is an extended version of: https://www.redhat.com/archives/libguestfs/2019-September/msg00178.html It adds a couple of simple code changes, so it makes it possible to drop more modules. In addition, more unused modules were dropped. Pino Toscano (5): tests: switch away from xgetcwd daemon: move read_whole_file to common utils daemon: switch from read_file to read_whole_file daemon:
2014 Dec 12
15
[PATCH v3 00/11] btrfs support part2: qgroup/quota commands
Hi, This is v3 series to add support to btrfs qgroup related commands, inclduing quota commands, and two leftover of subvolume commands. Regards, Hu changes: v3: - don't intialize fs_buf (patch 1) - check the return value of sysroot_path (patch 1) - check fs_buf rather than fs (patch 1) - fprintf (stderr,...) -> reply_with_error() v2: - add tests for new APIs - combine
2017 Jun 19
0
[PATCH v7 13/13] daemon: Link guestfsd with libutils.
...rnal-all.h" - #include "cleanups.h" +#include "guestfs-utils.h" + +#include "guestfs-internal-all.h" + #include "structs-cleanups.h" #include "command.h" @@ -76,6 +78,22 @@ extern int xread (int sock, void *buf, size_t len) extern char *mountable_to_string (const mountable_t *mountable); +/*-- in cleanups.c --*/ + +/* These functions are used internally by the CLEANUP_* macros. + * Don't call them directly. + */ +extern void cleanup_aug_close (void *ptr); +extern void cleanup_free_stringsbuf (void *ptr); + +#ifdef HAVE_ATTRIBUTE_CLEANUP +#de...
2014 Dec 11
14
[PATCH v2 00/11] btrfs support part2: qgroup/quota commands
Hi, This is v2 series to add support to btrfs qgroup related commands, inclduing quota commands, and two leftover of subvolume commands. Regards, Hu changes: v2: - add tests for new APIs - combine btrfs_quota_enable and btrfs_quota_disable - following APIs changed to operate on Mountable_or_Path: btrfs_subvolume_get_default, btrfs_quota_enable, btrfs_quota_rescan. Hu Tao (11):
2019 Nov 27
7
[PATCH v3 0/6] remove unused build stuff
This is an extended version of: https://www.redhat.com/archives/libguestfs/2019-September/msg00288.html Apparently I forgot it on my tree, so I'm posting that series again, adding an extra cleanup more due to the v2v/common splits. Pino Toscano (6): tests: switch away from xgetcwd daemon: move read_whole_file to common utils daemon: switch from read_file to read_whole_file daemon:
2013 Feb 12
7
Remaining btrfs patches
[PATCH 1/7] mount: Add mount_vfs_nochroot This is significantly reworked from before. umount is gone as discussed, and variable motion is minimised. [PATCH 2/7] btrfs: Update btrfs_subvolume_list to take Already provisionally ACKed. Previous comment was that cleanup could be tidier. I looked into creating a new cleanup function for fs_buf, but it isn't possible (or simple, anyway) in this
2013 Feb 07
12
[PATCH 01/12] generator: Add new Mountable argument type
This type is initially identical to Device. --- generator/bindtests.ml | 2 +- generator/c.ml | 7 +++++-- generator/csharp.ml | 6 ++++-- generator/daemon.ml | 4 ++-- generator/erlang.ml | 6 +++--- generator/fish.ml | 8 ++++---- generator/gobject.ml | 11 ++++++----- generator/haskell.ml | 11 +++++++---- generator/java.ml | 10 +++++-----
2017 Aug 03
9
[PATCH 0/6] tests: Fix handling of device API parameters (RHBZ#1477623).
https://bugzilla.redhat.com/show_bug.cgi?id=1477623 The first two patches are cleanups. The third patch changes the way that we handle Device and Dev_or_Path parameters so that a parameter marked as such can really only contain a block device name (and not, for instance, a chardev). Using a chardev here caused hangs in the API. The next two patches fix API usage to conform to this new stricter
2016 Mar 06
8
[PATCH 0/5] Use less stack.
Various changes/fixes to use smaller stack frames. Rich.
2016 Mar 07
2
[PATCH v2] Use less stack.
...return -1; - if (! STRPREFIX (desc, "/dev/")) + desc = strdup (desc_orig); + if (desc == NULL) { + perror ("strdup"); return -1; + } slash = desc + strlen ("/dev/") - 1; while ((slash = strchr (slash + 1, '/'))) { @@ -1073,6 +1076,11 @@ mountable_to_string (const mountable_t *mountable) } } +#if defined(__GNUC__) && GUESTFS_GCC_VERSION >= 40800 /* gcc >= 4.8.0 */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstack-usage=10000" +#endif + /* Check program exists and is executable on $PATH. */ int pr...
2017 Jul 24
6
[PATCH 0/2] daemon: Replace GUESTFSD_EXT_CMD with --print-external-commands.
Replace GUESTFSD_EXT_CMD with a command line option ‘./guestfsd --print-external-commands’
2017 Jul 24
0
[PATCH 2/2] daemon: Replace GUESTFSD_EXT_CMD with --print-external-commands.
...make_exclude_from_file (const char *function, char *const *excludes); extern int asprintf_nowarn (char **strp, const char *fmt, ...); +extern void declare_external_commands (const char *cmds[]); +extern void print_external_commands (void); /* mountable functions (in guestfsd.c) */ extern char *mountable_to_string (const mountable_t *mountable); @@ -397,7 +399,12 @@ extern int upload_to_fd (int fd, const char *filename); } \ } while (0) -#define __external_command __attribute__((__section__(".guestfsd_ext_cmds"))) -#defi...