Blame SOURCES/0138-p2v-virt-p2v-make-disk-passes-through-no-warn-if-par.patch

e76f14
From e46c64da93c82c765a36c75df65094d0221f99fc Mon Sep 17 00:00:00 2001
e76f14
From: "Richard W.M. Jones" <rjones@redhat.com>
e76f14
Date: Mon, 27 Jun 2016 11:18:43 +0100
e76f14
Subject: [PATCH] p2v: virt-p2v-make-disk passes through --no-warn-if-partition
e76f14
 to virt-builder.
e76f14
e76f14
See: https://bugzilla.redhat.com/show_bug.cgi?id=1342337#c4
e76f14
e76f14
Thanks: Junqin Zhou
e76f14
(cherry picked from commit 07137ea565653ca22e055cef09a08add6ad5f1c9)
e76f14
---
e76f14
 p2v/virt-p2v-make-disk.in  | 17 +++++++++++++----
e76f14
 p2v/virt-p2v-make-disk.pod |  7 +++++++
e76f14
 2 files changed, 20 insertions(+), 4 deletions(-)
e76f14
e76f14
diff --git a/p2v/virt-p2v-make-disk.in b/p2v/virt-p2v-make-disk.in
e76f14
index d58e7f1..cbbc9ff 100644
e76f14
--- a/p2v/virt-p2v-make-disk.in
e76f14
+++ b/p2v/virt-p2v-make-disk.in
e76f14
@@ -24,7 +24,7 @@ version="@PACKAGE_VERSION@"
e76f14
 
e76f14
 TEMP=`getopt \
e76f14
         -o o:V \
e76f14
-        --long help,inject-ssh-identity:,output:,verbose,version \
e76f14
+        --long help,inject-ssh-identity:,no-warn-if-partition,output:,verbose,version \
e76f14
         -n $program -- "$@"`
e76f14
 if [ $? != 0 ]; then
e76f14
     echo "$program: problem parsing the command line arguments"
e76f14
@@ -35,6 +35,7 @@ eval set -- "$TEMP"
e76f14
 output=
e76f14
 upload=
e76f14
 verbose=
e76f14
+declare -a passthru
e76f14
 
e76f14
 usage ()
e76f14
 {
e76f14
@@ -57,11 +58,18 @@ while true; do
e76f14
             set +x
e76f14
             verbose=1
e76f14
             shift;;
e76f14
+
e76f14
+        # virt-builder parameters that are passed through.
e76f14
+        --no-warn-if-partition)
e76f14
+            passthru[${#passthru[*]}]="$1"
e76f14
+            shift;;
e76f14
+
e76f14
+        # help etc.
e76f14
+        --help)
e76f14
+            usage 0;;
e76f14
         -V|--version)
e76f14
             echo "$program $version"
e76f14
             exit 0;;
e76f14
-        --help)
e76f14
-            usage 0;;
e76f14
         --)
e76f14
             shift
e76f14
             break;;
e76f14
@@ -206,7 +214,8 @@ virt-builder "$osversion"                                       \
e76f14
         s/^[Login]/[Login]\nReserveVT=1\n/
e76f14
     '                                                           \
e76f14
     $upload                                                     \
e76f14
-    $extra_args
e76f14
+    $extra_args                                                 \
e76f14
+    "${passthru[@]}"
e76f14
 
e76f14
 # We have to do this so the cleanup() handler runs.
e76f14
 exit $?
e76f14
diff --git a/p2v/virt-p2v-make-disk.pod b/p2v/virt-p2v-make-disk.pod
e76f14
index d5a5db5..2e1bffb 100644
e76f14
--- a/p2v/virt-p2v-make-disk.pod
e76f14
+++ b/p2v/virt-p2v-make-disk.pod
e76f14
@@ -99,6 +99,13 @@ Display help.
e76f14
 Add an SSH identity (private key) file into the image.
e76f14
 See L</ADDING AN SSH IDENTITY> above.
e76f14
 
e76f14
+=item B<--no-warn-if-partition>
e76f14
+
e76f14
+Normally you should not write to a partition on a USB drive (ie. don't
e76f14
+use S<C<-o /dev/sdX1>>, use S<C<-o /dev/sdX>> to make a bootable USB
e76f14
+drive).  If you do this, virt-builder prints a warning.  This option
e76f14
+suppresses that warning.
e76f14
+
e76f14
 =item B<-o> OUTPUT
e76f14
 
e76f14
 =item B<--output> OUTPUT
e76f14
-- 
e76f14
1.8.3.1
e76f14