Displaying 20 results from an estimated 29 matches for "str_sfdisk".
2015 Jan 28
1
[PATCH] daemon: parted: use --part-type with recent sfdisk
...ugh to have --part-type, to be used instead
+ * of --print-id and --change-id.
+ */
+static int
+test_sfdisk_has_part_type (void)
+{
+ static int tested = -1;
+
+ if (tested != -1)
+ return tested;
+
+ int r;
+ CLEANUP_FREE char *out = NULL, *err = NULL;
+
+ r = command (&out, &err, str_sfdisk, "--help", NULL);
+ if (r == -1) {
+ reply_with_error ("%s: %s", "sfdisk --help", err);
+ return -1;
+ }
+
+ tested = strstr (out, "--part-type") != NULL;
+ return tested;
+}
+
/* Currently we use sfdisk for getting and setting the ID byte. In
*...
2015 Mar 24
2
Re: [PATCH] New API: part_get_part_type for showing partition type
...131 insertions(+), 1 deletion(-)
> >
> > diff --git a/daemon/parted.c b/daemon/parted.c
> > index a7bcb99..0ae6e5c 100644
> > --- a/daemon/parted.c
> > +++ b/daemon/parted.c
> > @@ -33,6 +33,10 @@ GUESTFSD_EXT_CMD(str_parted, parted);
> > GUESTFSD_EXT_CMD(str_sfdisk, sfdisk);
> > GUESTFSD_EXT_CMD(str_sgdisk, sgdisk);
> >
> > +#ifndef PARTED_NO_M
> > +# define PARTED_NO_M 0
> > +#endif
>
> What does this bit do?
I want to use print_partition_table(xxx, 0)
but do not want to pass a raw '0'.
Maybe the name is not so...
2015 Mar 24
1
Re: [PATCH] New API: part_get_part_type for showing partition type
...gt; diff --git a/daemon/parted.c b/daemon/parted.c
> > > > index a7bcb99..0ae6e5c 100644
> > > > --- a/daemon/parted.c
> > > > +++ b/daemon/parted.c
> > > > @@ -33,6 +33,10 @@ GUESTFSD_EXT_CMD(str_parted, parted);
> > > > GUESTFSD_EXT_CMD(str_sfdisk, sfdisk);
> > > > GUESTFSD_EXT_CMD(str_sgdisk, sgdisk);
> > > >
> > > > +#ifndef PARTED_NO_M
> > > > +# define PARTED_NO_M 0
> > > > +#endif
> > >
> > > What does this bit do?
> >
> > I want to use print_part...
2015 Mar 24
1
Re: [PATCH 1/2] parted: introduce enum for whether parted has option -m
...8 insertions(+), 12 deletions(-)
> >
> > diff --git a/daemon/parted.c b/daemon/parted.c
> > index a7bcb99..64a7d3c 100644
> > --- a/daemon/parted.c
> > +++ b/daemon/parted.c
> > @@ -33,6 +33,12 @@ GUESTFSD_EXT_CMD(str_parted, parted);
> > GUESTFSD_EXT_CMD(str_sfdisk, sfdisk);
> > GUESTFSD_EXT_CMD(str_sgdisk, sgdisk);
> >
> > +enum {
> > + PARTED_INVALID = -1,
> > + /* parted do not support -m option */
> > + PARTED_OPT_NO_M,
> > + PARTED_OPT_HAS_M};
>
> (I didn't have even the time to reply to the que...
2015 Mar 24
1
[PATCH 1/2] parted: introduce enum for whether parted has option -m
...daemon/parted.c | 30 ++++++++++++++++++------------
1 file changed, 18 insertions(+), 12 deletions(-)
diff --git a/daemon/parted.c b/daemon/parted.c
index a7bcb99..64a7d3c 100644
--- a/daemon/parted.c
+++ b/daemon/parted.c
@@ -33,6 +33,12 @@ GUESTFSD_EXT_CMD(str_parted, parted);
GUESTFSD_EXT_CMD(str_sfdisk, sfdisk);
GUESTFSD_EXT_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 *lin...
2015 Mar 17
4
[PATCH] New API: part_get_part_type for showing partition type
...s.ml | 18 +++++++++
src/MAX_PROC_NR | 2 +-
3 files changed, 131 insertions(+), 1 deletion(-)
diff --git a/daemon/parted.c b/daemon/parted.c
index a7bcb99..0ae6e5c 100644
--- a/daemon/parted.c
+++ b/daemon/parted.c
@@ -33,6 +33,10 @@ GUESTFSD_EXT_CMD(str_parted, parted);
GUESTFSD_EXT_CMD(str_sfdisk, sfdisk);
GUESTFSD_EXT_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
@@ -1022,3 +1026,111 @@ do_part_get_name (const char *device, int partnum)
reply_with_error ("cannot get t...
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
0
Re: [PATCH] New API: part_get_part_type for showing partition type
...gt; > >
> > > diff --git a/daemon/parted.c b/daemon/parted.c
> > > index a7bcb99..0ae6e5c 100644
> > > --- a/daemon/parted.c
> > > +++ b/daemon/parted.c
> > > @@ -33,6 +33,10 @@ GUESTFSD_EXT_CMD(str_parted, parted);
> > > GUESTFSD_EXT_CMD(str_sfdisk, sfdisk);
> > > GUESTFSD_EXT_CMD(str_sgdisk, sgdisk);
> > >
> > > +#ifndef PARTED_NO_M
> > > +# define PARTED_NO_M 0
> > > +#endif
> >
> > What does this bit do?
>
> I want to use print_partition_table(xxx, 0)
> but do not want to...
2015 Mar 24
0
Re: [PATCH 1/2] parted: introduce enum for whether parted has option -m
...-----------
> 1 file changed, 18 insertions(+), 12 deletions(-)
>
> diff --git a/daemon/parted.c b/daemon/parted.c
> index a7bcb99..64a7d3c 100644
> --- a/daemon/parted.c
> +++ b/daemon/parted.c
> @@ -33,6 +33,12 @@ GUESTFSD_EXT_CMD(str_parted, parted);
> GUESTFSD_EXT_CMD(str_sfdisk, sfdisk);
> GUESTFSD_EXT_CMD(str_sgdisk, sgdisk);
>
> +enum {
> + PARTED_INVALID = -1,
> + /* parted do not support -m option */
> + PARTED_OPT_NO_M,
> + PARTED_OPT_HAS_M};
(I didn't have even the time to reply to the question about this enum)
PARTED_INVALID does n...
2015 Mar 13
2
[PATCH] part-list: add support for show partition type
.../structs.ml | 1 +
resize/resize.ml | 2 +-
3 files changed, 82 insertions(+), 76 deletions(-)
diff --git a/daemon/parted.c b/daemon/parted.c
index a7bcb99..312b15f 100644
--- a/daemon/parted.c
+++ b/daemon/parted.c
@@ -33,6 +33,10 @@ GUESTFSD_EXT_CMD(str_parted, parted);
GUESTFSD_EXT_CMD(str_sfdisk, sfdisk);
GUESTFSD_EXT_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...
2015 Mar 23
0
Re: [PATCH] New API: part_get_part_type for showing partition type
...| 2 +-
> 3 files changed, 131 insertions(+), 1 deletion(-)
>
> diff --git a/daemon/parted.c b/daemon/parted.c
> index a7bcb99..0ae6e5c 100644
> --- a/daemon/parted.c
> +++ b/daemon/parted.c
> @@ -33,6 +33,10 @@ GUESTFSD_EXT_CMD(str_parted, parted);
> GUESTFSD_EXT_CMD(str_sfdisk, sfdisk);
> GUESTFSD_EXT_CMD(str_sgdisk, sgdisk);
>
> +#ifndef PARTED_NO_M
> +# define PARTED_NO_M 0
> +#endif
What does this bit do?
> /* Notes:
> *
> * Parted 1.9 sends error messages to stdout, hence use of the
> @@ -1022,3 +1026,111 @@ do_part_get_name (cons...
2017 Jul 14
0
[PATCH 10/27] daemon: Reimplement ‘part_get_mbr_id’ API in OCaml.
...= test_sfdisk_has_part_type () ? "--part-type" : "--print-id";
-
- char partnum_str[16];
- snprintf (partnum_str, sizeof partnum_str, "%d", partnum);
-
- CLEANUP_FREE char *out = NULL, *err = NULL;
- int r;
-
- udev_settle ();
-
- r = command (&out, &err, str_sfdisk, param, device, partnum_str, NULL);
- if (r == -1) {
- reply_with_error ("sfdisk %s: %s", param, err);
- return -1;
- }
-
- udev_settle ();
-
- /* It's printed in hex ... */
- unsigned id;
- if (sscanf (out, "%x", &id) != 1) {
- reply_with_error ("sfd...
2012 Aug 30
2
[PATCH v2] daemon: collect list of called external commands
...-ignore-fs-check" : "",
diff --git a/daemon/parted.c b/daemon/parted.c
index ceefc4a..cc9a84b 100644
--- a/daemon/parted.c
+++ b/daemon/parted.c
@@ -28,6 +28,9 @@
#include "daemon.h"
#include "actions.h"
+GUESTFSD_EXT_CMD(str_parted, parted);
+GUESTFSD_EXT_CMD(str_sfdisk, sfdisk);
+
/* Notes:
*
* Parted 1.9 sends error messages to stdout, hence use of the
@@ -82,7 +85,7 @@ do_part_init (const char *device, const char *parttype)
udev_settle ();
r = commandf (NULL, &err, COMMAND_FLAG_FOLD_STDOUT_ON_STDERR,
- "parted", "-...
2012 Aug 30
1
[PATCH] collect list of called external commands
...--ignore-fs-check" : "",
diff --git a/daemon/parted.c b/daemon/parted.c
index ceefc4a..eab892f 100644
--- a/daemon/parted.c
+++ b/daemon/parted.c
@@ -28,6 +28,9 @@
#include "daemon.h"
#include "actions.h"
+GUESTFS_EXT_CMD(str_parted, parted);
+GUESTFS_EXT_CMD(str_sfdisk, sfdisk);
+
/* Notes:
*
* Parted 1.9 sends error messages to stdout, hence use of the
@@ -82,7 +85,7 @@ do_part_init (const char *device, const char *parttype)
udev_settle ();
r = commandf (NULL, &err, COMMAND_FLAG_FOLD_STDOUT_ON_STDERR,
- "parted", "-...
2015 Mar 13
0
Re: [PATCH] part-list: add support for show partition type
...| 2 +-
> 3 files changed, 82 insertions(+), 76 deletions(-)
>
> diff --git a/daemon/parted.c b/daemon/parted.c
> index a7bcb99..312b15f 100644
> --- a/daemon/parted.c
> +++ b/daemon/parted.c
> @@ -33,6 +33,10 @@ GUESTFSD_EXT_CMD(str_parted, parted);
> GUESTFSD_EXT_CMD(str_sfdisk, sfdisk);
> GUESTFSD_EXT_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)
&...
2017 Jul 27
0
[PATCH v2] daemon: Remove GUESTFSD_EXT_CMD.
...fs-check" : "",
diff --git a/daemon/parted.c b/daemon/parted.c
index 03e83cb32..7446bc93e 100644
--- a/daemon/parted.c
+++ b/daemon/parted.c
@@ -30,10 +30,6 @@
#include "actions.h"
#include "optgroups.h"
-GUESTFSD_EXT_CMD(str_parted, parted);
-GUESTFSD_EXT_CMD(str_sfdisk, sfdisk);
-GUESTFSD_EXT_CMD(str_sgdisk, sgdisk);
-
/* Notes:
*
* Parted 1.9 sends error messages to stdout, hence use of the
@@ -88,7 +84,7 @@ do_part_init (const char *device, const char *parttype)
udev_settle ();
r = commandf (NULL, &err, COMMAND_FLAG_FOLD_STDOUT_ON_STDERR,
-...
2012 Dec 14
1
[PATCH] Add support for getting and setting GPT partition type GUIDs
...nce/packagelist.in
@@ -111,6 +111,7 @@ dosfstools
file
findutils
gawk
+gdisk
grep
gzip
jfsutils
diff --git a/daemon/parted.c b/daemon/parted.c
index cc9a84b..01ae91c 100644
--- a/daemon/parted.c
+++ b/daemon/parted.c
@@ -30,6 +30,7 @@
GUESTFSD_EXT_CMD(str_parted, parted);
GUESTFSD_EXT_CMD(str_sfdisk, sfdisk);
+GUESTFSD_EXT_CMD(str_sgdisk, sgdisk);
/* Notes:
*
@@ -802,3 +803,131 @@ do_part_set_mbr_id (const char *device, int partnum, int idbyte)
return 0;
}
+
+int
+do_part_set_gpt_type(const char *device, int partnum, const char *guid)
+{
+ if (partnum <= 0) {
+ reply_with_err...
2017 Jul 24
0
[PATCH 2/2] daemon: Replace GUESTFSD_EXT_CMD with --print-external-commands.
...-fs-check" : "",
diff --git a/daemon/parted.c b/daemon/parted.c
index 03e83cb32..f93d710c5 100644
--- a/daemon/parted.c
+++ b/daemon/parted.c
@@ -30,9 +30,7 @@
#include "actions.h"
#include "optgroups.h"
-GUESTFSD_EXT_CMD(str_parted, parted);
-GUESTFSD_EXT_CMD(str_sfdisk, sfdisk);
-GUESTFSD_EXT_CMD(str_sgdisk, sgdisk);
+DECLARE_EXTERNAL_COMMANDS ("parted", "sfdisk", "sgdisk")
/* Notes:
*
@@ -88,7 +86,7 @@ do_part_init (const char *device, const char *parttype)
udev_settle ();
r = commandf (NULL, &err, COMMAND_FLAG_FOLD...
2017 Jul 27
3
[PATCH v2] daemon: Remove GUESTFSD_EXT_CMD.
This is a simpler patch that removes GUESTFSD_EXT_CMD completely.
2017 Jul 24
6
[PATCH 0/2] daemon: Replace GUESTFSD_EXT_CMD with --print-external-commands.
Replace GUESTFSD_EXT_CMD with a command line option
‘./guestfsd --print-external-commands’