Blame SOURCES/0026-v2v-rhv-upload-plugin-Fix-name-error.patch

df3bb2
From 47fd85a883892e2070a2287cc9411896645ab3bf Mon Sep 17 00:00:00 2001
df3bb2
From: Nir Soffer <nirsof@gmail.com>
df3bb2
Date: Mon, 25 Jun 2018 20:56:52 +0300
df3bb2
Subject: [PATCH] v2v: rhv-upload-plugin: Fix name error
df3bb2
df3bb2
"http" and "transfer" variables were missing in emulate_zero, so the
df3bb2
code would fail with NameError.  This can happen only when communicating
df3bb2
with old imageio versions not supporting the "zero" feature.
df3bb2
df3bb2
Testing with qemu-img 2.12 show that we never send emulated zero request
df3bb2
because of the highestwrite mechanism, but it can break with older
df3bb2
qemu-img-rhev used on RHEL.
df3bb2
df3bb2
(cherry picked from commit 0ae61ce99c351f9cda598016fb55ccc50313df67)
df3bb2
---
df3bb2
 v2v/rhv-upload-plugin.py | 3 +++
df3bb2
 1 file changed, 3 insertions(+)
df3bb2
df3bb2
diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py
df3bb2
index 2eec375f7..10887c031 100644
df3bb2
--- a/v2v/rhv-upload-plugin.py
df3bb2
+++ b/v2v/rhv-upload-plugin.py
df3bb2
@@ -338,6 +338,9 @@ def zero(h, count, offset, may_trim):
df3bb2
     r.read()
df3bb2
 
df3bb2
 def emulate_zero(h, count, offset):
df3bb2
+    http = h['http']
df3bb2
+    transfer = h['transfer']
df3bb2
+
df3bb2
     # qemu-img convert starts by trying to zero/trim the whole device.
df3bb2
     # Since we've just created a new disk it's safe to ignore these
df3bb2
     # requests as long as they are smaller than the highest write seen.
df3bb2
-- 
df3bb2
2.21.0
df3bb2