search for: sgdisk_info_extract_field

Displaying 20 results from an estimated 23 matches for "sgdisk_info_extract_field".

2017 Mar 02
2
[PATCH] parted: add more udev_settle calls.
add udev_settle calls to print_partition_table and sgdisk_info_extract_field because the inspect-os calls guestfs_part_get_parttype and guestfs_part_get_gpt_guid for all parition devices found and this causes intermittent with opening block devices that are certainly present yet RESOLVE_DEVICE macro would fail wiht ENOENT. --- daemon/parted.c | 9 +++++++++ 1 file changed,...
2018 Jan 10
6
[PATCH 0/3] Handle GPT attribute flags
Hi all, Here is the series fixing the bug I mentioned on IRC regarding the GPT attribute flags to copy to the new disk in a virt-resize. Cédric Bosdonnat (3): daemon: make sgdisk_info_extract_uuid_field more generic New APIs: part_set_gpt_attributes and part_get_gpt_attributes resize: copy GPT partition flags daemon/parted.ml | 34 +++++++++++++++++++++++++++-------
2018 Jan 10
0
[PATCH 2/3] New APIs: part_set_gpt_attributes and part_get_gpt_attributes
...^ ":=:" ^ attributes in + let r, _, err = + commandr ~fold_stdout_on_stderr:true + "sgdisk" [ device; "-A"; arg ] in + if r <> 0 then + failwithf "sgdisk: %s" err; + + udev_settle () let rec part_get_gpt_type device partnum = sgdisk_info_extract_field device partnum "Partition GUID code" @@ -132,6 +144,8 @@ let rec part_get_gpt_type device partnum = and part_get_gpt_guid device partnum = sgdisk_info_extract_field device partnum "Partition unique GUID" ("-" ^ hex_chars) +and part_get_...
2018 Jan 15
6
[PATCH v2 0/3] copying gpt attributes
Hi all, Here is the latest version of the series addressing Pino's comments. Cédric Bosdonnat (3): daemon: make sgdisk_info_extract_uuid_field more generic New APIs: part_set_gpt_attributes and part_get_gpt_attributes resize: copy GPT partition flags daemon/parted.ml | 45 +++++++++++++++++++++++++++++++++++---------- daemon/parted.mli | 3 +++
2018 Jan 16
4
[PATCH v3 0/3] copy GPT attributes
Hi all, Here is v3 of the series, taking Richard's comments in account. Cédric Bosdonnat (3): daemon: make sgdisk_info_extract_uuid_field more generic New APIs: part_set_gpt_attributes and part_get_gpt_attributes resize: copy GPT partition flags daemon/parted.ml | 45 +++++++++++++++++++++++++++++++++++---------- daemon/parted.mli | 2 ++ generator/actions_core.ml
2018 Jan 10
0
[PATCH 1/3] daemon: make sgdisk_info_extract_uuid_field more generic
Rename the sgdisk_info_extract_uuid_field to sgdisk_info_extract_field in order to reuse it for other field types. To avoid possible confusion, the list of valid characters used to extract the value is added to the function parameters. --- daemon/parted.ml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/daemon/parted.ml b/daemo...
2018 Jan 15
0
[PATCH v2 1/3] daemon: make sgdisk_info_extract_uuid_field more generic
Rename the sgdisk_info_extract_uuid_field to sgdisk_info_extract_field in order to reuse it for other field types. Just like its C ancestor, it now needs an extractor function to be passed as parameter. --- daemon/parted.ml | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/daemon/parted.ml b/daemon/parted.ml index d6638867a....
2018 Jan 16
0
[PATCH v3 2/3] New APIs: part_set_gpt_attributes and part_get_gpt_attributes
...ters. *) String.sub value 0 (String.span value "-0123456789ABCDEF") +let extract_hex value = + (* The value contains only valid numeric characters. *) + let str = String.sub value 0 (String.span value "0123456789ABCDEF") in + Int64.of_string ("0x" ^ str) + let sgdisk_info_extract_field device partnum field extractor = if partnum <= 0 then failwith "partition number must be >= 1"; @@ -179,3 +199,6 @@ let rec part_get_gpt_type device partnum = and part_get_gpt_guid device partnum = sgdisk_info_extract_field device partnum "Partition unique GUID"...
2018 Jan 15
0
[PATCH v2 2/3] New APIs: part_set_gpt_attributes and part_get_gpt_attributes
...ters. *) String.sub value 0 (String.span value "-0123456789ABCDEF") +let extract_hex value = + (* The value contains only valid numeric characters. *) + let str = String.sub value 0 (String.span value "0123456789ABCDEF") in + Int64.of_string ("0x" ^ str) + let sgdisk_info_extract_field device partnum field extractor = if partnum <= 0 then failwith "partition number must be >= 1"; @@ -179,3 +199,6 @@ let rec part_get_gpt_type device partnum = and part_get_gpt_guid device partnum = sgdisk_info_extract_field device partnum "Partition unique GUID"...
2014 Feb 04
0
[PATCH 2/3] New API: part-get-name (RHBZ#593511).
...== '"'))) { + value_len -= 2; + ++value; + } + + char *ret = strndup (value, value_len); + if (ret == NULL) { + reply_with_perror ("strndup"); + return NULL; + } + + return ret; +} + char * do_part_get_gpt_type (const char *device, int partnum) { return sgdisk_info_extract_field (device, partnum, "Partition GUID code", extract_uuid); } + +char * +do_part_get_name (const char *device, int partnum) +{ + char *parttype = do_part_get_parttype (device); + if (STREQ (parttype, "gpt")) + return sgdisk_info_extract_fie...
2014 Feb 04
6
[PATCH 0/3] virt-resize: preserve GPT partitions label
Hi, attached there are few patches to implement a way to get the label of GPT partitions (refactoring an existing function and adding a new daemon API) and using it in virt-resize to restore them when copying partitions. Thanks, Pino Toscano (3): daemon: parted: refactor sgdisk info parsing code New API: part-get-name (RHBZ#593511). resize: preserve GPT partition names (RHBZ#1060404).
2014 Feb 04
0
[PATCH 1/3] daemon: parted: refactor sgdisk info parsing code
...a/daemon/parted.c b/daemon/parted.c index bd81986..5282adb 100644 --- a/daemon/parted.c +++ b/daemon/parted.c @@ -784,8 +784,9 @@ do_part_set_gpt_type(const char *device, int partnum, const char *guid) return 0; } -char * -do_part_get_gpt_type(const char *device, int partnum) +static char * +sgdisk_info_extract_field (const char *device, int partnum, const char *field, + char *(*extract) (const char *path)) { if (partnum <= 0) { reply_with_error ("partition number must be >= 1"); @@ -814,6 +815,8 @@ do_part_get_gpt_type(const char *device, int partnum) ret...
2015 Feb 05
5
resize: Preserve GPT GUID so we don't break EFI bootloaders (RHBZ#1189284)
virt-resize didn't preserve the per-partition GPT GUID. Now that guests using UEFI are becoming common (basically it's the default on aarch64) we need to take into account that sometimes the partition GUID is used by the bootloader NVRAM variables to identify the boot partition, so it must be preserved across resize. This bug caused the 'virt-builder --size' option to fail on
2017 Jul 27
0
[PATCH v2] daemon: Remove GUESTFSD_EXT_CMD.
...sk", device, "-u", typecode, NULL); if (r == -1) { - reply_with_error ("%s %s -u %s: %s", str_sgdisk, device, typecode, err); + reply_with_error ("%s %s -u %s: %s", "sgdisk", device, typecode, err); return -1; } @@ -674,10 +670,10 @@ sgdisk_info_extract_field (const char *device, int partnum, const char *field, CLEANUP_FREE char *err = NULL; int r = commandf (NULL, &err, COMMAND_FLAG_FOLD_STDOUT_ON_STDERR, - str_sgdisk, device, "-i", partnum_str, NULL); + "sgdisk", device, "-i&qu...
2017 Jul 24
0
[PATCH 2/2] daemon: Replace GUESTFSD_EXT_CMD with --print-external-commands.
...sk", device, "-u", typecode, NULL); if (r == -1) { - reply_with_error ("%s %s -u %s: %s", str_sgdisk, device, typecode, err); + reply_with_error ("%s %s -u %s: %s", "sgdisk", device, typecode, err); return -1; } @@ -674,10 +672,10 @@ sgdisk_info_extract_field (const char *device, int partnum, const char *field, CLEANUP_FREE char *err = NULL; int r = commandf (NULL, &err, COMMAND_FLAG_FOLD_STDOUT_ON_STDERR, - str_sgdisk, device, "-i", partnum_str, NULL); + "sgdisk", device, "-i&qu...
2017 Jul 27
3
[PATCH v2] daemon: Remove GUESTFSD_EXT_CMD.
This is a simpler patch that removes GUESTFSD_EXT_CMD completely.
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
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 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.