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

da373f
From 24c75d5ae2ca66fc683e98d32f7949a35caf6260 Mon Sep 17 00:00:00 2001
df3bb2
From: "Richard W.M. Jones" <rjones@redhat.com>
df3bb2
Date: Mon, 14 May 2018 10:16:58 +0100
df3bb2
Subject: [PATCH] RHEL 8: v2v: rhv-upload: Remove restriction on -oa sparse.
df3bb2
df3bb2
See: https://bugzilla.redhat.com/show_bug.cgi?id=1565681
df3bb2
and the v2v-devel private thread "Do we already support migration using FC?"
df3bb2
---
3efd08
 v2v/output_rhv_upload.ml    | 11 +----------
3efd08
 v2v/rhv-upload-plugin.py    |  4 +---
3efd08
 v2v/virt-v2v-output-rhv.pod |  8 +-------
3efd08
 3 files changed, 3 insertions(+), 20 deletions(-)
df3bb2
df3bb2
diff --git a/v2v/output_rhv_upload.ml b/v2v/output_rhv_upload.ml
3efd08
index e1d06867b..3f078157a 100644
df3bb2
--- a/v2v/output_rhv_upload.ml
df3bb2
+++ b/v2v/output_rhv_upload.ml
3efd08
@@ -177,19 +177,11 @@ See also the virt-v2v-output-rhv(1) manual.")
df3bb2
       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.")
df3bb2
   in
df3bb2
 
df3bb2
-  (* Output format/sparse must be raw/sparse.  We may be able to
df3bb2
-   * lift this limitation in future, but it requires changes on the
df3bb2
-   * RHV side.  See TODO file for details.  XXX
df3bb2
-   *)
df3bb2
+  (* Output format must be raw. *)
df3bb2
   let error_current_limitation required_param =
df3bb2
     error (f_"rhv-upload: currently you must use ā€˜%sā€™.  This restriction will be loosened in a future version.") required_param
df3bb2
   in
df3bb2
 
df3bb2
-  let error_unless_output_alloc_sparse () =
df3bb2
-    if output_alloc <> Sparse then
df3bb2
-      error_current_limitation "-oa sparse"
df3bb2
-  in
df3bb2
-
df3bb2
   (* JSON parameters which are invariant between disks. *)
df3bb2
   let json_params = [
df3bb2
     "verbose", JSON.Bool (verbose ());
3efd08
@@ -249,7 +241,6 @@ object
df3bb2
     error_unless_ovirtsdk4_module_available ();
df3bb2
     error_unless_nbdkit_working ();
3efd08
     error_unless_nbdkit_python_plugin_working ();
df3bb2
-    error_unless_output_alloc_sparse ();
3efd08
     (* Python code prechecks. *)
3efd08
     let precheck_fn = tmpdir // "v2vprecheck.json" in
3efd08
     let fd = Unix.openfile precheck_fn [O_WRONLY; O_CREAT] 0o600 in
df3bb2
diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py
3efd08
index 14d4e37fb..c7f7a5e8b 100644
df3bb2
--- a/v2v/rhv-upload-plugin.py
df3bb2
+++ b/v2v/rhv-upload-plugin.py
3efd08
@@ -142,10 +142,8 @@ def open(readonly):
df3bb2
             format = disk_format,
df3bb2
             initial_size = params['disk_size'],
df3bb2
             provisioned_size = params['disk_size'],
df3bb2
-            # XXX Ignores params['output_sparse'].
df3bb2
-            # Handling this properly will be complex, see:
df3bb2
             # https://www.redhat.com/archives/libguestfs/2018-March/msg00177.html
df3bb2
-            sparse = True,
df3bb2
+            sparse = params['output_sparse'],
df3bb2
             storage_domains = [
df3bb2
                 types.StorageDomain(
df3bb2
                     name = params['output_storage'],
3efd08
diff --git a/v2v/virt-v2v-output-rhv.pod b/v2v/virt-v2v-output-rhv.pod
3efd08
index 4520c9184..f6579a48e 100644
3efd08
--- a/v2v/virt-v2v-output-rhv.pod
3efd08
+++ b/v2v/virt-v2v-output-rhv.pod
3efd08
@@ -5,7 +5,7 @@ virt-v2v-output-rhv - Using virt-v2v to convert guests to oVirt or RHV
3efd08
 =head1 SYNOPSIS
3efd08
 
3efd08
  virt-v2v [-i* options] -o rhv-upload [-oc ENGINE_URL] -os STORAGE
3efd08
-                        [-op PASSWORD] [-of raw]
3efd08
+                        [-op PASSWORD]
3efd08
                         [-oo rhv-cafile=FILE]
3efd08
                         [-oo rhv-cluster=CLUSTER]
3efd08
                         [-oo rhv-direct]
3efd08
@@ -79,12 +79,6 @@ username is not specified then virt-v2v defaults to using
df3bb2
 C<admin@internal> which is the typical superuser account for oVirt
df3bb2
 instances.
df3bb2
 
df3bb2
-=item I<-of raw>
df3bb2
-
df3bb2
-Currently you must use I<-of raw> and you cannot use I<-oa preallocated>.
df3bb2
-
df3bb2
-These restrictions will be loosened in a future version.
df3bb2
-
df3bb2
 =item I<-op> F<password-file>
df3bb2
 
df3bb2
 A file containing a password to be used when connecting to the oVirt
df3bb2
-- 
da373f
2.18.4
df3bb2