Blame SOURCES/0005-v2v-Remove-extraneous-when-setting-bandwidth-RHBZ-18.patch

7ed5e3
From f3ea9ceb1c3c9741d4f62d0c1d23b7c94634353a Mon Sep 17 00:00:00 2001
7ed5e3
From: "Richard W.M. Jones" <rjones@redhat.com>
7ed5e3
Date: Thu, 28 May 2020 11:40:45 +0100
7ed5e3
Subject: [PATCH] v2v: Remove extraneous '=' when setting bandwidth
7ed5e3
 (RHBZ#1841096).
7ed5e3
7ed5e3
Commit c3a54d6aed6dfc65f9ffa59976bb8d20044c03a8 ("v2v: Add standalone
7ed5e3
nbdkit module.") was supposed to be a simple refactoring but it broke
7ed5e3
the --bandwidth and --bandwidth-file options (amongst other things).
7ed5e3
7ed5e3
Because of an extra '=' character which was accidentally left over, it
7ed5e3
would add an extra character in the nbdkit-rate-filter command line.
7ed5e3
For example:
7ed5e3
7ed5e3
  virt-v2v .. --bandwidth 200M
7ed5e3
7ed5e3
would invoke:
7ed5e3
7ed5e3
  nbdkit .. --filter rate rate==200M
7ed5e3
7ed5e3
which causes a parse error.  The --bandwidth-file option does not
7ed5e3
invoke a parse error but does not work, for similar reasons.
7ed5e3
7ed5e3
Thanks: Ming Xie
7ed5e3
(cherry picked from commit a89a084b2d0f6d40716c1d34969f6c49ea28e9b3)
7ed5e3
---
7ed5e3
 v2v/nbdkit_sources.ml | 6 +++---
7ed5e3
 1 file changed, 3 insertions(+), 3 deletions(-)
7ed5e3
7ed5e3
diff --git a/v2v/nbdkit_sources.ml b/v2v/nbdkit_sources.ml
7ed5e3
index 979c3773..402dfd0e 100644
7ed5e3
--- a/v2v/nbdkit_sources.ml
7ed5e3
+++ b/v2v/nbdkit_sources.ml
7ed5e3
@@ -118,11 +118,11 @@ let common_create ?bandwidth ?extra_debug ?extra_env plugin_name plugin_args =
7ed5e3
          let args =
7ed5e3
            match bandwidth with
7ed5e3
            | StaticBandwidth rate ->
7ed5e3
-              [ "rate=", rate ]
7ed5e3
+              [ "rate", rate ]
7ed5e3
            | DynamicBandwidth (None, filename) ->
7ed5e3
-              [ "rate-file=", filename ]
7ed5e3
+              [ "rate-file", filename ]
7ed5e3
            | DynamicBandwidth (Some rate, filename) ->
7ed5e3
-              [ "rate=", rate; "rate-file=", filename ] in
7ed5e3
+              [ "rate", rate; "rate-file", filename ] in
7ed5e3
          cmd, args
7ed5e3
     )
7ed5e3
     else cmd, [] in
7ed5e3
-- 
7ed5e3
2.18.4
7ed5e3