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

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