Bug 1140050 - No error shows when multiple conflicting options used with virt-v2v
Summary: No error shows when multiple conflicting options used with virt-v2v
Keywords:
Status: CLOSED ERRATA
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:
TreeView+ depends on / blocked
 
Reported: 2014-09-10 08:58 UTC by zhoujunqin
Modified: 2015-03-05 13:44 UTC (History)
7 users (show)

Fixed In Version: libguestfs-1.27.42-1.2.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-05 13:44:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
log for step step2 (222 bytes, text/plain)
2014-09-10 08:59 UTC, zhoujunqin
no flags Details
log file to step3 (398.25 KB, text/plain)
2014-09-10 09:01 UTC, zhoujunqin
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0303 0 normal SHIPPED_LIVE libguestfs bug fix and enhancement update 2015-03-05 17:34:44 UTC

Description zhoujunqin 2014-09-10 08:58:42 UTC
Description of problem:
No error shows when multiple conflicting options used with virt-v2v

Version-Release number of selected component (if applicable):
libguestfs-1.27.41-1.1.el7.x86_64
virt-v2v-1.27.41-1.1.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Check the virt-v2v manual page, it said that "Only one input and output mode can be selected for each run of virt-v2v".
# man virt-v2v
...
       Virt-v2v has a number of possible input and output modes, selected using the -i and -o options.  Only one input and output mode can be selected for each
       run of virt-v2v.
...

2. Use "-i libvirtxml" & "-i disk" options together when converting a guest.
# virt-v2v -i disk -i libvirtxml -o local -os /var/tmp/ rhel6.6-pv-x64-test.img
[   0.0] Opening the source -i libvirtxml rhel6.6-pv-x64-test.img
virt-v2v: error: exception: Out of memory

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

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

3. Use "-i disk" for several times in one command line.
# virt-v2v -i disk -i disk -i disk -i disk  -o local -os /var/tmp/ rhel6.6-pv-x64-test.img
[   0.0] Opening the source -i disk rhel6.6-pv-x64-test.img
[   0.0] Creating an overlay to protect the source from being modified
[   0.0] Opening the overlay
[  44.0] Initializing the target -o local -os /var/tmp/
[  44.0] Inspecting the overlay
[  48.0] Checking for sufficient free disk space in the guest
[  48.0] Converting Red Hat Enterprise Linux Server release 6.6 Beta (Santiago) to run on KVM
virt-v2v: warning: /files/boot/grub/device.map/hd0 references unknown
device "xvda".  You may have to fix this entry manually after conversion.
[  76.0] Mapping filesystem data to avoid copying unused and blank areas
[  77.0] Closing the overlay
[  77.0] Copying disk 1/1 to /var/tmp/rhel6.6-pv-x64-test-sda (raw)
    (100.00/100%)
[  91.0] Creating output metadata
[  91.0] Finishing off

Actual results:
For step2: Conversion failed, but the error: exception: Out of memory is unclear.
For step3: Conversion successfully with several times in one command line.

Expected results:
virt-v2v should forbid multiple conflicting options used with virt-v2v show friendly error.

Additional info:
Log file for step2 and step3 will be attached.

Comment 1 zhoujunqin 2014-09-10 08:59:47 UTC
Created attachment 936056 [details]
log for step step2

Comment 2 zhoujunqin 2014-09-10 09:01:21 UTC
Created attachment 936057 [details]
log file to step3

Comment 4 Richard W.M. Jones 2014-09-10 10:29:10 UTC
For the -i and -o options, this is fixed in the following
commit:

https://github.com/libguestfs/libguestfs/commit/b6099f4aee3e14a04f6b8c8d62246d337f2a1582

$ virt-v2v -i disk -i libvirt
virt-v2v: error: -i option used more than once on the command line

Note this doesn't fix other options.  eg. It's still possible
to specify -oa or -os twice (in which case, the last option "wins").
It complicates the code to prevent such cases.

Comment 6 zhoujunqin 2014-09-12 09:04:19 UTC
I can reproduce this issue as Comment 0.
Try to verify with new build:
libguestfs-1.27.43-1.1.el7.x86_64
virt-v2v-1.27.43-1.1.el7.x86_64

steps:

# virt-v2v -i libvirtxml -i disk
virt-v2v: error: -i option used more than once on the command line

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

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

# virt-v2v -i disk -o local -i disk 
virt-v2v: error: -i option used more than once on the command line

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

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

# virt-v2v -i disk -o local -o local 
virt-v2v: error: -o option used more than once on the command line

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

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

# virt-v2v  -o local -i disk -o local
virt-v2v: error: -o option used more than once on the command line

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

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

see above result, move this bug from ON_QA to VERIFIED.

Comment 8 errata-xmlrpc 2015-03-05 13:44:26 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0303.html


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