search for: part_get_gpt_type

Displaying 20 results from an estimated 42 matches for "part_get_gpt_type".

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 10
0
[PATCH 2/3] New APIs: part_set_gpt_attributes and part_get_gpt_attributes
...; + + let arg = string_of_int partnum ^ ":=:" ^ 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"...
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 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
2012 Dec 14
1
[PATCH] Add support for getting and setting GPT partition type GUIDs
New APIs: part_set_gpt_type part_get_gpt_type --- appliance/packagelist.in | 1 + daemon/parted.c | 129 +++++++++++++++++++++++++++++++++++++++++++++++ generator/actions.ml | 30 +++++++++++ generator/tests_c_api.ml | 7 +++ generator/types.ml | 5 ++ src/MAX_PROC_NR | 2 +- 6 files changed, 173 insertion...
2016 Jun 13
1
[PATCH] v2v: Fix get_firmware_bootable_device.
I'm going to push this because it's a test blocker, but FYI. Rich.
2018 Jan 15
0
[PATCH v2 1/3] daemon: make sgdisk_info_extract_uuid_field more generic
...+), 10 deletions(-) diff --git a/daemon/parted.ml b/daemon/parted.ml index d6638867a..6fe803613 100644 --- a/daemon/parted.ml +++ b/daemon/parted.ml @@ -124,12 +124,11 @@ let part_get_parttype device = | _ -> failwithf "%s: cannot parse the output of parted" device -let rec part_get_gpt_type device partnum = - sgdisk_info_extract_uuid_field device partnum "Partition GUID code" -and part_get_gpt_guid device partnum = - sgdisk_info_extract_uuid_field device partnum "Partition unique GUID" +let extract_guid value = + (* The value contains only valid GUID characters....
2018 Jan 16
0
[PATCH v3 2/3] New APIs: part_set_gpt_attributes and part_get_gpt_attributes
...et 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" extract_guid +and part_get_gpt_attributes device partnum = + sgdisk_info_extract_field device partnum "Attribute flags" +...
2018 Jan 15
0
[PATCH v2 2/3] New APIs: part_set_gpt_attributes and part_get_gpt_attributes
...et 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" extract_guid +and part_get_gpt_attributes device partnum = + sgdisk_info_extract_field device partnum "Attribute flags" +...
2018 May 02
6
[PATCH v7 0/6] daemon: list_filesystems: filter out block devices which cannot hold filesystem.
This patch series addresses comments after v6 series 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 the way we filter out LDM partitions. daemon: list-filesystems: Filter out
2018 Jun 01
7
[PATCH v8 0/6] daemon: list_filesystems: filter out block devices which cannot hold filesystem.
v8: - Rebased on top of master. v7: - Addresses comments after v6 series review. v6: - Addresses comments after v5 series review. - Large commit is splitted to more granular commits for better code review. v5: - Addresses comments after v4 series review (part_get_mbr_part_type doesn't break original implementation in C). - Rebased on top of master and little bit refactored for
2018 Jan 10
0
[PATCH 1/3] daemon: make sgdisk_info_extract_uuid_field more generic
...ml b/daemon/parted.ml index d6638867a..cf1a54a08 100644 --- a/daemon/parted.ml +++ b/daemon/parted.ml @@ -124,12 +124,16 @@ let part_get_parttype device = | _ -> failwithf "%s: cannot parse the output of parted" device +let hex_chars = "0123456789ABCDEF" + let rec part_get_gpt_type device partnum = - sgdisk_info_extract_uuid_field device partnum "Partition GUID code" + sgdisk_info_extract_field device partnum "Partition GUID code" + ("-" ^ hex_chars) and part_get_gpt_guid device partnum = - sgdisk_info_extract_uuid_...
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.
...git a/daemon/parted.mli b/daemon/parted.mli index d547f2f..0f59d29 100644 --- a/daemon/parted.mli +++ b/daemon/parted.mli @@ -28,6 +28,8 @@ val part_list : string -> partition list val part_get_parttype : string -> string +val part_get_mbr_part_type : string -> int -> string + val part_get_gpt_type : string -> int -> string val part_get_gpt_guid : string -> int -> string val part_get_gpt_attributes : string -> int -> int64 diff --git a/generator/actions_core.ml b/generator/actions_core.ml index 544cb6e..307e414 100644 --- a/generator/actions_core.ml +++ b/generator/actions...
2018 Jan 28
0
[PATCH v3 1/3] daemon: Reimplement 'part_get_mbr_part_type' API in OCaml.
...git a/daemon/parted.mli b/daemon/parted.mli index d547f2f..0f59d29 100644 --- a/daemon/parted.mli +++ b/daemon/parted.mli @@ -28,6 +28,8 @@ val part_list : string -> partition list val part_get_parttype : string -> string +val part_get_mbr_part_type : string -> int -> string + val part_get_gpt_type : string -> int -> string val part_get_gpt_guid : string -> int -> string val part_get_gpt_attributes : string -> int -> int64 diff --git a/generator/actions_core.ml b/generator/actions_core.ml index 544cb6e..307e414 100644 --- a/generator/actions_core.ml +++ b/generator/actions...
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)
2014 Feb 03
2
[PATCH] resize: properly restore GPT partition types
...le "/dev/sda" part_num in - let mbr_id = - try Some (g#part_get_mbr_id "/dev/sda" part_num) - with G.Error _ -> None in + let mbr_id, gpt_type = + match parttype with + | GPT -> + None, (try Some (g#part_get_gpt_type "/dev/sda" part_num) + with G.Error _ -> None) + | MBR -> + (try Some (g#part_get_mbr_id "/dev/sda" part_num) + with G.Error _ -> None), None in let typ = if is_extended_partition mbr_id th...
2018 Apr 27
0
[PATCH v5 2/3] daemon: list-filesystems: Don't list partitions which cannot hold file system.
...mbr_type = Parted.part_get_mbr_part_type device partnum in + mbr_type = "extended" + ) + else false in + + let is_gpt_ignored = + if is_gpt_or_mbr then ( + (* MBR partition id will be converted into corresponding GPT type. *) + let gpt_type = Parted.part_get_gpt_type device partnum in + is_ignored_gpt_type gpt_type + ) + else false in + + not (is_mbr_extended || is_gpt_ignored) + with exn -> + if verbose () then + eprintf "check_partition: %s: %s\n" + partition (Printexc.to_string exn); + t...
2016 Jun 10
0
Re: [PATCH 1/2] v2v: fill the list of the EFI system partitions
...t is probably a bug in libguestfs. root=%s fmt=%s") root fmt > > -and has_uefi_bootable_device g = > +and get_uefi_bootable_device g = > let rec uefi_ESP_guid = "C12A7328-F81F-11D2-BA4B-00A0C93EC93B" > and is_uefi_ESP dev { G.part_num = partnum } = > g#part_get_gpt_type dev (Int32.to_int partnum) = uefi_ESP_guid > + and part_dev_name dev { G.part_num = partnum } = > + sprintf "%s%d" dev (Int32.to_int partnum) > and parttype_is_gpt dev = > try g#part_get_parttype dev = "gpt" > with G.Error msg as exn -> > @@...
2018 Jan 25
0
[PATCH v2 2/3] daemon: list-filesystems: Don't list partitions which cannot hold file system.
...= Devsparts.part_to_partnum partition in + + let parttype = Parted.part_get_parttype device in + let is_gpt = parttype = "gpt" in + let is_mbr = parttype = "msdos" in + + (* MBR partition id will be converted into corresponding GPT type. *) + let gpt_type = Parted.part_get_gpt_type device partnum in + + let is_ldm = gpt_type = gpt_ldm_metadata || gpt_type = gpt_ldm_data in + let is_ldm = Ldm.available () && (is_gpt || is_mbr) && is_ldm in + let is_msr = is_gpt && gpt_type = gpt_msr in + + let mbr_type = Parted.part_get_mbr_part_type device...