Bug 1358142

Summary: Some info will show when convert guest to libvirt by virt-v2v with parameter --quiet
Product: Red Hat Enterprise Linux 7 Reporter: mxie <mxie>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 7.3CC: haizhao, jdenemar, juzhou, mzhan, ptoscano, rbalakri, rjones, tzheng, xiaodwan
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: V2V
Fixed In Version: libguestfs-1.32.6-2.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-03 18:02:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1358181    
Bug Blocks:    

Description mxie@redhat.com 2016-07-20 07:37:23 UTC
Description of problem:
Some info will show when convert guest to libvirt by virt-v2v with parameter --quiet


Version-Release number of selected component (if applicable):
libvirt-2.0.0-2.el7.x86_64
virt-v2v-1.32.6-1.el7.x86_64
libguestfs-1.32.6-1.el7.x86_64
qemu-kvm-rhev-2.6.0-13.el7.x86_64


How reproducible:
100%

Steps to Reproduce:
1.Check parameter -q in virsh manual page and virt-v2v manual page
#man virsh 
 -q, --quiet
 Avoid extra informational messages.
#man virt-v2v
 -q, --quiet
 This disables progress bars and other unnecessary output

2.Convert guest from vmware to libvirt with parameter -q
# virt-v2v -ic vpx://root.145.47/data/10.73.3.19/?no_verify=1 esx5.5-win7-x86_64 --password-file /tmp/passwd -q
Pool default refreshed

Domain esx5.5-win7-x86_64 defined from /tmp/v2vlibvirt05fd58.xml

You have new mail in /var/spool/mail/root



Actual results:
Some info will show when convert guest to libvirt by virt-v2v with parameter --quiet

Expected results:
should no info printed out if using parameter -q 

Additional info:
there is no info printed out if convert guest to rhev by virt-v2v with parameter --quiet

Comment 2 Pino Toscano 2016-07-20 09:27:34 UTC
The patch itself is easy, although virsh does not seem to always respect the -q/--quiet flag -- see bug #1358181.

https://www.redhat.com/archives/libguestfs/2016-July/msg00185.html

Comment 3 Richard W.M. Jones 2016-07-20 11:27:20 UTC
I have ACKed this, and we can add Pino's patch to RHEL 7.3.  However
it won't have any effect until the dependent bug is fixed in virsh.

Comment 4 Richard W.M. Jones 2016-07-28 12:09:36 UTC
Note this is only fixed from the libguestfs point of view.  It
still requires a fix to libvirt which is not scheduled to happen
until RHEL 7.4.

Comment 6 mxie@redhat.com 2016-07-29 03:05:31 UTC
Verify the bug with builds:
libvirt-2.0.0-3.el7.x86_64
libguestfs-1.32.6-2.el7.x86_64
qemu-kvm-rhev-2.6.0-13.el7.x86_64

Steps:
1.Convert guest from vmware to libvirt with parameter -q
# virt-v2v -ic vpx://root.145.47/data/10.73.3.19/?no_verify=1 esx5.5-win7-x86_64 --password-file /tmp/passwd -q -on quite
Pool default refreshed
Domain quite defined from /tmp/v2vlibvirtb235b2.xml


Hi rjones,

There are still some info displayed, could you help to check this? Thanks

Comment 7 Pino Toscano 2016-07-29 08:28:39 UTC
(In reply to mxie from comment #6)
> There are still some info displayed, could you help to check this?

See comment #2, comment #3, and comment #4.  Without a libvirt fix the fix of this bug will not have a practical effect.

Comment 8 mxie@redhat.com 2016-08-01 05:46:33 UTC
(In reply to Pino Toscano from comment #7)
> (In reply to mxie from comment #6)
> > There are still some info displayed, could you help to check this?
> 
> See comment #2, comment #3, and comment #4.  Without a libvirt fix the fix
> of this bug will not have a practical effect.

Hi rjones,

Yes, I got the comments,but I can't verify this bug now because the problem still show out, could we move this bug to rhel7.4 until a libvirt fix? thanks.

Comment 9 Richard W.M. Jones 2016-08-02 13:25:32 UTC
It should actually be possible to verify just the libvirt side
of the fix, like this:

$ virt-builder fedora-24
$ strace -e execve -o /tmp/log virt-v2v -i disk fedora-24.img -os tmp --quiet

(You might need to change the `-os tmp' parameter to another
libvirt pool name.  See `virsh pool-list').

$ virsh undefine fedora-24

Now examine the strace log file (/tmp/log) looking to see if
the virsh pool-refresh command was called with the -q parameter:

$ grep 'virsh.*pool-refresh.*= 0' /tmp/log 
12006 execve("/usr/bin/virsh", ["virsh", "-q", "pool-refresh", "tmp"], [/* 67 vars */]) = 0
                                         ^^^^^

You can see in this case the -q flag has been added by virt-v2v.
Libvirt does not yet obey this flag, but we are passing it to virsh.

Comment 10 Richard W.M. Jones 2016-08-02 13:26:37 UTC
(In reply to Richard W.M. Jones from comment #9)
> It should actually be possible to verify just the libvirt side

I mean "just the *libguestfs* side ..."

Comment 11 mxie@redhat.com 2016-08-03 10:21:08 UTC
Verify the bug with builds again:
libvirt-2.0.0-4.el7.x86_64
libguestfs-1.32.6-2.el7.x86_64
qemu-kvm-rhev-2.6.0-17.el7.x86_64

Steps:
1.# strace -f -e  execve -o /tmp/f.log virt-v2v -i disk /var/lib/libvirt/images/esx5.1-win10-i386-sda -os mxie --quiet -on f
virt-v2v: warning: there is no QXL driver for this version of Windows (10.0 
i386).  virt-v2v looks for this driver in /usr/share/virtio-win

The guest will be configured to use a basic VGA display driver.
Pool mxie refreshed
Domain f defined from /tmp/v2vlibvirta34bbf.xml


2.Check log, there is info as below
#  grep 'virsh.*pool-refresh.*= 0' /tmp/f.log
3555  execve("/usr/bin/virsh", ["virsh", "-q", "pool-refresh", "mxie"], [/* 37 vars */]) = 0

Result now:
According to above steps and comment 9,-q flag has been added by virt-v2v, so this bug has been fixed at libguestfs side

So move this bug from ON_QA to VERIFIED

Comment 12 Richard W.M. Jones 2016-08-03 10:21:49 UTC
(In reply to Richard W.M. Jones from comment #9)
> $ strace -e execve -o /tmp/log virt-v2v -i disk fedora-24.img -os tmp --quiet

This is missing the '-f' parameter.  The corrected command is:

strace -f -e execve -o /tmp/log virt-v2v -i disk fedora-24.img -os tmp --quiet

Comment 14 errata-xmlrpc 2016-11-03 18:02:47 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/RHSA-2016-2576.html