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

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