mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
daemon: Reimplement 'part_get_mbr_part_type' API in OCaml.
Instead of parsing 'parted' output OCaml implementation relies on the following facts: 1. MBR partition table can hold up to 4 "primary" partitions. 2. Partition with number greater then 4 is "logical" partition. 3. Partition with number less then or equal to 4 with MBR ID 0x05 or 0x0f is "extended" partition (http://thestarman.pcministry.com/asm/mbr/PartTypes.htm; https://en.wikipedia.org/wiki/Partition_type) or "primary" otherwise.
This commit is contained in:
committed by
Richard W.M. Jones
parent
81d951239f
commit
994ca1f8eb
@@ -9213,6 +9213,7 @@ All data will be zeroed, but metadata and the like is preserved." };
|
||||
{ defaults with
|
||||
name = "part_get_mbr_part_type"; added = (1, 29, 32);
|
||||
style = RString (RPlainString, "partitiontype"), [String (Device, "device"); Int "partnum"], [];
|
||||
impl = OCaml "Parted.part_get_mbr_part_type";
|
||||
tests = [
|
||||
InitEmpty, Always, TestResultString (
|
||||
[["part_init"; "/dev/sda"; "mbr"];
|
||||
|
||||
Reference in New Issue
Block a user