mrc0mmand / rpms / libguestfs

Forked from rpms/libguestfs 3 years ago
Clone

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

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