[Pkg-libvirt-commits] [libguestfs] 29/63: v2v: -i libvirtxml: Detect disk format using any <driver type=...> field.

Hilko Bengen bengen at moszumanska.debian.org
Fri Oct 3 14:43:27 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to annotated tag debian/1%1.27.39-1
in repository libguestfs.

commit 0c295c8e23a90d3a3f5efcfa0452ecde7317e122
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Thu Sep 4 12:37:12 2014 +0100

    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é.
---
 v2v/input_libvirtxml.ml | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/v2v/input_libvirtxml.ml b/v2v/input_libvirtxml.ml
index 730ed0a..b9c1a87 100644
--- a/v2v/input_libvirtxml.ml
+++ b/v2v/input_libvirtxml.ml
@@ -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.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list