Bug 1378022

Summary: There is virt-v2v warning about <listen type='none'> during converting a guest which has listen type='none' in XML
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: juzhou, mzhan, ptoscano, rjones, tzheng, xiaodwan
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: V2V
Fixed In Version: libguestfs-1.36.2-2.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-01 22:11:26 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: 1359086    
Bug Blocks:    
Attachments:
Description Flags
v2v-listen_none.log none

Description mxie@redhat.com 2016-09-21 10:41:00 UTC
Created attachment 1203209 [details]
v2v-listen_none.log

Description of problem:
There is virt-v2v warning about <listen type='none'> during converting a guest which has listen type='none' in XML


Version-Release number of selected component (if applicable):
virt-v2v-1.32.7-3.el7.x86_64
libguestfs-1.32.7-3.el7.x86_64
qemu-kvm-rhev-2.6.0-25.el7.x86_64
libvirt-2.0.0-9.el7.x86_64

How reproducible:
100% 

Steps to Reproduce:
1.Prepare a guest with listen type=none
1.1 #virsh dumpxml rhel6.7withcdrom
....
    <graphics type='spice'>
      <listen type='none'/>
    </graphics>
....

1.2 # virsh dumpxml rhel6.7withcdrom > rhel6.7withcdrom.xml 
1.3 # virt-xml-validate rhel6.7withcdrom.xml 
      rhel6.7withcdrom.xml validates

2.Convert this guest to rhev by virt-v2v
# virt-v2v -o rhev -os 10.66.4.143:/home/p2v_export -n ovirtmgmt -b ovirtmgmt rhel6.7withcdrom
[   0.0] Opening the source -i libvirt rhel6.7withcdrom
virt-v2v: warning: <listen type='none'> in the input libvirt XML was 
ignored
[   0.0] Creating an overlay to protect the source from being modified
[   0.3] Initializing the target -o rhev -os 10.66.4.143:/home/p2v_export
[   0.5] Opening the overlay
[   4.8] Inspecting the overlay
[  15.2] Checking for sufficient free disk space in the guest
[  15.2] Estimating space required on target for each disk
[  15.2] Converting Red Hat Enterprise Linux Server release 6.7 Beta (Santiago) to run on KVM
virt-v2v: This guest has virtio drivers installed.
[  59.1] Mapping filesystem data to avoid copying unused and blank areas
[  59.3] Closing the overlay
[  59.3] Checking if the guest needs BIOS or UEFI to boot
[  59.3] Assigning disks to buses
[  59.3] Copying disk 1/1 to /tmp/v2v.2daUBv/b01c8574-9d77-4c30-b187-a8ba5781f50a/images/5daec009-d3ed-41d0-917c-4b969a1c7659/c47ac268-d104-4c0d-ac6f-92b1d7c4fd7d (raw)
    (100.00/100%)
[ 120.0] Creating output metadata
[ 120.1] Finishing off

3.There is virt-v2v warning" <listen type='none'> in the input libvirt XML was 
ignored" during v2v conversion

4.Guest could be booted into os successfully after conversion
Actual results:
As above description

Expected results:
Hidden virt-v2v warning " <listen type='none'> in the input libvirt XML was 
ignored" during v2v conversion

Additional info:

Comment 1 Richard W.M. Jones 2016-09-21 11:07:35 UTC
<listen type='none'> was added in libvirt 2.0.0, but we
don't deal with it yet.

none since 2.0.0 (QEMU only)

    This listen type doesn't have any other attribute. Libvirt supports passing a file descriptor through our APIs virDomainOpenGraphics() and virDomainOpenGraphicsFD(). No other listen types are allowed if this one is used and the graphics device doesn't listen anywhere. You need to use one of the two APIs to pass a FD to QEMU in order to connect to this graphics device. Supported by graphics type vnc and spice.

https://libvirt.org/formatdomain.html#elementsGraphics

Comment 3 Richard W.M. Jones 2016-09-21 13:04:15 UTC
Patch posted:
https://www.redhat.com/archives/libguestfs/2016-September/msg00145.html

Comment 4 Richard W.M. Jones 2016-09-21 21:18:47 UTC
Upstream commit a4adf48915c0e3e7f4e8b7bbdbb5ac622da1ac58.

Comment 5 mxie@redhat.com 2016-09-22 03:08:31 UTC
Hi rjones,

  Tingting also found the similar warning when convert a guest which has listen type=socket by v2v, it seems like a same bug as listen type=none, pls fix this warning as well, thanks


Steps:
1.Prepare a guest which has listen type=socket
    <channel type='unix'>
      <target type='virtio' name='com.redhat.spice.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='2'/>
    </channel>
    <graphics type='vnc'>
      <listen type='socket'/>
    </graphics>

