search for: extract_uuid

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

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(-) di...
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...
2014 Feb 04
0
[PATCH 2/3] New API: part-get-name (RHBZ#593511).
...3 +++++++++++++++++++++++++++++++++ generator/actions.ml | 13 +++++++++++++ src/MAX_PROC_NR | 2 +- 3 files changed, 47 insertions(+), 1 deletion(-) diff --git a/daemon/parted.c b/daemon/parted.c index 5282adb..83f2411 100644 --- a/daemon/parted.c +++ b/daemon/parted.c @@ -886,9 +886,42 @@ extract_uuid (const char *value) return ret; } +static char * +extract_optionally_quoted (const char *value) +{ + size_t value_len = strlen (value); + + if (value_len >= 2 && + ((value[0] == '\'' && value[value_len - 1] == '\'') || + (value[0] == ...
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
...BUG output for more details"); + /* If we got here it means we didn't find the field */ + reply_with_error ("sgdisk output did not contain '%s'. " + "See LIBGUESTFS_DEBUG output for more details", field); return NULL; } + +static char * +extract_uuid (const char *value) +{ + /* The value contains only valid GUID characters */ + size_t value_len = strspn (value, "-0123456789ABCDEF"); + + char *ret = malloc (value_len + 1); + if (ret == NULL) { + reply_with_perror ("malloc"); + return NULL; + } + + memcpy (ret, val...
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 +++++++++++++++++++++++++++------- daemon/parted.mli | 3 +++ generator/actions_core.ml | 40 ++++++++++++++++++++++++++++++++++++++++ gen...
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 +++ generator/actions_core.ml | 37 ++++++++++++++++++++++++++++++++++...
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 | 37 +++++++++++++++++++++++++++++++++++...
2016 Jan 19
0
[PATCHv2 1/3] New API: part_get_disk_guid and part_set_disk_guid.
...r (i = 0; lines[i] != NULL; ++i) { + if (STRPREFIX (lines[i], pattern)) { + char *value = lines[i] + strlen (pattern); + + /* Skip any leading whitespace */ + value += strspn (value, " \t"); + + /* Extract the actual information from the field. */ + char *ret = extract_uuid (value); + if (ret == NULL) { + /* The extraction function already sends the error. */ + return NULL; + } + + return ret; + } + } + + /* If we got here it means we didn't find the field */ + reply_with_error ("sgdisk output did not contain disk GUID. &quo...
2016 Jan 18
1
[PATCH] New API: part_get_disk_guid and part_set_disk_guid.
...r (i = 0; lines[i] != NULL; ++i) { + if (STRPREFIX (lines[i], pattern)) { + char *value = lines[i] + strlen (pattern); + + /* Skip any leading whitespace */ + value += strspn (value, " \t"); + + /* Extract the actual information from the field. */ + char *ret = extract_uuid (value); + if (ret == NULL) { + /* The extraction function already sends the error. */ + return NULL; + } + + return ret; + } + } + + /* If we got here it means we didn't find the field */ + reply_with_error ("sgdisk output did not contain disk GUID. &quo...
2018 Jan 28
0
[PATCH v3 1/3] daemon: Reimplement 'part_get_mbr_part_type' API in OCaml.
...== NULL) - goto error; - } else - goto error; - - return part_type; - } - - if (row == end) { - reply_with_error ("could not find partnum: %d", partnum); - return NULL; - } - - error: - reply_with_error ("strdup failed"); - return NULL; -} - static char * extract_uuid (const char *value) { diff --git a/daemon/parted.ml b/daemon/parted.ml index ce8da8a..75d9d37 100644 --- a/daemon/parted.ml +++ b/daemon/parted.ml @@ -125,6 +125,20 @@ let part_get_parttype device = | _ -> failwithf "%s: cannot parse the output of parted" device +let part_g...
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
2016 Jan 19
4
[PATCHv2 0/3] Get/set disk GPT GUID API and support in virt-resize.
Some OSes (e.g. Windows Server 2012 R2) fail to boot after virt-resize due to changed disk guid. To fix it, we add new APIs: part_get_disk_guid part_set_disk_guid part_set_disk_guid_random We also preserve disk GUID in virt-resize. Maxim Perevedentsev (3): New API: part_get_disk_guid and part_set_disk_guid. New API: part_set_disk_guid_random. resize: preserve GPT disk GUID.
2018 Jan 28
9
guestfs_list_filesystems: skip block devices which cannot hold file system
Initial discussion is here: https://www.redhat.com/archives/libguestfs/2018-January/msg00188.html. v2 was posted here: https://www.redhat.com/archives/libguestfs/2018-January/msg00246.html. v3 comparing to v2 is just a rebase with slightly changed commits comments.
2018 Jan 25
2
[PATCH v2 1/3] daemon: Reimplement 'part_get_mbr_part_type' API in OCaml.
...== NULL) - goto error; - } else - goto error; - - return part_type; - } - - if (row == end) { - reply_with_error ("could not find partnum: %d", partnum); - return NULL; - } - - error: - reply_with_error ("strdup failed"); - return NULL; -} - static char * extract_uuid (const char *value) { diff --git a/daemon/parted.ml b/daemon/parted.ml index ce8da8a..75d9d37 100644 --- a/daemon/parted.ml +++ b/daemon/parted.ml @@ -125,6 +125,20 @@ let part_get_parttype device = | _ -> failwithf "%s: cannot parse the output of parted" device +let part_g...
2018 Apr 27
4
[PATCH v5 0/3] libguestfs: guestfs_list_filesystems: skip block devices which cannot hold file system
This patch series: 1. Addresses comments from last review: part_get_mbr_part_type doesn't break original implementation in C. 2. Rebased on top of master and little bit refactored for readability. Mykola Ivanets (1): tests: md: Test guestfish list-filesystems command skips partitioned md devices. Nikolay Ivanets (2): daemon: Reimplement 'part_get_mbr_part_type' API in
2018 May 01
9
[PATCH v6 0/7] daemon: list_filesystems: filter out block devices which cannot hold filesystem
This patch series: 1. Addresses comments from v5 series review 2. Large commit is splitted to more granular commits for better code review. Mykola Ivanets (6): daemon: Changing the way that we detect if a device contains partitions. daemon: list-filesystems: Ignore partitioned MD devices. tests: list-filesystems command ignores partitioned MD devices. daemon: list-filesystems: Change
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 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.