mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
v2v: -i libvirtxml: Detect disk format using any <driver type=...> field.
Previously we only looked for <driver name=qemu type=...>. However for Xen imports, the name field could be name=tap (or other values in fact). Since there can only be one <driver/> element under <disk/>, look for any <driver type=...> in order to get the disk format. A further complication for Xen is that type=aio means "raw" (for obscure historical reasons), so map that. Thanks: Dan Berrangé.
This commit is contained in:
@@ -129,8 +129,10 @@ let parse_libvirt_xml ?(map_source_file = no_map) ?(map_source_dev = no_map)
|
||||
if target_dev <> "" then Some target_dev else None in
|
||||
|
||||
let format =
|
||||
let format = xpath_to_string "driver[@name='qemu']/@type" "" in
|
||||
if format <> "" then Some format else None in
|
||||
match xpath_to_string "driver/@type" "" with
|
||||
| "aio" -> Some "raw" (* Xen wierdness *)
|
||||
| "" -> None
|
||||
| format -> Some format in
|
||||
|
||||
(* The <disk type='...'> attribute may be 'block', 'file' or
|
||||
* 'network'. We ignore any other types.
|
||||
|
||||
Reference in New Issue
Block a user