2.Using v2v to convert this guest
# virt-v2v rhel6.7withcdrom -o null
[   0.0] Opening the source -i libvirt rhel6.7withcdrom
virt-v2v: warning: <listen type='socket'> in the input libvirt XML was 
ignored
[   0.0] Creating an overlay to protect the source from being modified
[   0.8] Initializing the target -o null
[   0.8] Opening the overlay
[   3.7] Inspecting the overlay
[  11.1] Checking for sufficient free disk space in the guest
[  11.1] Estimating space required on target for each disk
[  11.1] Converting Red Hat Enterprise Linux Server release 6.7 Beta (Santiago) to run on KVM
virt-v2v: This guest has virtio drivers installed.
[  55.6] Mapping filesystem data to avoid copying unused and blank areas
[  55.7] Closing the overlay
[  56.0] Checking if the guest needs BIOS or UEFI to boot
[  56.0] Assigning disks to buses
[  56.0] Copying disk 1/1 to /var/tmp/null.T5o2SK/sda (raw)
    (100.00/100%)
[ 123.2] Creating output metadata
[ 123.2] Finishing off

Comment 6 Pino Toscano 2016-09-22 07:38:36 UTC
Hi mxie,

(In reply to mxie from comment #5)
>   Tingting also found the similar warning when convert a guest which has
> listen type=socket by v2v, it seems like a same bug as listen type=none, pls
> fix this warning as well, thanks

This is also fixed by the same patch that fixes this bug.

Comment 8 mxie@redhat.com 2017-03-12 13:29:02 UTC
Verify the bug with builds:
virt-v2v-1.36.2-1.el7.x86_64
libguestfs-1.36.2-1.el7.x86_64
libvirt-3.1.0-2.el7.x86_64
qemu-kvm-rhev-2.8.0-6.el7.x86_64

Steps:
Scenario1:
1.Prepare a guest with listen type=none

# virsh dumpxml xen-hvm-rhel7.2-x86_64 |grep graphics -A 2
    <graphics type='spice' port='-1' autoport='yes' keymap='en-us'>
      <listen type='none'/>
    </graphics>
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>


2.Convert this guest by virt-v2v,there is no warning about listen type=none during conversion
# virt-v2v xen-hvm-rhel7.2-x86_64 -on listen-none
[   0.0] Opening the source -i libvirt xen-hvm-rhel7.2-x86_64
[   0.0] Creating an overlay to protect the source from being modified
[   0.3] Initializing the target -o libvirt -os default
[   0.3] Opening the overlay
[   1.6] Inspecting the overlay
[  12.6] Checking for sufficient free disk space in the guest
[  12.6] Estimating space required on target for each disk
[  12.6] Converting Red Hat Enterprise Linux Server 7.2 (Maipo) to run on KVM
virt-v2v: This guest has virtio drivers installed.
[  85.0] Mapping filesystem data to avoid copying unused and blank areas
[  85.3] Closing the overlay
[  85.5] Checking if the guest needs BIOS or UEFI to boot
[  85.5] Assigning disks to buses
[  85.5] Copying disk 1/1 to /var/lib/libvirt/images/listen-none-sda (qcow2)
    (100.00/100%)
[ 171.7] Creating output metadata
Pool default refreshed

Domain listen-none defined from /tmp/v2vlibvirt2d767c.xml

[ 172.4] Finishing off


3.Check the graphic mode of the guest which converted by virt-v2v at step2, the listen type was not changed

# virsh dumpxml listen-none |grep graphic -A 2
    <graphics type='spice' keymap='en-us'>
      <listen type='none'/>
    </graphics>
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>


Scenario2:
1.Prepare a guest which has listen type=socket
# virsh dumpxml xen-hvm-rhel6.2-i386
    ....
   <channel type='unix'>
   <target type='virtio' name='com.redhat.spice.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <graphics type='spice' keymap='en-us'>
      <listen type='socket'/>
    </graphics>
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>

   ....
   
2.Convert this guest by virt-v2v, there is no warning about listen type=socket during conversion

# virt-v2v xen-hvm-rhel6.2-i386 -on listen-socket
[   0.0] Opening the source -i libvirt xen-hvm-rhel6.2-i386
[   0.0] Creating an overlay to protect the source from being modified
[   0.3] Initializing the target -o libvirt -os default
[   0.3] Opening the overlay
[   1.9] Inspecting the overlay
[   8.4] Checking for sufficient free disk space in the guest
[   8.4] Estimating space required on target for each disk
[   8.4] Converting Red Hat Enterprise Linux Server release 6.2 Beta (Santiago) to run on KVM
virt-v2v: This guest has virtio drivers installed.
[  33.8] Mapping filesystem data to avoid copying unused and blank areas
[  33.9] Closing the overlay
[  34.1] Checking if the guest needs BIOS or UEFI to boot
[  34.1] Assigning disks to buses
[  34.1] Copying disk 1/1 to /var/lib/libvirt/images/listen-socket-sda (qcow2)
    (100.00/100%)
[  76.5] Creating output metadata
Pool default refreshed

Domain listen-socket defined from /tmp/v2vlibvirt43345c.xml

[  77.2] Finishing off


3.Check graphic mode of the guest after finishing v2v conversion, but listen type was changed to address and unix socket channel was removed

# virsh dumpxml listen-socket |grep graphic -A 2
    <graphics type='spice' autoport='yes' keymap='en-us'>
      <listen type='address'/>
    </graphics>
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>


Hi rjones,

Could you help to see the scenario2 ?  I think the listen type f guest shouldn't be changed from socket to address after virt-v2v conversion.

Comment 9 Pino Toscano 2017-03-13 08:09:10 UTC
I see, in <listen type='socket'/> the "socket" attribute is optional. I'll prepare a patch to fix this.

Comment 10 Pino Toscano 2017-03-13 13:40:30 UTC
(In reply to Pino Toscano from comment #9)
> I see, in <listen type='socket'/> the "socket" attribute is optional. I'll
> prepare a patch to fix this.

Fixed with upstream commit b1975468391261b91258d420dafea5fe4076e4c2.

Comment 11 Pino Toscano 2017-03-15 12:47:13 UTC
Scenario 2 should be hopefully fixed with libguestfs-1.36.2-2.el7.

Comment 12 mxie@redhat.com 2017-03-16 08:05:14 UTC
Verify the bug with builds again:
virt-v2v-1.36.2-2.el7.x86_64
libguestfs-1.36.2-2.el7.x86_64
libvirt-3.1.0-2.el7.x86_64
qemu-kvm-rhev-2.8.0-6.el7.x86_64

Steps:
Scenario1:
1.Prepare a guest with listen type=none

# virsh dumpxml esx5.5-rhel7.2-x86_64 |grep graphic -A 1
    <graphics type='vnc' port='-1' autoport='yes'>
      <listen type='none'/>
    </graphics>
    <video>

2.Convert this guest by virt-v2v,there is no warning about listen type=none during conversion
# virt-v2v esx5.5-rhel7.2-x86_64 -on listen-none
[   0.0] Opening the source -i libvirt esx5.5-rhel7.2-x86_64
[   0.0] Creating an overlay to protect the source from being modified
[   0.2] Initializing the target -o libvirt -os default
[   0.2] Opening the overlay
[   1.2] Inspecting the overlay
[   9.5] Checking for sufficient free disk space in the guest
[   9.5] Estimating space required on target for each disk
[   9.5] Converting Red Hat Enterprise Linux Server 7.2 (Maipo) to run on KVM
virt-v2v: This guest has virtio drivers installed.
[  74.2] Mapping filesystem data to avoid copying unused and blank areas
[  74.3] Closing the overlay
[  74.6] Checking if the guest needs BIOS or UEFI to boot
[  74.6] Assigning disks to buses
[  74.6] Copying disk 1/1 to /var/lib/libvirt/images/listen-none-sda (raw)
    (100.00/100%)
[ 132.7] Creating output metadata
Pool default refreshed

Domain listen-none defined from /tmp/v2vlibvirtfa30eb.xml

[ 133.4] Finishing off


3.Check the graphic mode of the guest which converted by virt-v2v at step2, the listen type was not changed, and checkpoints of guest are passed

# virsh dumpxml listen-none |grep graphic -A 2
    <graphics type='vnc' port='-1' autoport='yes'>
      <listen type='none'/>
    </graphics>
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>


Scenario2:
1.Prepare a guest which has listen type=socket

# virsh dumpxml esx6.0-rhel6.7-x86_64 |grep graphic -A 2
    <graphics type='spice'>
      <listen type='socket'/>
    </graphics>
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>

   
2.Convert this guest by virt-v2v, there is no warning about listen type=socket during conversion

# virt-v2v esx6.0-rhel6.7-x86_64 -on listen-socket
[   0.0] Opening the source -i libvirt esx6.0-rhel6.7-x86_64
[   0.0] Creating an overlay to protect the source from being modified
[   0.2] Initializing the target -o libvirt -os default
[   0.2] Opening the overlay
[   1.5] Inspecting the overlay
[  12.4] Checking for sufficient free disk space in the guest
[  12.4] Estimating space required on target for each disk
[  12.4] Converting Red Hat Enterprise Linux Server release 6.7 Beta (Santiago) to run on KVM
virt-v2v: This guest has virtio drivers installed.
[  57.9] Mapping filesystem data to avoid copying unused and blank areas
[  58.0] Closing the overlay
[  58.3] Checking if the guest needs BIOS or UEFI to boot
[  58.3] Assigning disks to buses
[  58.3] Copying disk 1/1 to /var/lib/libvirt/images/listen-socket-sda (raw)
    (100.00/100%)
[ 136.3] Creating output metadata
Pool default refreshed

Domain listen-socket defined from /tmp/v2vlibvirt1efeae.xml

[ 136.5] Finishing off


3.Check graphic mode of the guest after finishing v2v conversion,the listen type is not changed and checkpoints of guests are passed

# virsh dumpxml listen-socket |grep graphic -A 2
    <graphics type='spice'>
      <listen type='socket'/>
    </graphics>
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>


According to above verify result, the bug has been fixed.

So move the bug from ON_QA to VERIFIED

Comment 13 errata-xmlrpc 2017-08-01 22:11: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://access.redhat.com/errata/RHBA-2017:2023