Blame SOURCES/0021-RHEL-8-v2v-rhv-upload-Remove-restriction-on-oa-spars.patch

7ed5e3
From 4bd92b1fc4f830529b439c4a4e09281fcd9eab78 Mon Sep 17 00:00:00 2001
7ed5e3
From: "Richard W.M. Jones" <rjones@redhat.com>
7ed5e3
Date: Mon, 14 May 2018 10:16:58 +0100
7ed5e3
Subject: [PATCH] RHEL 8: v2v: rhv-upload: Remove restriction on -oa sparse.
7ed5e3
7ed5e3
See: https://bugzilla.redhat.com/show_bug.cgi?id=1565681
7ed5e3
and the v2v-devel private thread "Do we already support migration using FC?"
7ed5e3
---
7ed5e3
 docs/virt-v2v-output-rhv.pod |  8 +-------
7ed5e3
 v2v/output_rhv_upload.ml     | 10 +---------
7ed5e3
 v2v/rhv-upload-plugin.py     |  4 +---
7ed5e3
 3 files changed, 3 insertions(+), 19 deletions(-)
7ed5e3
7ed5e3
diff --git a/docs/virt-v2v-output-rhv.pod b/docs/virt-v2v-output-rhv.pod
7ed5e3
index 7c9b478a..36c3676f 100644
7ed5e3
--- a/docs/virt-v2v-output-rhv.pod
7ed5e3
+++ b/docs/virt-v2v-output-rhv.pod
7ed5e3
@@ -5,7 +5,7 @@ virt-v2v-output-rhv - Using virt-v2v to convert guests to oVirt or RHV
7ed5e3
 =head1 SYNOPSIS
7ed5e3
 
7ed5e3
  virt-v2v [-i* options] -o rhv-upload [-oc ENGINE_URL] -os STORAGE
7ed5e3
-                        [-op PASSWORD] [-of raw]
7ed5e3
+                        [-op PASSWORD]
7ed5e3
                         [-oo rhv-cafile=FILE]
7ed5e3
                         [-oo rhv-cluster=CLUSTER]
7ed5e3
                         [-oo rhv-direct]
7ed5e3
@@ -79,12 +79,6 @@ username is not specified then virt-v2v defaults to using
7ed5e3
 C<admin@internal> which is the typical superuser account for oVirt
7ed5e3
 instances.
7ed5e3
 
7ed5e3
-=item I<-of raw>
7ed5e3
-
7ed5e3
-Currently you must use I<-of raw> and you cannot use I<-oa preallocated>.
7ed5e3
-
7ed5e3
-These restrictions will be loosened in a future version.
7ed5e3
-
7ed5e3
 =item I<-op> F<password-file>
7ed5e3
 
7ed5e3
 A file containing a password to be used when connecting to the oVirt
7ed5e3
diff --git a/v2v/output_rhv_upload.ml b/v2v/output_rhv_upload.ml
7ed5e3
index 5c6c2611..81896e53 100644
7ed5e3
--- a/v2v/output_rhv_upload.ml
7ed5e3
+++ b/v2v/output_rhv_upload.ml
7ed5e3
@@ -135,17 +135,10 @@ let error_unless_nbdkit_compiled_with_selinux config =
7ed5e3
       error (f_"nbdkit was compiled without SELinux support.  You will have to recompile nbdkit with libselinux-devel installed, or else set SELinux to Permissive mode while doing the conversion.")
7ed5e3
   )
7ed5e3
 
7ed5e3
-(* Output sparse must be sparse.  We may be able to
7ed5e3
- * lift this limitation in future, but it requires changes on the
7ed5e3
- * RHV side.  See TODO file for details.  XXX
7ed5e3
- *)
7ed5e3
+(* Output format must be raw. *)
7ed5e3
 let error_current_limitation required_param =
7ed5e3
   error (f_"rhv-upload: currently you must use ā€˜%sā€™.  This restriction will be loosened in a future version.") required_param
7ed5e3
 
7ed5e3
-let error_unless_output_alloc_sparse output_alloc =
7ed5e3
-  if output_alloc <> Sparse then
7ed5e3
-    error_current_limitation "-oa sparse"
7ed5e3
-
7ed5e3
 let json_optstring = function
7ed5e3
   | Some s -> JSON.String s
7ed5e3
   | None -> JSON.Null
7ed5e3
@@ -247,7 +240,6 @@ object
7ed5e3
     error_unless_nbdkit_min_version config;
7ed5e3
     error_unless_nbdkit_python_plugin_working plugin_script;
7ed5e3
     error_unless_nbdkit_compiled_with_selinux config;
7ed5e3
-    error_unless_output_alloc_sparse output_alloc;
7ed5e3
 
7ed5e3
     (* Python code prechecks. *)
7ed5e3
     let precheck_fn = tmpdir // "v2vprecheck.json" in
7ed5e3
diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py
7ed5e3
index d3e6260e..471102da 100644
7ed5e3
--- a/v2v/rhv-upload-plugin.py
7ed5e3
+++ b/v2v/rhv-upload-plugin.py
7ed5e3
@@ -477,10 +477,8 @@ def create_disk(connection):
7ed5e3
             # size, based on qemu-img measure of the overlay.
7ed5e3
             initial_size=params['disk_size'],
7ed5e3
             provisioned_size=params['disk_size'],
7ed5e3
-            # XXX Ignores params['output_sparse'].
7ed5e3
-            # Handling this properly will be complex, see:
7ed5e3
             # https://www.redhat.com/archives/libguestfs/2018-March/msg00177.html
7ed5e3
-            sparse=True,
7ed5e3
+            sparse=params['output_sparse'],
7ed5e3
             storage_domains=[
7ed5e3
                 types.StorageDomain(
7ed5e3
                     name=params['output_storage'],
7ed5e3
-- 
446330
2.27.0
7ed5e3