Bug 1236585

Summary: [libvirt][events] SPICE Graphic events are missing the port of remote/local connections in the 'service' field
Product: Red Hat Enterprise Linux 7 Reporter: Vinzenz Feenstra [evilissimo] <vfeenstr>
Component: libvirtAssignee: Peter Krempa <pkrempa>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.1CC: dyuan, fjin, mzhan, pkrempa, rbalakri, virt-bugs, zhwang
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-1.2.17-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1236581 Environment:
Last Closed: 2015-11-19 06:42:13 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: 1236581    
Bug Blocks: 1203891    

Description Vinzenz Feenstra [evilissimo] 2015-06-29 13:18:26 UTC
+++ This bug was initially created as a clone of Bug #1236581 +++

Description of problem:
Currently the connected, initialized and disconnected spice events reported by libvirt contain a 'service' field with an empty value.


Actual results:

service field is empty

Expected results:

service field contains the port of the remote and local service

Additional info:


The reason for this is, that the code in libvirt erroneously tries to extract the 'service' field from the event sent through qmp monitor.
The field however on spice events is called 'port'

Comment 1 Peter Krempa 2015-06-30 11:53:50 UTC
Fixed upstream by:

commit 15632a312efea02b9002a230c0dde1d206184eef
Author: Peter Krempa <pkrempa>
Date:   Mon Jun 29 17:03:14 2015 +0200

    qemu: event: Clean up VNC monitor handling
    
    Get rid of spice specific stuff from the handler func and save a few
    lines by reflowing the conditions.

commit 8df888a532db0994519bbe0d9900f622ef3e3922
Author: Peter Krempa <pkrempa>
Date:   Mon Jun 29 16:10:51 2015 +0200

    qemu: event: Properly handle spice events
    
    Spice events have mostly similar information present in the event JSON
    but they differ in the name of the element containing the port.
    
    The JSON event also provides connection ID which might be useful in the
    future.
    
    This patch splits up the event parser code into two functions and the
    SPICE reimplements the event parsing with correct names and drops the
    VNC only stuff.

v1.2.17-rc1-8-g15632a3

Comment 3 Fangge Jin 2015-07-16 09:46:22 UTC
Reproduce this bug on build libvirt-1.2.16-1.el7.x86_64:

1.Prepare a running guest with spice and vnc graphic:
# virsh dumpxml r71 
    <graphics type='vnc' port='5902' autoport='yes' listen='0.0.0.0'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <graphics type='spice' port='5903' autoport='yes' listen='0.0.0.0'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>

2.# virsh event --loop --event graphics

3. Connect to r71 with spice and then close:
# remote-viewer spice://10.66.6.6:5903

4.Check the output of "virsh event":
event 'graphics' for domain r71: connect local[IPv4 10.66.6.6 ] remote[IPv4 10.66.6.6 ] 
event 'graphics' for domain r71: initialize local[IPv4 10.66.6.6 ] remote[IPv4 10.66.6.6 ] none
...............
event 'graphics' for domain r71: disconnect local[IPv4 10.66.6.6 ] remote[IPv4 10.66.6.6 ] 
...............

5.Connect to r71 with vnc and then close:
#remote-viewer vnc://10.66.6.6:5902

6.Check the output of "virsh event":
event 'graphics' for domain r71: connect local[IPv4 0.0.0.0 5902] remote[IPv4 10.66.6.6 33167] none
event 'graphics' for domain r71: initialize local[IPv4 0.0.0.0 5902] remote[IPv4 10.66.6.6 33167] none
event 'graphics' for domain r71: disconnect local[IPv4 0.0.0.0 5902] remote[IPv4 10.66.6.6 33167] none

As we can see, spice events miss the port.


Verify this bug on build libvirt-1.2.17-2.el7.x86_64:
1. Connect to r71 with spice and then close:
# remote-viewer spice://10.66.6.6:5903

2.Check the output of "virsh event":
event 'graphics' for domain r71: connect local[IPv4 10.66.6.6 5903] remote[IPv4 10.66.6.6 48910] 
event 'graphics' for domain r71: initialize local[IPv4 10.66.6.6 5903] remote[IPv4 10.66.6.6 48910] none
................
event 'graphics' for domain r71: disconnect local[IPv4 10.66.6.6 5903] remote[IPv4 10.66.6.6 48910] 
...............


3.Connect to r71 with vnc and then close:
#remote-viewer vnc://10.66.6.6:5902

4.Check the output of "virsh event":
event 'graphics' for domain r71: connect local[IPv4 0.0.0.0 5902] remote[IPv4 10.66.6.6 39167] none
event 'graphics' for domain r71: initialize local[IPv4 0.0.0.0 5902] remote[IPv4 10.66.6.6 39167] none
event 'graphics' for domain r71: disconnect local[IPv4 0.0.0.0 5902] remote[IPv4 10.66.6.6 39167] none

As we can see, both spice and vnc events have port.


Are the steps above enough to verify this bug?

Comment 4 Peter Krempa 2015-07-16 12:30:47 UTC
Yes, that looks okay.

Comment 6 errata-xmlrpc 2015-11-19 06:42:13 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-2202.html