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