search for: sort_strings

Displaying 20 results from an estimated 35 matches for "sort_strings".

2009 Aug 03
1
[PATCH] Recognise cd-rom devices in devsparts.c
...ng (&r, &size, &alloc, NULL) == -1) { - closedir (dir); - return NULL; - } + if(!foreach_block_device(add_to_device_list)) return NULL; - if (closedir (dir) == -1) { - reply_with_perror ("closedir: /sys/block"); - free_strings (r); + /* Sort the devices */ + sort_strings (r, size); + + /* NULL terminate the list */ + if (add_string (&r, &size, &alloc, NULL) == -1) { return NULL; } - sort_strings (r, size-1); return r; } @@ -88,76 +69,63 @@ do_list_partitions (void) { char **r = NULL; int size = 0, alloc = 0; - DIR *dir, *dir2;...
2012 Mar 13
2
[PATCH 0/2] 'int' to 'size_t' changes
These two patches are probably not completely independent, but separating them is a lot of work. With *both* patches applied, all the tests and extra-tests pass. That's no guarantee however that there isn't a mistake, so I don't think this patch is a candidate for the 1.16 branch, until it's had a lot more testing in development. Rich.
2017 Jun 19
0
[PATCH v7 13/13] daemon: Link guestfsd with libutils.
...ROR_CFLAGS) \ $(RPC_CFLAGS) \ diff --git a/daemon/augeas.c b/daemon/augeas.c index 5adc959a5..bd54c4849 100644 --- a/daemon/augeas.c +++ b/daemon/augeas.c @@ -436,7 +436,7 @@ do_aug_ls (const char *path) if (matches == NULL) return NULL; /* do_aug_match has already sent the error */ - sort_strings (matches, count_strings ((void *) matches)); + sort_strings (matches, guestfs_int_count_strings ((void *) matches)); return matches; /* Caller frees. */ } diff --git a/daemon/btrfs.c b/daemon/btrfs.c index ae2310b53..5f1e5d1d0 100644 --- a/daemon/btrfs.c +++ b/daemon/btrfs.c @@ -152,7 +152,...
2016 Jan 27
4
[PATCH] lvm: support lvm2 older than 2.02.107
...known device")) { + char buf[256]; + + snprintf (buf, sizeof buf, "/dev/%s/%s", vg_name, lv_name); + if (add_string (&ret, buf) == -1) { + free (out); + return NULL; + } + } + + p = pend; + } + + free (out); + + if (ret.size > 0) + sort_strings (ret.argv, ret.size); + + if (end_stringsbuf (&ret) == -1) + return NULL; + + return ret.argv; +} + char ** do_pvs (void) { @@ -139,26 +219,76 @@ do_vgs (void) return convert_lvm_output (out, NULL); } +/* Check whether lvs has -S to filter its output. + * It is available only in l...
2016 Jan 28
0
[PATCH v2] lvm: support lvm2 older than 2.02.107
...known device")) { + char buf[256]; + + snprintf (buf, sizeof buf, "/dev/%s/%s", vg_name, lv_name); + if (add_string (&ret, buf) == -1) { + free (out); + return NULL; + } + } + + p = pend; + } + + free (out); + + if (ret.size > 0) + sort_strings (ret.argv, ret.size); + + if (end_stringsbuf (&ret) == -1) + return NULL; + + return ret.argv; +} + char ** do_pvs (void) { @@ -139,26 +218,72 @@ do_vgs (void) return convert_lvm_output (out, NULL); } +/* Check whether lvs has -S to filter its output. + * It is available only in l...
2011 Jun 09
15
[PATCH 00/13] Fix errors found using Coverity static analyzer.
I ran the Coverity static analyzer[1] on libguestfs, and fixed many errors as a result. Coverity found some errors in gnulib, but it doesn't seem to be worth following those up since the version of gnulib we are using is so old. There are a couple more errors (possibly 1 false-positive) which I'm going to send in a separate email. BTW all the errors found by Coverity were in the daemon
2015 Jun 17
4
[PATCH 1/4] daemon: introduce free_stringsbuf
...const char *str); extern int add_sprintf (struct stringsbuf *sb, const char *fs, ...) __attribute__((format (printf,2,3))); extern int end_stringsbuf (struct stringsbuf *sb); +extern void free_stringsbuf (struct stringsbuf *sb); extern size_t count_strings (char *const *argv); extern void sort_strings (char **argv, size_t len); diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c index c912ee3..453dee1 100644 --- a/daemon/guestfsd.c +++ b/daemon/guestfsd.c @@ -587,6 +587,13 @@ end_stringsbuf (struct stringsbuf *sb) return add_string_nodup (sb, NULL); } +void +free_stringsbuf (struct stringsb...
2017 Jul 14
0
[PATCH 14/27] daemon: Reimplement ‘lvs’ API in OCaml.
...known device")) { - char buf[256]; - - snprintf (buf, sizeof buf, "/dev/%s/%s", vg_name, lv_name); - if (add_string (&ret, buf) == -1) { - free (out); - return NULL; - } - } - - p = pend; - } - - free (out); - - if (ret.size > 0) - sort_strings (ret.argv, ret.size); - - if (end_stringsbuf (&ret) == -1) - return NULL; - - return take_stringsbuf (&ret); -} - char ** do_pvs (void) { @@ -222,74 +139,6 @@ do_vgs (void) return convert_lvm_output (out, NULL); } -/* Check whether lvs has -S to filter its output. - * It is av...
2009 Aug 17
13
total warning-removal for daemon/
The warnings in daemon were aggravating and risky for development (too easy to miss new ones) so I spent some time last week and today working on removing them. The first patch gets us down to almost no warnings with the original -Wall setting. That was by far the hardest part. Once I'd done that, I enabled nearly all of gcc's warnings via gnulib's warnings and manywarnings modules
2012 Feb 01
1
[PATCH] Clarify the error message when unavailable functions are called (RHBZ#679737).
...7 +356,7 @@ do_aug_save (void) return 0; #else - NOT_AVAILABLE (-1); + NOT_AVAILABLE (augeas, -1); #endif } @@ -373,7 +373,7 @@ do_aug_load (void) return 0; #else - NOT_AVAILABLE (-1); + NOT_AVAILABLE (augeas, -1); #endif } @@ -421,6 +421,6 @@ do_aug_ls (const char *path) sort_strings (matches, count_strings ((void *) matches)); return matches; /* Caller frees. */ #else - NOT_AVAILABLE (NULL); + NOT_AVAILABLE (augeas, NULL); #endif } diff --git a/daemon/btrfs.c b/daemon/btrfs.c index a20ee08..88a7386 100644 --- a/daemon/btrfs.c +++ b/daemon/btrfs.c @@ -1,5 +1,5 @@ /* l...
2017 Jul 14
0
[PATCH 05/27] daemon: Reimplement several devsparts APIs in OCaml.
...l \ chroot.ml \ blkid.ml \ + devsparts.ml \ file.ml \ callbacks.ml \ daemon.ml diff --git a/daemon/daemon.h b/daemon/daemon.h index be7a3bedc..0a92e6cee 100644 --- a/daemon/daemon.h +++ b/daemon/daemon.h @@ -130,9 +130,6 @@ extern void free_stringsbuf (struct stringsbuf *sb); extern void sort_strings (char **argv, size_t len); extern void free_stringslen (char **argv, size_t len); -extern void sort_device_names (char **argv, size_t len); -extern int compare_device_names (const char *a, const char *b); - extern struct stringsbuf split_lines_sb (char *str); extern char **split_lines (char *s...
2011 Nov 11
3
[PATCH v2] Add mdadm-create, list-md-devices APIs.
This adds the mdadm-create API for creating RAID devices, and includes various fixes for the other two patches. Rich.
2010 Feb 05
13
[PATCH 01/14] hivexsh: Document some peculiarities of the "cd" command.
--- hivex/hivexsh.pod | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/hivex/hivexsh.pod b/hivex/hivexsh.pod index 277e3ae..9336798 100644 --- a/hivex/hivexsh.pod +++ b/hivex/hivexsh.pod @@ -100,7 +100,14 @@ or even: Path elements (node names) are matched case insensitively, and characters like space, C<*>, and C<?> have I<no> special
2020 Mar 09
4
[PATCH v3 0/3] Switch augeas APIs to OCaml
This reimplements the augeas APIs using ocaml-augeas (dropping all the C code). The behaviour seems unchanged, although I may have not tested all the various corner cases. Changes from v2: - dropped patch #1, as it was applied already (was a real bugfix) - rebased on master Pino Toscano (3): Revert "Revert "daemon: implement OptString for OCaml APIs"" daemon: move augeas
2020 Jan 09
5
[PATCH v2 0/4] Switch augeas APIs to OCaml
This reimplements the augeas APIs using ocaml-augeas (dropping all the C code). The behaviour seems unchanged, although I may have not tested all the various corner cases. Pino Toscano (4): daemon: fix/enhance error reporting of Augeas exceptions Revert "Revert "daemon: implement OptString for OCaml APIs"" daemon: move augeas APIs to OCaml daemon: drop usage of C
2020 Sep 07
9
[PATCH v2 0/7] Windows BitLocker support.
Original version linked from here: https://bugzilla.redhat.com/show_bug.cgi?id=1808977#c8 There is no change in the code in this series, but feedback from the original series was we shouldn't lose the error message in patch 7. When I tested this just now in fact we don't lose the error if debugging is enabled, but I have updated the commit message to note what the error message is in the
2020 Mar 30
9
[PATCH 0/7] Support Windows BitLocker (RHBZ#1808977).
These commits, along with the associated changes to common: https://www.redhat.com/archives/libguestfs/2020-March/msg00286.html support the transparent decryption and inspection of Windows guests encrypted with BitLocker encryption. To do the BitLocker decryption requires cryptsetup 2.3.0 (although cryptsetup 2.3 is not required for existing LUKS use). It also requires a new-ish Linux kernel, I
2020 Sep 17
13
[PATCH v3 0/8] Windows BitLocker support.
As discussed in the emails today, this is the third version addressing most points from the v1/v2 review. You will need to pair this with the changes in libguestfs-common from this series: https://www.redhat.com/archives/libguestfs/2020-September/msg00050.html Rich.
2019 May 30
5
[PATCH 0/5] RFC: switch augeas APIs to OCaml
This synchronizes the embedded ocaml-augeas copy, and reimplements the augeas APIs using it (dropping all the C code). The behaviour seems unchanged, although I may have not tested all the various corner cases. Pino Toscano (5): common/mlaugeas: Synchronize with latest ocaml-augeas daemon: fix/enhance error reporting of Augeas exceptions Revert "Revert "daemon: implement
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