Displaying 10 results from an estimated 10 matches for "parted_has_m_opt".
2015 Mar 24
1
[PATCH 1/2] parted: introduce enum for whether parted has option -m
...@@ test_parted_m_opt (void)
}
if (err && strstr (err, "invalid option -- m"))
- result = 0;
+ result = PARTED_OPT_NO_M;
else
- result = 1;
+ result = PARTED_OPT_HAS_M;
return result;
}
@@ -347,7 +353,7 @@ print_partition_table (const char *device, int parted_has_m_opt)
CLEANUP_FREE char *err = NULL;
int r;
- if (parted_has_m_opt)
+ if (PARTED_OPT_HAS_M == parted_has_m_opt)
r = command (&out, &err, str_parted, "-m", "--", device,
"unit", "b",
"print", NULL...
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 Oct 05
2
[PATCH] Remove multiple hacks that only apply to RHEL 5.
...de <stdio.h>
#include <stdlib.h>
+#include <stdbool.h>
#include <stdint.h>
#include <inttypes.h>
#include <string.h>
@@ -33,13 +34,6 @@ GUESTFSD_EXT_CMD(str_parted, parted);
GUESTFSD_EXT_CMD(str_sfdisk, sfdisk);
GUESTFSD_EXT_CMD(str_sgdisk, sgdisk);
-enum parted_has_m_opt {
- PARTED_INVALID = -1,
- /* parted do not support -m option */
- PARTED_OPT_NO_M = 0,
- PARTED_OPT_HAS_M = 1,
-};
-
/* Notes:
*
* Parted 1.9 sends error messages to stdout, hence use of the
@@ -319,43 +313,14 @@ get_table_field (const char *line, int n)
return q;
}
-/* RHEL 5 parte...
2015 Mar 13
2
[PATCH] part-list: add support for show partition type
..._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
@@ -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 (cons...
2015 Mar 13
0
Re: [PATCH] part-list: add support for show partition type
...# 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;
>...
2015 Jun 17
2
[PATCH] daemon: parted: Always use -s option even with -m.
...---
daemon/parted.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/daemon/parted.c b/daemon/parted.c
index a36e4e7..59760b4 100644
--- a/daemon/parted.c
+++ b/daemon/parted.c
@@ -356,7 +356,7 @@ print_partition_table (const char *device,
int r;
if (PARTED_OPT_HAS_M == parted_has_m_opt)
- r = command (&out, &err, str_parted, "-m", "--", device,
+ r = command (&out, &err, str_parted, "-m", "-s", "--", device,
"unit", "b",
"print", NULL);
else...
2015 Jun 17
0
Re: [PATCH] daemon: parted: Always use -s option even with -m.
...1 insertion(+), 1 deletion(-)
>
> diff --git a/daemon/parted.c b/daemon/parted.c
> index a36e4e7..59760b4 100644
> --- a/daemon/parted.c
> +++ b/daemon/parted.c
> @@ -356,7 +356,7 @@ print_partition_table (const char *device,
> int r;
>
> if (PARTED_OPT_HAS_M == parted_has_m_opt)
> - r = command (&out, &err, str_parted, "-m", "--", device,
> + r = command (&out, &err, str_parted, "-m", "-s", "--", device,
> "unit", "b",
> "print&q...
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)
2012 Aug 30
2
[PATCH v2] daemon: collect list of called external commands
..."-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");
@@ -356,11 +359,11 @@ print_partition_table (const char *device, int parted_has_m_opt)
int r;
if (parted_has_m_opt)
- r = command (&out, &err, "parted", "-m", "--", device,
+ r = command (&out, &err, str_parted, "-m", "--", device,
"unit", "b",
&quo...
2012 Aug 30
1
[PATCH] collect list of called external commands
..."-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");
@@ -356,11 +359,11 @@ print_partition_table (const char *device, int parted_has_m_opt)
int r;
if (parted_has_m_opt)
- r = command (&out, &err, "parted", "-m", "--", device,
+ r = command (&out, &err, str_parted, "-m", "--", device,
"unit", "b",
&quo...