mrc0mmand / rpms / libguestfs

Forked from rpms/libguestfs 3 years ago
Clone

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

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