Displaying 20 results from an estimated 26 matches for "n_match".
2013 Jan 24
5
[PATCH] btrfs: Fix btrfs_subvolume_list on F18
...LL;
+ }
+
for (i = 0; i < nr_subvolumes; ++i) {
/* To avoid allocations, reuse the 'line' buffer to store the
* path. Thus we don't need to free 'line', since it will be
* freed by the calling (XDR) code.
*/
char *line = lines[i];
+ #define N_MATCHES 3
+ int ovector[N_MATCHES * 3];
- if (sscanf (line, "ID %" SCNu64 " top level %" SCNu64 " path ",
- &ret->guestfs_int_btrfssubvolume_list_val[i].btrfssubvolume_id,
- &ret->guestfs_int_btrfssubvolume_list_val[i].btrf...
2016 Feb 23
3
[PATCH 1/2] lib: Allow the COMPILE_REGEXP macro to be used everywhere.
Since the daemon links to pcre and use regular expressions, and since
the COMPILE_REGEXP macro doesn't depend on any aspects of the
library-side code (eg. the guestfs_h handle etc), we can allow the
daemon to use the COMPILE_REGEXP macro. Move the macro to
"guestfs-internal-all.h" to permit this.
---
src/guestfs-internal-all.h | 26 ++++++++++++++++++++++++++
src/guestfs-internal.h
2009 Jul 20
3
S_alloc or Calloc for return value
I am trying to write a C function to create a vector of integers that can be
used by the R calling function. I do not know the size of the vector in the
R calling function. (Well, actually, I have an upper limit on the size, but
that is so large that R cannot allocate it. What I'm doing in the function
is to do a sieving procedure, and the result will be small enough to fit
into my
2015 Feb 11
0
[PATCH v3 1/2] New API: btrfs_balance_status
...)
+{
+ const size_t MAX_ARGS = 64;
+ const char *argv[MAX_ARGS];
+ size_t i = 0;
+ CLEANUP_FREE char *path_buf = NULL;
+ CLEANUP_FREE char *err = NULL;
+ char *out;
+ int r;
+ guestfs_int_btrfsbalance *ret;
+ char **lines;
+ size_t nlines;
+ const char *errptr;
+ int erroffset;
+#define N_MATCH 2
+ int ovector[N_MATCH * 3];
+ pcre *re = NULL;
+
+ path_buf = sysroot_path (path);
+ if (path_buf == NULL) {
+ reply_with_perror ("malloc");
+ return NULL;
+ }
+
+ ADD_ARG (argv, i, str_btrfs);
+ ADD_ARG (argv, i, "balance");
+ ADD_ARG (argv, i, "status"...
2015 Feb 13
0
[PATCH v4 1/2] New API: btrfs_balance_status
...)
+{
+ const size_t MAX_ARGS = 64;
+ const char *argv[MAX_ARGS];
+ size_t i = 0;
+ CLEANUP_FREE char *path_buf = NULL;
+ CLEANUP_FREE char *err = NULL;
+ char *out;
+ int r;
+ guestfs_int_btrfsbalance *ret;
+ char **lines;
+ size_t nlines;
+ const char *errptr;
+ int erroffset;
+#define N_MATCH 2
+ int ovector[N_MATCH * 3];
+ pcre *re = NULL;
+
+ path_buf = sysroot_path (path);
+ if (path_buf == NULL) {
+ reply_with_perror ("malloc");
+ return NULL;
+ }
+
+ ADD_ARG (argv, i, str_btrfs);
+ ADD_ARG (argv, i, "balance");
+ ADD_ARG (argv, i, "status"...
2015 Feb 13
3
[PATCH v4 0/2] add btrfs_balance_status and btrfs_scrub_status
v4:
- add reply_with_error when nlines < 1
- remove `i == X' tests.
v3:
- rebase on upstream
- fix some comments
v2:
- add check for the length of lines[]
- the code parsing 'btrfs scrub -R status' output is changed into a loop
Hu Tao (2):
New API: btrfs_balance_status
New API: btfs_scrub_status
daemon/btrfs.c | 268
2015 Feb 13
1
Re: [PATCH v4 1/2] New API: btrfs_balance_status
...[MAX_ARGS];
> + size_t i = 0;
> + CLEANUP_FREE char *path_buf = NULL;
> + CLEANUP_FREE char *err = NULL;
> + char *out;
> + int r;
> + guestfs_int_btrfsbalance *ret;
> + char **lines;
> + size_t nlines;
> + const char *errptr;
> + int erroffset;
> +#define N_MATCH 2
> + int ovector[N_MATCH * 3];
> + pcre *re = NULL;
> +
> + path_buf = sysroot_path (path);
> + if (path_buf == NULL) {
> + reply_with_perror ("malloc");
> + return NULL;
> + }
> +
> + ADD_ARG (argv, i, str_btrfs);
> + ADD_ARG (argv, i, "...
2017 Jul 21
0
[PATCH v2 15/23] daemon: Reimplement ‘btrfs_subvolume_list’ and ‘btrfs_subvolume_get_default’ in OCaml.
...error;
- }
-
- for (i = 0; i < nr_subvolumes; ++i) {
- /* To avoid allocations, reuse the 'line' buffer to store the
- * path. Thus we don't need to free 'line', since it will be
- * freed by the calling (XDR) code.
- */
- char *line = lines[i];
-#define N_MATCHES 4
- int ovector[N_MATCHES * 3];
-
- if (pcre_exec (re_btrfs_subvolume_list, NULL, line, strlen (line), 0, 0,
- ovector, N_MATCHES * 3) < 0)
-#undef N_MATCHES
- {
- unexpected_output:
- reply_with_error ("unexpected output from 'btrfs subvolume list...
[PATCH 18/27] daemon: Reimplement ‘btrfs_subvolume_list’ and ‘btrfs_subvolume_get_default’ in OCaml.
2017 Jul 14
0
[PATCH 18/27] daemon: Reimplement ‘btrfs_subvolume_list’ and ‘btrfs_subvolume_get_default’ in OCaml.
...error;
- }
-
- for (i = 0; i < nr_subvolumes; ++i) {
- /* To avoid allocations, reuse the 'line' buffer to store the
- * path. Thus we don't need to free 'line', since it will be
- * freed by the calling (XDR) code.
- */
- char *line = lines[i];
-#define N_MATCHES 4
- int ovector[N_MATCHES * 3];
-
- if (pcre_exec (re_btrfs_subvolume_list, NULL, line, strlen (line), 0, 0,
- ovector, N_MATCHES * 3) < 0)
-#undef N_MATCHES
- {
- unexpected_output:
- reply_with_error ("unexpected output from 'btrfs subvolume list...
2015 Feb 02
0
Re: [PATCH 1/2] New API: btrfs_balance_status
...#39; is (.*)", 0, &errptr, &erroffset, NULL);
> + if (re == NULL) {
> + reply_with_error ("pcre_compile (%i): %s", erroffset, errptr);
> + goto error;
> + }
> + if (pcre_exec (re, NULL, lines[0], strlen (lines[0]), 0, 0,
> + ovector, N_MATCH * 3) < 0) {
> + reply_with_error ("unexpected output from 'btrfs balance status' command: %s", lines[0]);
> + goto error;
> + }
> +#undef N_MATCH
> +
> + if (STREQ (lines[0] + ovector[2], "running"))
> + ret->btrfsbalance_status = st...
2015 Feb 03
2
[PATCH v2 0/2] add btrfs_balance_status and btrfs_scrub_status
changes in v2:
- add check for the length of lines[]
- the code parsing 'btrfs scrub -R status' output is changed into a loop
Hu Tao (2):
New API: btrfs_balance_status
New API: btfs_scrub_status.
daemon/btrfs.c | 263 +++++++++++++++++++++++++++++++
generator/actions.ml | 26 +++
generator/structs.ml | 34 ++++
2015 Feb 02
5
[PATCH 1/2] New API: btrfs_balance_status
...(const char *path)
+{
+ const size_t MAX_ARGS = 64;
+ const char *argv[MAX_ARGS];
+ size_t i = 0;
+ CLEANUP_FREE char *path_buf = NULL;
+ CLEANUP_FREE char *err = NULL;
+ char *out;
+ int r;
+ guestfs_int_btrfsbalance *ret;
+ char **lines;
+ const char *errptr;
+ int erroffset;
+#define N_MATCH 2
+ int ovector[N_MATCH * 3];
+ pcre *re = NULL;
+
+ path_buf = sysroot_path (path);
+ if (path_buf == NULL) {
+ reply_with_perror ("malloc");
+ return NULL;
+ }
+
+ ADD_ARG (argv, i, str_btrfs);
+ ADD_ARG (argv, i, "balance");
+ ADD_ARG (argv, i, "status"...
2015 Feb 15
4
[PATCH v5 0/2] add btrfs_balance_status and btrfs_scrub_status
v5:
- fix tests failure
v4:
- add reply_with_error when nlines < 1
- remove `i == X' tests.
v3:
- rebase on upstream
- fix some comments
v2:
- add check for the length of lines[]
- the code parsing 'btrfs scrub -R status' output is changed into a loop
Hu Tao (2):
New API: btrfs_balance_status
New API: btfs_scrub_status
daemon/btrfs.c
2015 Feb 11
4
[PATCH v3 0/2] add btrfs_balance_status and btrfs_scrub_status
v3:
- rebase on upstream
- fix some comments
v2:
- add check for the length of lines[]
- the code parsing 'btrfs scrub -R status' output is changed into a loop
Hu Tao (2):
New API: btrfs_balance_status
New API: btfs_scrub_status
daemon/btrfs.c | 263 +++++++++++++++++++++++++++++++
generator/actions.ml | 26 +++
2014 Sep 04
10
[PATCH 0/5] use augeas for /etc/shadow
Hi,
currently /etc/shadow is edited manually when needed (i.e. when setting
the password for an user), and it is not changed when removing users.
Import the upstream shadow.aug (currently in their development serie,
but not part of any released version yet), and use it only when the
augeas version is less than a potential 1.2.1 (covering also the case
when the new version is just 1.3.0).
Pino
2015 Jul 13
1
[PATCH] daemon: add a space after func name to fit code-style
...t;btrfsbalance_status = strdup("none");
+ ret->btrfsbalance_status = strdup ("none");
if (ret->btrfsbalance_status == NULL) {
reply_with_perror ("strdup");
return NULL;
@@ -1866,9 +1866,9 @@ do_btrfs_balance_status (const char *path)
#undef N_MATCH
if (STREQ (lines[0] + ovector[2], "running"))
- ret->btrfsbalance_status = strdup("running");
+ ret->btrfsbalance_status = strdup ("running");
else if (STREQ (lines[0] + ovector[2], "paused"))
- ret->btrfsbalance_status = strdup(&quo...
2015 Oct 05
0
[PATCH 2/2] Fix whitespace.
...ize);
return NULL;
diff --git a/daemon/btrfs.c b/daemon/btrfs.c
index 50b0ba8..ddb029d 100644
--- a/daemon/btrfs.c
+++ b/daemon/btrfs.c
@@ -517,26 +517,26 @@ do_btrfs_subvolume_list (const mountable_t *fs)
* freed by the calling (XDR) code.
*/
char *line = lines[i];
- #define N_MATCHES 4
+#define N_MATCHES 4
int ovector[N_MATCHES * 3];
if (pcre_exec (re, NULL, line, strlen (line), 0, 0,
ovector, N_MATCHES * 3) < 0)
- #undef N_MATCHES
- {
- unexpected_output:
- reply_with_error ("unexpected output from 'btrfs subvolume li...
2015 Oct 05
3
[PATCH 1/2] Change 'fprintf (stdout,...)' -> printf.
Result of earlier copy and paste.
---
align/scan.c | 35 ++++++++++---------
cat/cat.c | 39 +++++++++++----------
cat/filesystems.c | 69 +++++++++++++++++++-------------------
cat/log.c | 35 ++++++++++---------
cat/ls.c | 61 +++++++++++++++++----------------
df/main.c | 43 ++++++++++++------------
diff/diff.c | 67
2017 Jun 05
19
[PATCH v3 00/19] Allow APIs to be implemented in OCaml.
v2 was here:
https://www.redhat.com/archives/libguestfs/2017-June/msg00008.html
This series gets as far as a working (and faster) reimplementation of
‘guestfs_list_filesystems’.
I also have another patch series on top of this one which reimplements
the inspection APIs inside the daemon, but that needs a bit more work
still, since inspection turns out to be a very large piece of code.
Rich.
2017 Jul 27
23
[PATCH v3 00/23] Reimplement many daemon APIs in OCaml.
I think this fixes everything mentioned:
- Added the Optgroups module as suggested.
- Remove command temporary files.
- Replace command ~flags with ?fold_stdout_on_stderr.
- Nest _with_mounted function.
- Rebase & retest.
Rich.