+(* Get the source partition type. *)
+type parttype = MBR | GPT (* Only these are supported by virt-resize. *)
+
+let parttype, parttype_string =
+ let pt = g#part_get_parttype "/dev/sda" in
+ if debug then eprintf "partition table type: %s\n%!" pt;
+
+ match pt with
+ | "msdos" -> MBR, "msdos"
+ | "gpt" -> GPT, "gpt"
+ | _ ->
+ error "%s: unknown partition table type\nvirt-resize only supports MBR (DOS) and GPT partition tables." infile
+