search for: partnum_str

Displaying 20 results from an estimated 27 matches for "partnum_str".

2015 Jan 28
1
[PATCH] daemon: parted: use --part-type with recent sfdisk
.... As a result * of using sfdisk, this won't work for non-MBR-style partitions, but @@ -695,6 +719,8 @@ do_part_get_mbr_id (const char *device, int partnum) return -1; } + const char *param = test_sfdisk_has_part_type () ? "--part-type" : "--print-id"; + char partnum_str[16]; snprintf (partnum_str, sizeof partnum_str, "%d", partnum); @@ -703,9 +729,9 @@ do_part_get_mbr_id (const char *device, int partnum) udev_settle (); - r = command (&out, &err, str_sfdisk, "--print-id", device, partnum_str, NULL); + r = command (&out...
2017 Jul 29
5
[PATCH 1/1] New partition API: part_resize
....c index 72e1b8420..f1205cadf 100644 --- a/daemon/parted.c +++ b/daemon/parted.c @@ -178,6 +178,37 @@ do_part_del (const char *device, int partnum) } int +do_part_resize (const char *device, int partnum, int64_t endsect) +{ + int r; + CLEANUP_FREE char *err = NULL; + char endstr[32]; + char partnum_str[16]; + + if (partnum <= 0) { + reply_with_error ("partition number must be >= 1"); + return -1; + } + + snprintf (partnum_str, sizeof partnum_str, "%d", partnum); + snprintf (endstr, sizeof endstr, "%" PRIi64 "s", endsect); + + udev_settle ()...
2012 Dec 14
1
[PATCH] Add support for getting and setting GPT partition type GUIDs
...typecode); + free (err); + return -1; + } + free (typecode); + free (err); + + return 0; +} + +char * +do_part_get_gpt_type(const char *device, int partnum) +{ + if (partnum <= 0) { + reply_with_error ("partition number must be >= 1"); + return NULL; + } + + char *partnum_str = NULL; + if (asprintf (&partnum_str, "%i", partnum) == -1) { + reply_with_perror ("asprintf"); + return NULL; + } + + char *out = NULL, *err = NULL; + int r = command (&out, &err, str_sgdisk, device, "-i", partnum_str, NULL); + + if (r == -1) {...
2017 Jul 30
0
Re: [PATCH 1/1] New partition API: part_resize
...d.c > +++ b/daemon/parted.c > @@ -178,6 +178,37 @@ do_part_del (const char *device, int partnum) > } > > int > +do_part_resize (const char *device, int partnum, int64_t endsect) > +{ > + int r; > + CLEANUP_FREE char *err = NULL; > + char endstr[32]; > + char partnum_str[16]; > + > + if (partnum <= 0) { > + reply_with_error ("partition number must be >= 1"); > + return -1; > + } > + > + snprintf (partnum_str, sizeof partnum_str, "%d", partnum); > + snprintf (endstr, sizeof endstr, "%" PRIi64 &quo...
2012 Feb 06
2
[PATCH 1/2] Revert "daemon: Run udev_settle after pwrite-device finishes."
From: "Richard W.M. Jones" <rjones at redhat.com> This reverts commit a9c8123c72db47bcab8dd738e8d5256a9ae87f11. --- daemon/file.c | 18 +++--------------- daemon/parted.c | 3 +-- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/daemon/file.c b/daemon/file.c index 057e15d..91746e0 100644 --- a/daemon/file.c +++ b/daemon/file.c @@ -525,7 +525,7 @@
2017 Jul 14
0
[PATCH 10/27] daemon: Reimplement ‘part_get_mbr_id’ API in OCaml.
...- */ -int -do_part_get_mbr_id (const char *device, int partnum) -{ - if (partnum <= 0) { - reply_with_error ("partition number must be >= 1"); - return -1; - } - - const char *param = 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:...
2017 Mar 02
2
[PATCH] parted: add more udev_settle calls.
...+670,8 @@ sgdisk_info_extract_field (const char *device, int partnum, const char *field, return NULL; } + udev_settle (); + CLEANUP_FREE char *err = NULL; int r = commandf (NULL, &err, COMMAND_FLAG_FOLD_STDOUT_ON_STDERR, str_sgdisk, device, "-i", partnum_str, NULL); @@ -674,6 +681,8 @@ sgdisk_info_extract_field (const char *device, int partnum, const char *field, return NULL; } + udev_settle (); + CLEANUP_FREE_STRING_LIST char **lines = split_lines (err); if (lines == NULL) { reply_with_error ("'%s %s -i %i' returned...
2015 Jul 02
0
[PATCH] Fix various -Wformat problems.
...rinted in hex ... */ - int id; + unsigned id; if (sscanf (out, "%x", &id) != 1) { reply_with_error ("sfdisk --print-id: cannot parse output: %s", out); return -1; @@ -775,7 +775,8 @@ do_part_set_mbr_id (const char *device, int partnum, int idbyte) snprintf (partnum_str, sizeof partnum_str, "%d", partnum); char idbyte_str[16]; - snprintf (idbyte_str, sizeof partnum_str, "%x", idbyte); /* NB: hex */ + /* NB: hex */ + snprintf (idbyte_str, sizeof partnum_str, "%x", (unsigned) idbyte); CLEANUP_FREE char *err = NULL; int r...
2015 Jul 02
0
[PATCH v2] Fix various -Wformat problems.
...rinted in hex ... */ - int id; + unsigned id; if (sscanf (out, "%x", &id) != 1) { reply_with_error ("sfdisk --print-id: cannot parse output: %s", out); return -1; @@ -775,7 +775,8 @@ do_part_set_mbr_id (const char *device, int partnum, int idbyte) snprintf (partnum_str, sizeof partnum_str, "%d", partnum); char idbyte_str[16]; - snprintf (idbyte_str, sizeof partnum_str, "%x", idbyte); /* NB: hex */ + /* NB: hex */ + snprintf (idbyte_str, sizeof partnum_str, "%x", (unsigned) idbyte); CLEANUP_FREE char *err = NULL; int r...
2017 Jul 27
0
[PATCH v2] daemon: Remove GUESTFSD_EXT_CMD.
...eply_with_error ("parted: %s: %s", device, err); @@ -170,7 +166,7 @@ do_part_del (const char *device, int partnum) udev_settle (); r = commandf (NULL, &err, COMMAND_FLAG_FOLD_STDOUT_ON_STDERR, - str_parted, "-s", "--", device, "rm", partnum_str, NULL); + "parted", "-s", "--", device, "rm", partnum_str, NULL); if (r == -1) { reply_with_error ("parted: %s: %s", device, err); return -1; @@ -209,7 +205,7 @@ do_part_disk (const char *device, const char *parttype)...
2017 Jul 24
0
[PATCH 2/2] daemon: Replace GUESTFSD_EXT_CMD with --print-external-commands.
...eply_with_error ("parted: %s: %s", device, err); @@ -170,7 +168,7 @@ do_part_del (const char *device, int partnum) udev_settle (); r = commandf (NULL, &err, COMMAND_FLAG_FOLD_STDOUT_ON_STDERR, - str_parted, "-s", "--", device, "rm", partnum_str, NULL); + "parted", "-s", "--", device, "rm", partnum_str, NULL); if (r == -1) { reply_with_error ("parted: %s: %s", device, err); return -1; @@ -209,7 +207,7 @@ do_part_disk (const char *device, const char *parttype)...
2012 Aug 30
2
[PATCH v2] daemon: collect list of called external commands
...h_error ("parted: %s: %s", device, err); @@ -168,7 +171,7 @@ do_part_del (const char *device, int partnum) udev_settle (); r = commandf (NULL, &err, COMMAND_FLAG_FOLD_STDOUT_ON_STDERR, - "parted", "-s", "--", device, "rm", partnum_str, NULL); + str_parted, "-s", "--", device, "rm", partnum_str, NULL); if (r == -1) { reply_with_error ("parted: %s: %s", device, err); free (err); @@ -209,7 +212,7 @@ do_part_disk (const char *device, const char *parttype) udev_se...
2012 Aug 30
1
[PATCH] collect list of called external commands
...h_error ("parted: %s: %s", device, err); @@ -168,7 +171,7 @@ do_part_del (const char *device, int partnum) udev_settle (); r = commandf (NULL, &err, COMMAND_FLAG_FOLD_STDOUT_ON_STDERR, - "parted", "-s", "--", device, "rm", partnum_str, NULL); + str_parted, "-s", "--", device, "rm", partnum_str, NULL); if (r == -1) { reply_with_error ("parted: %s: %s", device, err); free (err); @@ -209,7 +212,7 @@ do_part_disk (const char *device, const char *parttype) udev_se...
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’
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.
2017 Jul 21
27
[PATCH v2 00/23] Reimplement many daemon APIs in OCaml.
v1 was posted here: https://www.redhat.com/archives/libguestfs/2017-July/msg00098.html This series now depends on two small patches which I posted separately: https://www.redhat.com/archives/libguestfs/2017-July/msg00207.html https://www.redhat.com/archives/libguestfs/2017-July/msg00209.html v1 -> v2: - Previously changes to generator/daemon.ml were made incrementally through the patch
2016 Feb 23
4
[PATCH v3 0/4] [FOR COMMENTS ONLY] Rework inspection.
Previously posted: https://www.redhat.com/archives/libguestfs/2015-December/msg00038.html Inspection now really succeeds on a small number of simple guests. To test it out: $ ./run guestfish -v -x -a /tmp/centos-6.img ><fs> run ><fs> debug sh "guestfs-inspection --verbose" Rich.
2017 Jul 14
45
[PATCH 00/27] Reimplement many daemon APIs in OCaml.
Previously posted as part of the mega utilities/inspection series here: https://www.redhat.com/archives/libguestfs/2017-June/msg00232.html What I've done is to extract just the parts related to rewriting daemon APIs in OCaml, rebase them on top of the current master, fix a few things, and recompile and test everything. Rich.
2017 Jun 03
12
[PATCH v2 00/12] Allow APIs to be implemented in OCaml.
Version 1 was here: https://www.redhat.com/archives/libguestfs/2017-June/msg00003.html This patch series reimplements a few more APIs in OCaml, including some very important core APIs like ?list_filesystems? and ?mount?. All the tests pass after this. The selection of APIs that I have moved may look a little random, but in fact they are all APIs consumed by the inspection code (and some more