Bug 1140946 - qemu-img shows error message for backing file twice
Summary: qemu-img shows error message for backing file twice
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libguestfs
Version: 7.1
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: Virtualization Bugs
URL:
Whiteboard: V2V
Depends On:
Blocks: 1151043 1238639
TreeView+ depends on / blocked
 
Reported: 2014-09-12 05:38 UTC by zhoujunqin
Modified: 2015-07-02 10:41 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1151043 (view as bug list)
Environment:
Last Closed: 2015-07-02 10:09:50 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description zhoujunqin 2014-09-12 05:38:48 UTC
Description of problem:
Error message showed twice while converting  a guest from libvirtxml with no releated image found

Version-Release number of selected component (if applicable):
virt-v2v-1.27.43-1.1.el7.x86_64
libguestfs-1.27.43-1.1.el7.x86_64
qemu-kvm-rhev-2.1.0-3.rwmj3.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Copy xen guest xml file from xen server to v2v server, no copy xen guest img file.
2. Run virt-v2v to connect a xen pv/hvm guest by -i libvirtxml.
# virt-v2v -i libvirtxml -o local -os /var/tmp rhel6.6-pv-x64-test.xml
[   0.0] Opening the source -i libvirtxml rhel6.6-pv-x64-test.xml
[   0.0] Creating an overlay to protect the source from being modified
qemu-img: /tmp/v2vovlcfdd83.qcow2: Could not open '/var/lib/xen/images/rhel6.6-pv-x64-test.img': Could not open '/var/lib/xen/images/rhel6.6-pv-x64-test.img': No such file or directory: No such file or directory
virt-v2v: error: qemu-img command failed, see earlier errors

If reporting bugs, run virt-v2v with debugging enabled and include the
complete output:

  virt-v2v -v -x [...]


Actual results:
The following error showed twice:
qemu-img: /tmp/v2vovlcfdd83.qcow2: Could not open '/var/lib/xen/images/rhel6.6-pv-x64-test.img': Could not open '/var/lib/xen/images/rhel6.6-pv-x64-test.img': No such file or directory: No such file or directory


Expected results:
Error message should only show one time.

Additional info:

Comment 2 Richard W.M. Jones 2014-09-12 18:31:45 UTC
This is actually a qemu bug:

$ qemu-img create -f qcow2 -b /tmp/nosuchfile /tmp/overlay
qemu-img: /tmp/overlay: Could not open '/tmp/nosuchfile': Could not open '/tmp/nosuchfile': No such file or directory: No such file or directory

(That was with Fedora qemu-img-2.1.0-6.fc22.x86_64, but the same
probably happens with qemu-kvm-rhev since they are very similar
versions).

I will add a workaround to libguestfs so it checks the file exists
before running qemu-img.

Comment 3 Richard W.M. Jones 2014-09-12 18:41:49 UTC
(In reply to Richard W.M. Jones from comment #2)
> I will add a workaround to libguestfs so it checks the file exists
> before running qemu-img.

This will be fixed in virt-v2v 1.27.44.  It now says:

$ virt-v2v -i libvirtxml /tmp/bad.xml -o local -os /tmp
[   0.0] Opening the source -i libvirtxml /tmp/bad.xml
virt-v2v: error: access: No such file or directory: 
/home/rjones/d/libguestfs/tests/guests/no-such-disk.img

Comment 5 zhoujunqin 2014-10-08 08:53:41 UTC
(In reply to Richard W.M. Jones from comment #3)
> This will be fixed in virt-v2v 1.27.44.  It now says:
> 
> $ virt-v2v -i libvirtxml /tmp/bad.xml -o local -os /tmp
> [   0.0] Opening the source -i libvirtxml /tmp/bad.xml
> virt-v2v: error: access: No such file or directory: 
> /home/rjones/d/libguestfs/tests/guests/no-such-disk.img

As you said i tried with following package version:
libguestfs-1.27.44-1.1.el7.x86_64
virt-v2v-1.27.44-1.1.el7.x86_64
qemu-kvm-rhev-2.1.2-1.rwmj1.el7.x86_64

steps:
# virt-v2v -i libvirtxml rhel6.6-pv-x64-test.xml -o local -os /tmp 
[   0.0] Opening the source -i libvirtxml rhel6.6-pv-x64-test.xml
virt-v2v: error: access: No such file or directory: 
/var/lib/xen/images/rhel6.6-pv-x64-test.img

If reporting bugs, run virt-v2v with debugging enabled and include the 
complete output:

  virt-v2v -v -x [...]

Getting the same result with you.
But while i updated virt-v2v to latest version:
libguestfs-1.27.58-1.1.el7.x86_64
virt-v2v-1.27.58-1.1.el7.x86_64
qemu-kvm-rhev-2.1.2-1.rwmj1.el7.x86_64

Getting the same result with bug description.

steps:
# virt-v2v -i libvirtxml rhel6.6-pv-x64-test.xml -o local -os /tmp 
[   0.0] Opening the source -i libvirtxml rhel6.6-pv-x64-test.xml
[   0.0] Creating an overlay to protect the source from being modified
qemu-img: /var/tmp/v2vovl32b9ad.qcow2: Could not open '/var/lib/xen/images/rhel6.6-pv-x64-test.img': Could not open '/var/lib/xen/images/rhel6.6-pv-x64-test.img': No such file or directory: No such file or directory
virt-v2v: error: qemu-img command failed, see earlier errors

If reporting bugs, run virt-v2v with debugging enabled and include the 
complete output:

  virt-v2v -v -x [...]


so please help check whether there is something missed in the new version, thanks.

Comment 6 Richard W.M. Jones 2014-10-08 09:23:09 UTC
I've added a workaround in virt-v2v 1.27.44.  However the original
bug still exists in qemu-kvm-rhev, therefore the component is correct.

Reproducer:

$ qemu-img create -f qcow2 -b /tmp/nosuchfile /tmp/overlay
qemu-img: /tmp/overlay: Could not open '/tmp/nosuchfile': Could not open '/tmp/nosuchfile': No such file or directory: No such file or directory

Comment 7 langfang 2014-10-09 08:17:33 UTC
Hi,Ademar
    This bug is now "MODIFIED",please help to add the fixed version for qemu-kvm-rhev component.


thanks
fang lang

Comment 8 Ademar Reis 2014-10-09 13:21:34 UTC
(In reply to Richard W.M. Jones from comment #6)
> I've added a workaround in virt-v2v 1.27.44.  However the original
> bug still exists in qemu-kvm-rhev, therefore the component is correct.
> 

The status was inconsistent: MODIFIED, fixed in version pointing to libguestfs, but component marked qemu-kvm. Fixed by changing the component.


> Reproducer:
> 
> $ qemu-img create -f qcow2 -b /tmp/nosuchfile /tmp/overlay
> qemu-img: /tmp/overlay: Could not open '/tmp/nosuchfile': Could not open
> '/tmp/nosuchfile': No such file or directory: No such file or directory

Clone for QEMU: Bug 1151043

Comment 11 Richard W.M. Jones 2015-07-02 10:09:50 UTC
I'm closing this bug (against libguestfs).

The bug is really in qemu (bug 1151043).

We tried to work around the qemu bug in libguestfs, however doing
that caused another problem, so I reverted the workaround.

It has to be fixed in the proper place, and we cannot work around
it in libguestfs / virt-v2v.


Note You need to log in before you can comment on or make changes to this bug.