[Pkg-libvirt-commits] [libguestfs] 33/146: v2v: -i ova: Remove incorrect warning for disks that have no parent controller (RHBZ#1167302).

Hilko Bengen bengen at moszumanska.debian.org
Sun Mar 29 17:00:11 UTC 2015


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

bengen pushed a commit to branch master
in repository libguestfs.

commit 6ce3b02bc079773b3396fe387aefa5cbbb0984f8
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Mon Nov 24 15:59:36 2014 +0000

    v2v: -i ova: Remove incorrect warning for disks that have no parent controller (RHBZ#1167302).
    
    Don't assume every disk <Item> has a <Parent> field.  For floppy disks
    this is not the case.
    
    Thanks: Junqin Zhou
    (cherry picked from commit 79fb3debc42b02a7104041f3279ab81bfff03b90)
---
 v2v/input_ova.ml | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/v2v/input_ova.ml b/v2v/input_ova.ml
index 95af2e5..9a9c10a 100644
--- a/v2v/input_ova.ml
+++ b/v2v/input_ova.ml
@@ -187,14 +187,17 @@ object
       for i = 0 to nr_nodes-1 do
         let n = Xml.xpathobj_node doc obj i in
         Xml.xpathctx_set_current_context xpathctx n;
-        let parent_id = xpath_to_int "rasd:Parent/text()" 0 in
 
         (* XXX We assume the OVF lists these in order.
         let address = xpath_to_int "rasd:AddressOnParent/text()" 0 in
         *)
 
         (* Find the parent controller. *)
-        let controller = parent_controller parent_id in
+        let parent_id = xpath_to_int "rasd:Parent/text()" 0 in
+        let controller =
+          match parent_id with
+          | 0 -> None
+          | id -> parent_controller id in
 
         Xml.xpathctx_set_current_context xpathctx n;
         let file_id = xpath_to_string "rasd:HostResource/text()" "" in
@@ -255,14 +258,17 @@ object
         Xml.xpathctx_set_current_context xpathctx n;
         let id = xpath_to_int "rasd:ResourceType/text()" 0 in
         assert (id = 14 || id = 15 || id = 16);
-        let parent_id = xpath_to_int "rasd:Parent/text()" 0 in
 
         (* XXX We assume the OVF lists these in order.
         let address = xpath_to_int "rasd:AddressOnParent/text()" 0 in
         *)
 
         (* Find the parent controller. *)
-        let controller = parent_controller parent_id in
+        let parent_id = xpath_to_int "rasd:Parent/text()" 0 in
+        let controller =
+          match parent_id with
+          | 0 -> None
+          | id -> parent_controller id in
 
         let typ =
           match id with

-- 
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