Blame SOURCES/0009-RHEL-Remove-the-in-place-option.patch

fda521
From c7c14141d1c985dbba8749f9209b78d96200c2b3 Mon Sep 17 00:00:00 2001
3156cb
From: "Richard W.M. Jones" <rjones@redhat.com>
3156cb
Date: Thu, 2 Dec 2021 11:56:05 +0000
3156cb
Subject: [PATCH] RHEL: Remove the --in-place option
3156cb
3156cb
This disables the virt-v2v --in-place option which we do not
3156cb
wish to support in RHEL.
3156cb
---
fda521
 docs/virt-v2v.pod | 49 -----------------------------------------------
3156cb
 v2v/v2v.ml        |  8 --------
fda521
 2 files changed, 57 deletions(-)
3156cb
3156cb
diff --git a/docs/virt-v2v.pod b/docs/virt-v2v.pod
fda521
index a1e00db8..a3fc3dc8 100644
3156cb
--- a/docs/virt-v2v.pod
3156cb
+++ b/docs/virt-v2v.pod
3156cb
@@ -8,10 +8,6 @@ virt-v2v - Convert a guest to use KVM
3156cb
           [-o mode] [other -o* options]
3156cb
           [guest|filename]
3156cb
 
3156cb
- virt-v2v --in-place
3156cb
-          [-i mode] [other -i* options]
3156cb
-          [guest|filename]
3156cb
-
3156cb
 =head1 DESCRIPTION
3156cb
 
3156cb
 Virt-v2v converts a single guest from a foreign hypervisor to run on
3156cb
@@ -37,12 +33,6 @@ The input and output sides of virt-v2v are separate and unrelated.
3156cb
 Virt-v2v can read from any input and write to any output.  Therefore
3156cb
 these sides of virt-v2v are documented separately in this manual.
3156cb
 
3156cb
-Virt-v2v normally copies from the input to the output, called "copying
3156cb
-mode".  In this case the source guest is always left unchanged.
3156cb
-In-place conversion (I<--in-place>) only uses the I<-i*> options and
3156cb
-modifies the source guest in-place.  (See L</In-place conversion>
3156cb
-below.)
3156cb
-
3156cb
 =head2 Other virt-v2v topics
3156cb
 
3156cb
 L<virt-v2v-support(1)> — Supported hypervisors, virtualization
fda521
@@ -289,20 +279,6 @@ For I<-i disk> only, this specifies the format of the input disk
3156cb
 image.  For other input methods you should specify the input
3156cb
 format in the metadata.
3156cb
 
3156cb
-=item B<--in-place>
3156cb
-
3156cb
-Do not create an output virtual machine in the target hypervisor.
3156cb
-Instead, adjust the guest OS in the source VM to run in the input
3156cb
-hypervisor.
3156cb
-
3156cb
-This mode is meant for integration with other toolsets, which take the
3156cb
-responsibility of converting the VM configuration, providing for
3156cb
-rollback in case of errors, transforming the storage, etc.
3156cb
-
3156cb
-See L</In-place conversion> below.
3156cb
-
3156cb
-Conflicts with all I<-o *> options.
3156cb
-
3156cb
 =item B<-io> OPTION=VALUE
3156cb
 
3156cb
 Set input option(s) related to the current input mode or transport.
fda521
@@ -1417,31 +1393,6 @@ that instead.
3156cb
    </devices>
3156cb
  </domain>
3156cb
 
3156cb
-=head2 In-place conversion
3156cb
-
3156cb
-It is also possible to use virt-v2v in scenarios where a foreign VM
3156cb
-has already been imported into a KVM-based hypervisor, but still needs
3156cb
-adjustments in the guest to make it run in the new virtual hardware.
3156cb
-
3156cb
-In that case it is assumed that a third-party tool has created the
3156cb
-target VM in the supported KVM-based hypervisor based on the source VM
3156cb
-configuration and contents, but using virtual devices more appropriate
3156cb
-for KVM (e.g. virtio storage and network, etc.).
3156cb
-
3156cb
-Then, to make the guest OS boot and run in the changed environment,
3156cb
-one can use:
3156cb
-
3156cb
- virt-v2v -ic qemu:///system converted_vm --in-place
3156cb
-
3156cb
-Virt-v2v will analyze the configuration of C<converted_vm> in the
3156cb
-C<qemu:///system> libvirt instance, and apply various fixups to the
3156cb
-guest OS configuration to make it match the VM configuration.  This
3156cb
-may include installing virtio drivers, configuring the bootloader, the
3156cb
-mountpoints, the network interfaces, and so on.
3156cb
-
3156cb
-Should an error occur during the operation, virt-v2v exits with an
3156cb
-error code leaving the VM in an undefined state.
3156cb
-
3156cb
 =head2 Machine readable output
3156cb
 
3156cb
 The I<--machine-readable> option can be used to make the output more
3156cb
diff --git a/v2v/v2v.ml b/v2v/v2v.ml
fda521
index c9ddce36..6859a02c 100644
3156cb
--- a/v2v/v2v.ml
3156cb
+++ b/v2v/v2v.ml
3156cb
@@ -183,7 +183,6 @@ let rec main () =
3156cb
   let output_storage = ref None in
3156cb
 
3156cb
   (* Other options that we handle here. *)
3156cb
-  let in_place = ref false in
3156cb
   let print_source = ref false in
3156cb
 
3156cb
   let input_mode = ref `Not_set in
3156cb
@@ -248,8 +247,6 @@ let rec main () =
3156cb
                                     s_"Use password from file to connect to input hypervisor";
3156cb
     [ M"it" ],       Getopt.String ("transport", set_string_option_once "-it" input_transport),
3156cb
                                     s_"Input transport";
3156cb
-    [ L"in-place" ], Getopt.Set in_place,
3156cb
-      s_"Only tune the guest in the input VM";
3156cb
     [ L"mac" ],      Getopt.String ("mac:network|bridge|ip:out", add_mac),
3156cb
       s_"Map NIC to network or bridge or assign static IP";
3156cb
     [ S 'n'; L"network" ], Getopt.String ("in:out", add_network),
3156cb
@@ -347,7 +344,6 @@ read the man page virt-v2v(1).
3156cb
 
3156cb
   (* Dereference the arguments. *)
3156cb
   let args = List.rev !args in
3156cb
-  let in_place = !in_place in
3156cb
   let input_conn = !input_conn in
3156cb
   let input_mode = !input_mode in
3156cb
   let input_transport =
3156cb
@@ -367,9 +363,6 @@ read the man page virt-v2v(1).
3156cb
   let root_choice = !root_choice in
3156cb
   let static_ips = !static_ips in
3156cb
 
3156cb
-  (* --in-place isn't implemented yet - TODO *)
3156cb
-  if in_place then error "XXX --in-place option is not implemented yet";
3156cb
-
3156cb
   (* No arguments and machine-readable mode?  Print out some facts
3156cb
    * about what this binary supports.
3156cb
    *)
3156cb
@@ -383,7 +376,6 @@ read the man page virt-v2v(1).
3156cb
       pr "vddk\n";
3156cb
       pr "colours-option\n";
3156cb
       pr "vdsm-compat-option\n";
3156cb
-      pr "in-place\n";
3156cb
       pr "io/oo\n";
3156cb
       pr "mac-option\n";
3156cb
       pr "bandwidth-option\n";
3156cb
-- 
3156cb
2.31.1
3156cb