Blame SOURCES/0002-RHEL-v2v-rhv-upload-Remove-restriction-on-oa-sparse.patch

c232e6
From abe3c7539b6221e8ab3cc35ee3d58b1aa06bbef4 Mon Sep 17 00:00:00 2001
c232e6
From: "Richard W.M. Jones" <rjones@redhat.com>
c232e6
Date: Mon, 14 May 2018 10:16:58 +0100
c232e6
Subject: [PATCH 02/12] RHEL: v2v: rhv-upload: Remove restriction on -oa
c232e6
 sparse.
c232e6
c232e6
See: https://bugzilla.redhat.com/show_bug.cgi?id=1565681
c232e6
and the v2v-devel private thread "Do we already support migration using FC?"
c232e6
---
c232e6
 docs/virt-v2v-output-rhv.pod |  8 +-------
c232e6
 v2v/output_rhv_upload.ml     | 10 +---------
c232e6
 v2v/rhv-upload-transfer.py   |  4 +---
c232e6
 3 files changed, 3 insertions(+), 19 deletions(-)
c232e6
c232e6
diff --git a/docs/virt-v2v-output-rhv.pod b/docs/virt-v2v-output-rhv.pod
c232e6
index dc6b2c0a..7b8fdc0f 100644
c232e6
--- a/docs/virt-v2v-output-rhv.pod
c232e6
+++ b/docs/virt-v2v-output-rhv.pod
c232e6
@@ -5,7 +5,7 @@ virt-v2v-output-rhv - Using virt-v2v to convert guests to oVirt or RHV
c232e6
 =head1 SYNOPSIS
c232e6
 
c232e6
  virt-v2v [-i* options] -o rhv-upload [-oc ENGINE_URL] -os STORAGE
c232e6
-                        [-op PASSWORD] [-of raw]
c232e6
+                        [-op PASSWORD]
c232e6
                         [-oo rhv-cafile=FILE]
c232e6
                         [-oo rhv-cluster=CLUSTER]
c232e6
                         [-oo rhv-direct]
c232e6
@@ -79,12 +79,6 @@ username is not specified then virt-v2v defaults to using
c232e6
 C<admin@internal> which is the typical superuser account for oVirt
c232e6
 instances.
c232e6
 
c232e6
-=item I<-of raw>
c232e6
-
c232e6
-Currently you must use I<-of raw> and you cannot use I<-oa preallocated>.
c232e6
-
c232e6
-These restrictions will be loosened in a future version.
c232e6
-
c232e6
 =item I<-op> F<password-file>
c232e6
 
c232e6
 A file containing a password to be used when connecting to the oVirt
c232e6
diff --git a/v2v/output_rhv_upload.ml b/v2v/output_rhv_upload.ml
c232e6
index 50baa595..be5e9851 100644
c232e6
--- a/v2v/output_rhv_upload.ml
c232e6
+++ b/v2v/output_rhv_upload.ml
c232e6
@@ -146,17 +146,10 @@ let error_unless_nbdkit_compiled_with_selinux config =
c232e6
       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.")
c232e6
   )
c232e6
 
c232e6
-(* Output sparse must be sparse.  We may be able to
c232e6
- * lift this limitation in future, but it requires changes on the
c232e6
- * RHV side.  See TODO file for details.  XXX
c232e6
- *)
c232e6
+(* Output format must be raw. *)
c232e6
 let error_current_limitation required_param =
c232e6
   error (f_"rhv-upload: currently you must use ā€˜%sā€™.  This restriction will be loosened in a future version.") required_param
c232e6
 
c232e6
-let error_unless_output_alloc_sparse output_alloc =
c232e6
-  if output_alloc <> Sparse then
c232e6
-    error_current_limitation "-oa sparse"
c232e6
-
c232e6
 let json_optstring = function
c232e6
   | Some s -> JSON.String s
c232e6
   | None -> JSON.Null
c232e6
@@ -271,7 +264,6 @@ object
c232e6
     error_unless_nbdkit_min_version config;
c232e6
     error_unless_nbdkit_python_plugin_working plugin_script;
c232e6
     error_unless_nbdkit_compiled_with_selinux config;
c232e6
-    error_unless_output_alloc_sparse output_alloc;
c232e6
 
c232e6
     (* Python code prechecks. *)
c232e6
     let json_params = match rhv_options.rhv_disk_uuids with
c232e6
diff --git a/v2v/rhv-upload-transfer.py b/v2v/rhv-upload-transfer.py
c232e6
index 5aebcd1d..f38cd9c0 100644
c232e6
--- a/v2v/rhv-upload-transfer.py
c232e6
+++ b/v2v/rhv-upload-transfer.py
c232e6
@@ -111,10 +111,8 @@ def create_disk(connection):
c232e6
             # size, based on qemu-img measure of the overlay.
c232e6
             initial_size=params['disk_size'],
c232e6
             provisioned_size=params['disk_size'],
c232e6
-            # XXX Ignores params['output_sparse'].
c232e6
-            # Handling this properly will be complex, see:
c232e6
             # https://www.redhat.com/archives/libguestfs/2018-March/msg00177.html
c232e6
-            sparse=True,
c232e6
+            sparse=params['output_sparse'],
c232e6
             storage_domains=[
c232e6
                 types.StorageDomain(
c232e6
                     name=params['output_storage'],
c232e6
-- 
c232e6
2.31.1
c232e6