search for: test_parted_m_opt

Displaying 10 results from an estimated 10 matches for "test_parted_m_opt".

2015 Mar 24
1
[PATCH 1/2] parted: introduce enum for whether parted has option -m
...T_CMD(str_sgdisk, sgdisk); +enum { + PARTED_INVALID = -1, + /* parted do not support -m option */ + PARTED_OPT_NO_M, + PARTED_OPT_HAS_M}; + /* Notes: * * Parted 1.9 sends error messages to stdout, hence use of the @@ -320,7 +326,7 @@ get_table_field (const char *line, int n) static int test_parted_m_opt (void) { - static int result = -1; + static int result = PARTED_INVALID; if (result >= 0) return result; @@ -334,9 +340,9 @@ test_parted_m_opt (void) } if (err && strstr (err, "invalid option -- m")) - result = 0; + result = PARTED_OPT_NO_M; else -...
2015 Mar 24
4
[PATCH 0/2] New API: part_get_part_type
Chen Hanxiao (2): parted: introduce enum for whether parted has option -m New API: part_get_part_type for showing partition type daemon/parted.c | 136 ++++++++++++++++++++++++++++++++++++++++++++++----- generator/actions.ml | 18 +++++++ src/MAX_PROC_NR | 2 +- 3 files changed, 143 insertions(+), 13 deletions(-) -- 2.1.0
2015 Mar 24
1
Re: [PATCH 1/2] parted: introduce enum for whether parted has option -m
...TED_OUTPUT_MACHINE and PARTED_OUTPUT_NORMAL) > are enough. > > > > + > > /* Notes: > > * > > * Parted 1.9 sends error messages to stdout, hence use of the > > @@ -320,7 +326,7 @@ get_table_field (const char *line, int n) > > static int > > test_parted_m_opt (void) > > { > > - static int result = -1; > > + static int result = PARTED_INVALID; > > Commenting here, but it applies to the rest of the changes: if you want > to apply an enum for this case, then do it consistently and for all the > cases. Using an enum value a...
2015 Oct 05
2
[PATCH] Remove multiple hacks that only apply to RHEL 5.
...st char *line, int n) return q; } -/* RHEL 5 parted doesn't have the -m (machine readable) option so we - * must do a lot more work to parse the output in - * print_partition_table below. Test for this option the first time - * this function is called. - */ -static enum parted_has_m_opt -test_parted_m_opt (void) -{ - static enum parted_has_m_opt result = PARTED_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, e...
2015 Mar 24
0
Re: [PATCH 1/2] parted: introduce enum for whether parted has option -m
...partition_table, so for it only two values (eg PARTED_OUTPUT_MACHINE and PARTED_OUTPUT_NORMAL) are enough. > + > /* Notes: > * > * Parted 1.9 sends error messages to stdout, hence use of the > @@ -320,7 +326,7 @@ get_table_field (const char *line, int n) > static int > test_parted_m_opt (void) > { > - static int result = -1; > + static int result = PARTED_INVALID; Commenting here, but it applies to the rest of the changes: if you want to apply an enum for this case, then do it consistently and for all the cases. Using an enum value and storing it to an int variable de...
2015 Mar 13
2
[PATCH] part-list: add support for show partition type
...disk); +#ifndef PARTED_NO_M +# define PARTED_NO_M 0 +#endif + /* Notes: * * Parted 1.9 sends error messages to stdout, hence use of the @@ -451,11 +455,7 @@ do_part_get_parttype (const char *device) guestfs_int_partition_list * do_part_list (const char *device) { - int parted_has_m_opt = test_parted_m_opt (); - if (parted_has_m_opt == -1) - return NULL; - - CLEANUP_FREE char *out = print_partition_table (device, parted_has_m_opt); + CLEANUP_FREE char *out = print_partition_table (device, PARTED_NO_M); if (!out) return NULL; @@ -466,88 +466,86 @@ do_part_list (const char *device)...
2015 Mar 13
0
Re: [PATCH] part-list: add support for show partition type
...M 0 > +#endif > + > /* Notes: > * > * Parted 1.9 sends error messages to stdout, hence use of the > @@ -451,11 +455,7 @@ do_part_get_parttype (const char *device) > guestfs_int_partition_list * > do_part_list (const char *device) > { > - int parted_has_m_opt = test_parted_m_opt (); > - if (parted_has_m_opt == -1) > - return NULL; > - > - CLEANUP_FREE char *out = print_partition_table (device, parted_has_m_opt); > + CLEANUP_FREE char *out = print_partition_table (device, PARTED_NO_M); > if (!out) > return NULL; > > @@ -466,88 +466...
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
2012 Aug 30
2
[PATCH v2] daemon: collect list of called external commands
...quot;, "--", device, "name", partstr, name, NULL); + str_parted, "-s", "--", device, "name", partstr, name, NULL); if (r == -1) { reply_with_error ("parted: %s: %s", device, err); free (err); @@ -333,7 +336,7 @@ test_parted_m_opt (void) return result; char *err = NULL; - int r = commandr (NULL, &err, "parted", "-s", "-m", "/dev/null", NULL); + int r = commandr (NULL, &err, str_parted, "-s", "-m", "/dev/null", NULL); if (r == -1) {...
2012 Aug 30
1
[PATCH] collect list of called external commands
...quot;, "--", device, "name", partstr, name, NULL); + str_parted, "-s", "--", device, "name", partstr, name, NULL); if (r == -1) { reply_with_error ("parted: %s: %s", device, err); free (err); @@ -333,7 +336,7 @@ test_parted_m_opt (void) return result; char *err = NULL; - int r = commandr (NULL, &err, "parted", "-s", "-m", "/dev/null", NULL); + int r = commandr (NULL, &err, str_parted, "-s", "-m", "/dev/null", NULL); if (r == -1) {...