Blame SOURCES/0047-v2v-Cope-with-libvirt-vpx-esx-driver-which-does-not-.patch

62f9b7
From 992af0707ad54d39ec707da6daa6c4ca7c3fc69a Mon Sep 17 00:00:00 2001
62f9b7
From: "Richard W.M. Jones" <rjones@redhat.com>
62f9b7
Date: Wed, 24 Nov 2021 11:23:38 +0000
62f9b7
Subject: [PATCH] v2v: Cope with libvirt vpx/esx driver which does not set
62f9b7
 format
62f9b7
62f9b7
See discussion in this bug:
62f9b7
https://bugzilla.redhat.com/show_bug.cgi?id=2026199
62f9b7
62f9b7
Fixes: commit 40cfe6da0861ca6360f670e254c71ed923a0402f
62f9b7
(cherry picked from commit 59dc3293a9b4fdf11da8571c50e3e5badbb511c2)
62f9b7
---
62f9b7
 v2v/parse_libvirt_xml.ml | 8 ++++++--
62f9b7
 1 file changed, 6 insertions(+), 2 deletions(-)
62f9b7
62f9b7
diff --git a/v2v/parse_libvirt_xml.ml b/v2v/parse_libvirt_xml.ml
62f9b7
index 27e08135..e65fbf4a 100644
62f9b7
--- a/v2v/parse_libvirt_xml.ml
62f9b7
+++ b/v2v/parse_libvirt_xml.ml
62f9b7
@@ -273,7 +273,11 @@ let parse_libvirt_xml ?bandwidth ?conn xml =
62f9b7
         | Some "aio" -> "raw" (* Xen wierdness *)
62f9b7
         | Some format -> format
62f9b7
         | None ->
62f9b7
-           error (f_"<disk><driver type=\"format\"> attribute is missing from the libvirt XML") in
62f9b7
+           (* Some libvirt drivers don't set the format.  Typically
62f9b7
+            * this is the vpx/esx driver (see RHBZ#2026199).  We
62f9b7
+            * can assume "raw", as it will be overwritten later.
62f9b7
+            *)
62f9b7
+           "raw" in
62f9b7
 
62f9b7
       (* The <disk type='...'> attribute may be 'block', 'file',
62f9b7
        * 'network' or 'volume'.  We ignore any other types.
62f9b7
@@ -344,7 +348,7 @@ let parse_libvirt_xml ?bandwidth ?conn xml =
62f9b7
             match xpath_string "/volume/target/format/@type" with
62f9b7
             | Some format -> format
62f9b7
             | None ->
62f9b7
-               error (f_"<volume><target>.<format type=\"format\"> attribute is missing from the libvirt XML of volume %s") vol in
62f9b7
+               error (f_"<volume><target><format type=\"format\"> attribute is missing from the libvirt XML of volume %s") vol in
62f9b7
 
62f9b7
           (match xpath_string "/volume/@type" with
62f9b7
           | None | Some "file" ->
62f9b7
-- 
62f9b7
2.27.0
62f9b7