search for: reply_with_error_errno

Displaying 20 results from an estimated 40 matches for "reply_with_error_errno".

2016 May 16
1
[PATCH] btrfs_filesystem_show: work with btrfs < 4.3.1
...changed, 6 insertions(+) diff --git a/daemon/btrfs.c b/daemon/btrfs.c index 62bdac7..9b52aa8 100644 --- a/daemon/btrfs.c +++ b/daemon/btrfs.c @@ -2270,6 +2270,12 @@ do_btrfs_filesystem_show (const char *device) } else if (STRPREFIX (lines[i], "\t*** Some devices missing")) { reply_with_error_errno (ENODEV, "%s: missing devices", device); return NULL; + } else if (STRPREFIX (lines[i], "btrfs-progs v")) { + /* Older versions of btrfs-progs output also the version string + * (the same as `btrfs --version`. This has been fixed upstream + * since v4...
2017 Mar 17
1
[PATCH] btrfs_filesystem_show: work with another old btrfs version
...sertions(+), 1 deletion(-) diff --git a/daemon/btrfs.c b/daemon/btrfs.c index d18f518..23513a9 100644 --- a/daemon/btrfs.c +++ b/daemon/btrfs.c @@ -2268,7 +2268,8 @@ do_btrfs_filesystem_show (const char *device) } else if (STRPREFIX (lines[i], "\t*** Some devices missing")) { reply_with_error_errno (ENODEV, "%s: missing devices", device); return NULL; - } else if (STRPREFIX (lines[i], "btrfs-progs v")) { + } else if (STRPREFIX (lines[i], "btrfs-progs v") || + STRPREFIX (lines[i], "Btrfs v")) { /* Older versions of btrfs...
2015 Jun 30
13
[PATCH v4 0/7] uuid: add btrfs uuid change support and set_uuid_random
- Btrfs-progs v4.1 introduced new feature of changing uuid of btrfs partition. This patch add support of this. - Introduce set_uuid_random - uuids.c did a lot of deplicated work for changing uuid of fs. Use existing functions. v4: introduce get_random_uuid improve testcases squash internal API patches v3.1: fix typos v3: set errno if feature is not available. Chen Hanxiao (7):
2017 Jul 19
2
Re: [PATCH 02/27] daemon: Allow parts of the daemon and APIs to be written in OCaml.
...> /* Send the magic length message which indicates that > * userspace is up inside the guest. > */ > @@ -1205,3 +1212,46 @@ cleanup_free_mountable (mountable_t *mountable) > free (mountable->volume); > } > } > + > +/* Convert an OCaml exception to a reply_with_error_errno call > + * as best we can. > + */ > +extern void ocaml_exn_to_reply_with_error (const char *func, value exn); > + > +void > +ocaml_exn_to_reply_with_error (const char *func, value exn) > +{ Shouldn't this use CAMLparam1 + CAMLreturn? > diff --git a/daemon/sysroot-c.c b...
2015 Jun 24
2
Re: [PATCH v2 1/5] uuid: add support to change uuid of btrfs partition
In data mercoledì 24 giugno 2015 15:54:03, Chen Hanxiao ha scritto: > btrfs-progs v4.1 add support to change uuid of btrfs fs. > > Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com> > --- > v2: put btrfs operation back to daemon/btrfs.c > move tests to tests/btrfs > > daemon/btrfs.c | 60 ++++++++++++++++++++++++++++++++++++++++++ >
2015 Jun 30
0
[PATCH v4 7/7] New API: set_uuid_random
...om (device); + + else if (STREQ (vfs_type, "xfs")) + r = xfs_set_uuid_random (device); + + else if (STREQ (vfs_type, "swap")) + r = swap_set_uuid_random (device); + + else if (STREQ (vfs_type, "btrfs")) + r = btrfs_set_uuid_random (device); + + else { + reply_with_error_errno (ENOTSUP, "don't know how to set the random UUID for '%s' filesystems", + vfs_type); + r = -1; + } + + return r; +} diff --git a/generator/actions.ml b/generator/actions.ml index 372e50e..52404ab 100644 --- a/generator/actions.ml +++ b/generator/actio...
2016 Aug 05
0
[PATCH 2/4] daemon: fstrim: Turn "discard operation is not supported" into ENOTSUP.
...;err, argv); if (r == -1) { - reply_with_error ("%s", err); + /* If the error is about the kernel operation not being supported + * for this filesystem type, then return errno ENOTSUP here. + */ + if (strstr (err, "discard operation is not supported")) + reply_with_error_errno (ENOTSUP, "%s", err); + else + reply_with_error ("%s", err); return -1; } -- 2.7.4
2017 Jul 19
0
Re: [PATCH 02/27] daemon: Allow parts of the daemon and APIs to be written in OCaml.
...a variant that takes a > generic (unit -> unit) function (called 'fn', maybe?), and have 'f' > use it: > > let f t fun arg = > f (fun () -> fun arg) I'm a bit confused, do you have a compilable example? > > +/* Convert an OCaml exception to a reply_with_error_errno call > > + * as best we can. > > + */ > > +extern void ocaml_exn_to_reply_with_error (const char *func, value exn); > > + > > +void > > +ocaml_exn_to_reply_with_error (const char *func, value exn) > > +{ > > Shouldn't this use CAMLparam1 + CAMLre...
2015 Jun 30
0
[PATCH v4 6/7] daemon: add functions for setting random uuid of fs
...+++ b/daemon/btrfs.c @@ -874,6 +874,27 @@ btrfs_set_uuid (const char *device, const char *uuid) return 0; } +int +btrfs_set_uuid_random (const char *device) +{ + CLEANUP_FREE char *err = NULL; + int r; + int has_uuid_opts = test_btrfstune_uuid_opt(); + + if (has_uuid_opts <= 0) { + reply_with_error_errno (ENOTSUP, "btrfs filesystems' UUID cannot be changed"); + return -1; + } + + r = commandr (NULL, &err, str_btrfstune, "-f", "-u", device, NULL); + if (r == -1) { + reply_with_error ("%s: %s", device, err); + return -1; + } + + return 0;...
2017 Jul 20
2
Re: [PATCH 02/27] daemon: Allow parts of the daemon and APIs to be written in OCaml.
...en calling more more than a single-parameter function, it is slightly easier to read (IMHO, of course): let res = Chroot.f chroot (fun () -> ...) in than let res = Chroot.f chroot (fun () -> ...) () in This is mostly syntactic sugar. > > > +/* Convert an OCaml exception to a reply_with_error_errno call > > > + * as best we can. > > > + */ > > > +extern void ocaml_exn_to_reply_with_error (const char *func, value exn); > > > + > > > +void > > > +ocaml_exn_to_reply_with_error (const char *func, value exn) > > > +{ > > > &g...
2015 Jun 26
0
[PATCH v3 1/4] uuid: add support to change uuid of btrfs partition
...svalue) { @@ -807,6 +845,28 @@ do_btrfs_set_seeding (const char *device, int svalue) return 0; } +int +btrfs_set_uuid (const char *device, const char *uuid) +{ + CLEANUP_FREE char *err = NULL; + int r; + int has_uuid_opts = test_btrftune_uuid_opt (); + + if (has_uuid_opts <= 0) { + reply_with_error_errno (ENOTSUP, "btrfs filesystems' UUID cannot be changed"); + return -1; + } + + r = commandr (NULL, &err, str_btrfstune, "-f", "-U", uuid, device, NULL); + + if (r == -1) { + reply_with_error ("%s: %s", device, err); + return -1; + } + + re...
2015 Jun 26
0
[PATCH v3.1 1/9] uuid: add support to change uuid of btrfs partition
...value) { @@ -807,6 +845,28 @@ do_btrfs_set_seeding (const char *device, int svalue) return 0; } +int +btrfs_set_uuid (const char *device, const char *uuid) +{ + CLEANUP_FREE char *err = NULL; + int r; + int has_uuid_opts = test_btrfstune_uuid_opt (); + + if (has_uuid_opts <= 0) { + reply_with_error_errno (ENOTSUP, "btrfs filesystems' UUID cannot be changed"); + return -1; + } + + r = commandr (NULL, &err, str_btrfstune, "-f", "-U", uuid, device, NULL); + + if (r == -1) { + reply_with_error ("%s: %s", device, err); + return -1; + } + + re...
2015 Jun 30
0
[PATCH v4 1/7] uuid: add support to change uuid of btrfs partition
...value) { @@ -814,6 +852,28 @@ do_btrfs_set_seeding (const char *device, int svalue) return 0; } +int +btrfs_set_uuid (const char *device, const char *uuid) +{ + CLEANUP_FREE char *err = NULL; + int r; + int has_uuid_opts = test_btrfstune_uuid_opt (); + + if (has_uuid_opts <= 0) { + reply_with_error_errno (ENOTSUP, "btrfs filesystems' UUID cannot be changed"); + return -1; + } + + r = commandr (NULL, &err, str_btrfstune, "-f", "-U", uuid, device, NULL); + + if (r == -1) { + reply_with_error ("%s: %s", device, err); + return -1; + } + + re...
2016 May 12
1
[PATCH] New API: btrfs-filesystem-show (RHBZ#1164765)
...; + const char *end; + if (!p) + continue; + + p += strlen (" path "); + end = strchrnul (p, ' '); + add_sprintf (&ret, "%.*s", (int) (end - p), p); + } else if (STRPREFIX (lines[i], "\t*** Some devices missing")) { + reply_with_error_errno (ENODEV, "%s: missing devices", device); + return NULL; + } else { + reply_with_error ("unrecognized line in output from 'btrfs filesystem show': %s", lines[i]); + return NULL; + } + } + + end_stringsbuf (&ret); + + return take_stringsbuf (&am...
2015 Jun 18
3
[PATCH v2 0/3] daemon: parted: Always use -s option even with -m.
version 2: - Turn the "unrecognised disk label" error into errno == EINVAL - Fix virt-alignment-scan - Rework the fix for virt-v2v bug 1232192 (see description of patch 3/3)
2014 May 20
2
[PATCH] daemon: scrub-file: resolve the path before calling scrub (RHBZ#1099490).
...- a/daemon/scrub.c +++ b/daemon/scrub.c @@ -54,12 +54,34 @@ do_scrub_device (const char *device) int do_scrub_file (const char *file) { + CLEANUP_FREE char *rp = NULL; CLEANUP_FREE char *buf = NULL; CLEANUP_FREE char *err = NULL; int r; + if (! optgroup_realpath_available ()) { + reply_with_error_errno (ENOTSUP, + "feature '%s' is not available in this\n" + "build of libguestfs. Read 'AVAILABILITY' in the guestfs(3) man page for\n" + "how to check for the availability of features.", + "realpath"); + return -1; +...
2015 Jun 25
0
Re: [PATCH v2 1/5] uuid: add support to change uuid of btrfs partition
...for <= 0 here, to consider errors in test_btrftune_uuid_opt > on the safe side. > > > + reply_with_error ("btrfstune do not support '-u'"); > > reply_with_error ("btrfs filesystems' UUID cannot be changed"); How about: errcode = ENOTSUP; reply_with_error_errno (errcode, " btrfs filesystems' UUID cannot be changed"); Then we got the errno, and set_uuid could tell whether we support this feature. Regards, - Chen > > > + return -1; > > + } > > + > > + r = commandr (NULL, &err, str_btrfstune, "-f&quo...
2015 Jun 26
14
[PATCH v3.1 0/9] uuid: add btrfs uuid change support and set_uuid_random
- Btrfs-progs v4.1 introduced new feature of changing uuid of btrfs partition. This patch add support of this. - Introduce set_uuid_random - uuids.c did a lot of deplicated work for changing uuid of fs. Use existing functions. v3.1: fix typos v3: set errno if feature is not available. Chen Hanxiao (9): uuid: add support to change uuid of btrfs partition uuid: use existing function of
2016 Aug 05
6
[PATCH 0/4] sparsify: Warn instead of error if a filesystem cannot be fstrimmed.
Fix for https://bugzilla.redhat.com/show_bug.cgi?id=1364347
2015 Oct 05
2
[PATCH] Remove multiple hacks that only apply to RHEL 5.
...int errcode = 0; /* Translate "unrecognised disk label" into an errno code. */ - if (msg && strstr (msg, "unrecognised disk label") != NULL) + if (err && strstr (err, "unrecognised disk label") != NULL) errcode = EINVAL; - reply_with_error_errno (errcode, "parted print: %s: %s", device, msg); + reply_with_error_errno (errcode, "parted print: %s: %s", device, err); free (out); return NULL; } @@ -383,93 +346,46 @@ print_partition_table (const char *device, char * do_part_get_parttype (const char *device)...