Nir Soffer
2018-Jun-25 17:30 UTC
[Libguestfs] [PATCH] v2v: rhv-upload-plugin: Fix name error
http was missing in emulate_zero, so the code would fail with NameError. This can happen only when communicating with old imageio versions not supporting the "zero" feature. Testing with qemu-img 2.12 show that we never send emulated zero request because of the highestwrite mechanism, but it can break with older qemu-img-rhev used on RHEL. --- v2v/rhv-upload-plugin.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py index 2eec375f7..0f6b31e67 100644 --- a/v2v/rhv-upload-plugin.py +++ b/v2v/rhv-upload-plugin.py @@ -338,6 +338,8 @@ def zero(h, count, offset, may_trim): r.read() def emulate_zero(h, count, offset): + http = h['http'] + # qemu-img convert starts by trying to zero/trim the whole device. # Since we've just created a new disk it's safe to ignore these # requests as long as they are smaller than the highest write seen. -- 2.17.1
Nir Soffer
2018-Jun-25 17:43 UTC
Re: [Libguestfs] [PATCH] v2v: rhv-upload-plugin: Fix name error
On Mon, Jun 25, 2018 at 8:30 PM Nir Soffer <nirsof@gmail.com> wrote:> http was missing in emulate_zero, so the code would fail with NameError. > This can happen only when communicating with old imageio versions not > supporting the "zero" feature. > > Testing with qemu-img 2.12 show that we never send emulated zero request > because of the highestwrite mechanism, but it can break with older > qemu-img-rhev used on RHEL. > --- > v2v/rhv-upload-plugin.py | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py > index 2eec375f7..0f6b31e67 100644 > --- a/v2v/rhv-upload-plugin.py > +++ b/v2v/rhv-upload-plugin.py > @@ -338,6 +338,8 @@ def zero(h, count, offset, may_trim): > r.read() > > def emulate_zero(h, count, offset): > + http = h['http'] >After some more cleanup, I found that we are missing also "transfer" here. I'll send a fixed patch.> + > # qemu-img convert starts by trying to zero/trim the whole device. > # Since we've just created a new disk it's safe to ignore these > # requests as long as they are smaller than the highest write seen. > -- > 2.17.1 > >
Nir Soffer
2018-Jun-25 17:59 UTC
Re: [Libguestfs] [PATCH] v2v: rhv-upload-plugin: Fix name error
On Mon, Jun 25, 2018 at 8:43 PM Nir Soffer <nsoffer@redhat.com> wrote:> On Mon, Jun 25, 2018 at 8:30 PM Nir Soffer <nirsof@gmail.com> wrote: > >> http was missing in emulate_zero, so the code would fail with NameError. >> This can happen only when communicating with old imageio versions not >> supporting the "zero" feature. >> >> Testing with qemu-img 2.12 show that we never send emulated zero request >> because of the highestwrite mechanism, but it can break with older >> qemu-img-rhev used on RHEL. >> --- >> v2v/rhv-upload-plugin.py | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py >> index 2eec375f7..0f6b31e67 100644 >> --- a/v2v/rhv-upload-plugin.py >> +++ b/v2v/rhv-upload-plugin.py >> @@ -338,6 +338,8 @@ def zero(h, count, offset, may_trim): >> r.read() >> >> def emulate_zero(h, count, offset): >> + http = h['http'] >> > > After some more cleanup, I found that we are missing also "transfer" here. > I'll send a fixed patch. >Fixed in https://www.redhat.com/archives/libguestfs/2018-June/msg00118.html> > >> + >> # qemu-img convert starts by trying to zero/trim the whole device. >> # Since we've just created a new disk it's safe to ignore these >> # requests as long as they are smaller than the highest write seen. >> -- >> 2.17.1 >> >>
Apparently Analagous Threads
- [PATCH] v2v: rhv-upload-plugin: Remove unneeded auth
- [PATCH] v2v: Log full imageio response on failure.
- [PATCH v2] v2v: -o rhv-upload: Log full imageio response on failure.
- Re: [PATCH] v2v: rhv-upload-plugin: Fix name error
- Re: [Qemu-block] v2v: -o rhv-upload: Long time spent zeroing the disk