search for: reply_with_error

Displaying 20 results from an estimated 529 matches for "reply_with_error".

2017 Jul 27
0
[PATCH v2] daemon: Remove GUESTFSD_EXT_CMD.
...t, const char *options) } r = command (NULL, &err, - str_mount, "-o", opts, "-t", "9p", mount_tag, mp, NULL); + "mount", "-o", opts, "-t", "9p", mount_tag, mp, NULL); if (r == -1) { reply_with_error ("%s on %s: %s", mount_tag, mountpoint, err); return -1; diff --git a/daemon/available.c b/daemon/available.c index 977c4dead..5ecb3f355 100644 --- a/daemon/available.c +++ b/daemon/available.c @@ -30,9 +30,6 @@ #include "actions.h" #include "optgroups.h" -GUE...
2017 Jul 24
0
[PATCH 2/2] daemon: Replace GUESTFSD_EXT_CMD with --print-external-commands.
...t, const char *options) } r = command (NULL, &err, - str_mount, "-o", opts, "-t", "9p", mount_tag, mp, NULL); + "mount", "-o", opts, "-t", "9p", mount_tag, mp, NULL); if (r == -1) { reply_with_error ("%s on %s: %s", mount_tag, mountpoint, err); return -1; diff --git a/daemon/Makefile.am b/daemon/Makefile.am index eedf09d52..8f7258343 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -220,6 +220,11 @@ guestfsd_CFLAGS = \ $(YAJL_CFLAGS) \ $(PCRE_CFLAGS) +# Tests. +...
2015 Jun 16
1
[PATCH] btrfs: remove unused 'out' variables
...out = NULL; int r = -1; fs_buf = mount (fs); @@ -1065,7 +1064,7 @@ do_btrfs_quota_enable (const mountable_t *fs, int enable) ADD_ARG (argv, i, fs_buf); ADD_ARG (argv, i, NULL); - r = commandv (&out, &err, argv); + r = commandv (NULL, &err, argv); if (r == -1) { reply_with_error ("%s: %s", fs_buf, err); goto error; @@ -1085,7 +1084,6 @@ do_btrfs_quota_rescan (const mountable_t *fs) size_t i = 0; char *fs_buf = NULL; CLEANUP_FREE char *err = NULL; - CLEANUP_FREE char *out = NULL; int r = -1; fs_buf = mount (fs); @@ -1098,7 +1096,7 @@ do_btrf...
2015 Oct 05
2
[PATCH] Remove multiple hacks that only apply to RHEL 5.
...D_INVALID; - - if (result >= 0) - return result; - - CLEANUP_FREE char *err = NULL; - int r = commandr (NULL, &err, str_parted, "-s", "-m", "/dev/null", NULL); - if (r == -1) { - /* Test failed, eg. missing or completely unusable parted binary. */ - reply_with_error ("could not run 'parted' command"); - return -1; - } - - if (err && strstr (err, "invalid option -- m")) - result = PARTED_OPT_NO_M; - else - result = PARTED_OPT_HAS_M; - return result; -} - static char * -print_partition_table (const char *device,...
2012 Aug 30
2
[PATCH v2] daemon: collect list of called external commands
...t, const char *options) } r = command (NULL, &err, - "mount", "-o", opts, "-t", "9p", mount_tag, mp, NULL); + str_mount, "-o", opts, "-t", "9p", mount_tag, mp, NULL); if (r == -1) { reply_with_error ("%s on %s: %s", mount_tag, mountpoint, err); goto out; diff --git a/daemon/available.c b/daemon/available.c index 08e72f3..7bd8a3c 100644 --- a/daemon/available.c +++ b/daemon/available.c @@ -29,6 +29,9 @@ #include "actions.h" #include "optgroups.h" +GUESTFSD...
2015 Mar 17
4
[PATCH] New API: part_get_part_type for showing partition type
...arted); GUESTFSD_EXT_CMD(str_sfdisk, sfdisk); GUESTFSD_EXT_CMD(str_sgdisk, sgdisk); +#ifndef PARTED_NO_M +# define PARTED_NO_M 0 +#endif + /* Notes: * * Parted 1.9 sends error messages to stdout, hence use of the @@ -1022,3 +1026,111 @@ do_part_get_name (const char *device, int partnum) reply_with_error ("cannot get the partition name from '%s' layouts", parttype); return NULL; } + +char * +do_part_get_part_type (const char *device, int partnum) +{ + CLEANUP_FREE char *parttype; + char *part_type; + + if (partnum <= 0) { + reply_with_error ("partition number mus...
2012 Aug 30
1
[PATCH] collect list of called external commands
...t, const char *options) } r = command (NULL, &err, - "mount", "-o", opts, "-t", "9p", mount_tag, mp, NULL); + str_mount, "-o", opts, "-t", "9p", mount_tag, mp, NULL); if (r == -1) { reply_with_error ("%s on %s: %s", mount_tag, mountpoint, err); goto out; diff --git a/daemon/available.c b/daemon/available.c index 08e72f3..48e5eb5 100644 --- a/daemon/available.c +++ b/daemon/available.c @@ -29,6 +29,9 @@ #include "actions.h" #include "optgroups.h" +GUESTFS_...
2012 Jan 13
4
[PATCH 1/3] ext2: tweak the error returned message of resize2fs-M(BZ755729)
.../daemon/ext2.c +++ b/daemon/ext2.c @@ -277,9 +277,14 @@ do_resize2fs_M (const char *device) if (e2prog (prog) == -1) return -1; - r = command (NULL, &err, prog, "-M" , device, NULL); + r = command (NULL, &err, prog, "-M", device, NULL); if (r == -1) { - reply_with_error ("%s", err); + if (strstr (err, "e2fsck -f")) { + free (err); + reply_with_error ("you need to run e2fsck with the correct and/or forceall options first"); + } else { + reply_with_error ("%s", err); + } free (err); return -1;...
2017 Jul 27
3
[PATCH v2] daemon: Remove GUESTFSD_EXT_CMD.
This is a simpler patch that removes GUESTFSD_EXT_CMD completely.
2015 Jan 28
1
[PATCH] daemon: parted: use --part-type with recent sfdisk
...and --change-id. + */ +static int +test_sfdisk_has_part_type (void) +{ + static int tested = -1; + + if (tested != -1) + return tested; + + int r; + CLEANUP_FREE char *out = NULL, *err = NULL; + + r = command (&out, &err, str_sfdisk, "--help", NULL); + if (r == -1) { + reply_with_error ("%s: %s", "sfdisk --help", err); + return -1; + } + + tested = strstr (out, "--part-type") != NULL; + return tested; +} + /* Currently we use sfdisk for getting and setting the ID byte. In * future, extend parted to provide this functionality. As a result...
2012 Apr 02
2
[PATCH 0/2] Fix btrfs blocksize and bind mkfs.btrfs (RHBZ#807905).
https://bugzilla.redhat.com/show_bug.cgi?id=807905 Currently if you specify the blocksize parameter to mkfs-opts with a btrfs filesystem, then it fails, because mkfs.btrfs interprets the -b option as meaning filesystem size. The first patch fixes this by disallowing blocksize (it cannot be mapped meaningfully into btrfs parameters). The second patch adds the full /sbin/mkfs.btrfs utility to the
2012 Aug 31
1
[PATCH V1] NEW API:ext:mke2fs
...uot;); + } + if (optargs_bitmask & GUESTFS_MKE2FS_BADBLOCKFILE_BITMASK) { + if (badblockfile) { + ADD_ARG (argv, i, "-l"); + ADD_ARG (argv, i, badblockfile); + } + } + if (optargs_bitmask & GUESTFS_MKE2FS_BLOCKSIZE_BITMASK) { + if (blocksize < 0) { + reply_with_error ("blocksize must be >= 0"); + goto error; + } + snprintf (blocksize_s, sizeof blocksize_s, "%" PRIi64, blocksize); + ADD_ARG (argv, i, "-b"); + ADD_ARG (argv, i, blocksize_s); + } + if (optargs_bitmask & GUESTFS_MKE2FS_DIRECTWRITE_BITMASK) { +...
2016 Nov 21
2
Re: [PATCH v2 2/6] New API: yara_load
...data.fd = mkstemp (rules_path); > + if (data.fd == -1) { > + reply_with_perror ("mkstemp"); > + return -1; > + } > + > + ret = receive_file (write_callback, &data); > + if (ret == -1) { > + /* Write error. */ > + cancel_receive (); > + reply_with_error ("write error: %s", rules_path); > + return -1; > + } > + if (ret == -2) { > + /* Cancellation from library */ > + reply_with_error ("file upload cancelled"); > + return -1; > + } > + > + return 0; > +} This function does not always...
2012 Jan 13
3
[PATCH v2 1/3] ext2: tweak the error returned message of resize2fs-M(BZ755729)
.../daemon/ext2.c +++ b/daemon/ext2.c @@ -277,9 +277,14 @@ do_resize2fs_M (const char *device) if (e2prog (prog) == -1) return -1; - r = command (NULL, &err, prog, "-M" , device, NULL); + r = command (NULL, &err, prog, "-M", device, NULL); if (r == -1) { - reply_with_error ("%s", err); + if (strstr (err, "e2fsck -f")) { + free (err); + reply_with_error ("you need to run e2fsck with the correct and/or forceall options first"); + } else { + reply_with_error ("%s", err); + } free (err); return -1;...
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’
2012 Feb 06
2
[PATCH 1/2] Revert "daemon: Run udev_settle after pwrite-device finishes."
From: "Richard W.M. Jones" <rjones at redhat.com> This reverts commit a9c8123c72db47bcab8dd738e8d5256a9ae87f11. --- daemon/file.c | 18 +++--------------- daemon/parted.c | 3 +-- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/daemon/file.c b/daemon/file.c index 057e15d..91746e0 100644 --- a/daemon/file.c +++ b/daemon/file.c @@ -525,7 +525,7 @@
2012 Jul 31
1
[PATCH] xfs: add new api xfs-growfs
...C_BITMASK)) + rtsec = 0; + + if (datasec) + ADD_ARG (argv, i, "-d"); + if (logsec) + ADD_ARG (argv, i, "-l"); + if (rtsec) + ADD_ARG (argv, i, "-r"); + + if (optargs_bitmask & GUESTFS_XFS_GROWFS_DATASIZE_BITMASK) { + if (datasize < 0) { + reply_with_error ("datasize must be >= 0"); + goto error; + } + snprintf (datasize_s, sizeof datasize_s, "%" PRIi64, datasize); + ADD_ARG (argv, i, "-D"); + ADD_ARG (argv, i, datasize_s); + } + + if (optargs_bitmask & GUESTFS_XFS_GROWFS_LOGSIZE_BITMASK) { +...
2015 Mar 23
0
Re: [PATCH] New API: part_get_part_type for showing partition type
..._sgdisk, sgdisk); > > +#ifndef PARTED_NO_M > +# define PARTED_NO_M 0 > +#endif What does this bit do? > /* Notes: > * > * Parted 1.9 sends error messages to stdout, hence use of the > @@ -1022,3 +1026,111 @@ do_part_get_name (const char *device, int partnum) > reply_with_error ("cannot get the partition name from '%s' layouts", parttype); > return NULL; > } > + > +char * > +do_part_get_part_type (const char *device, int partnum) > +{ > + CLEANUP_FREE char *parttype; > + char *part_type; > + > + if (partnum <= 0) {...
2015 Oct 20
4
[PATCHv3 0/2] Introduce vfs_min_size API to get minimum filesystem size.
Tried to make it in accordance with your comments. Difference to v1: Added reply_with_error where necessary. Changed name get_min_size -> vfs_min_size. Difference to v2: Changed name to vfs_minimum_size. Changed parsing to xstrtol + STR* macros where possible. Maxim Perevedentsev (2): New API: vfs_min_size Include resize2fs_P into vfs_min_size. daemon/Makefile.am | 1 + daem...
2015 Oct 19
5
[PATCHv2 0/2] Introduce vfs_min_size API to get minimum filesystem size.
Tried to make it in accordance with your comments. Difference to v1: Added reply_with_error where necessary. Changed name get_min_size -> vfs_min_size. Maxim Perevedentsev (2): New API: vfs_min_size Include resize2fs_P into vfs_min_size. daemon/Makefile.am | 1 + daemon/daemon.h | 2 ++ daemon/ext2.c | 45 ++++++++++++++++++++++++++----- daemon/fs-min-size.c | 49...