Bug 784813

Summary: Handle spice events
Product: [Fedora] Fedora Reporter: Jakub Libosvar <jlibosva>
Component: libvirtAssignee: Laine Stump <laine>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 16CC: berrange, clalancette, crobinso, dallan, dougsland, itamar, jforbes, laine, libvirt-maint, veillard, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-07-05 19:43:52 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Description Flags
upstream patch backported to Fedora 16 none

Description Jakub Libosvar 2012-01-26 05:40:52 EST
Description of problem:
Events from qemu such as SPICE_CONNECTED, SPICE_DISCONNECTED are not handled in libvirt.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Have a script with registered callback function for event libvirt.VIR_DOMAIN_EVENT_ID_GRAPHICS
2. Have running domain with spice
3. Connect to domain via spice and disconnect
Actual results:
Callback function is not called

Expected results:
Callback function is called

Additional info:
2012-01-26 10:02:20.381+0000: 26265: debug : qemuMonitorJSONIOProcessLine:114 : Line [{"timestamp": {"seconds": 1327572140, "microseconds": 381577}, "event": "SPICE_DISCONNECTED", "data": {"server": {"port": "5901", "family": "ipv4", "host": "<hostIP>"}, "client": {"port": "51059", "family": "ipv4", "host": "<clientIP>"}}}]
Comment 1 Dave Allan 2012-01-26 22:27:02 EST
Hi Jakub, handling the spice events shouldn't be difficult; I noticed you marked the BZ urgent though; can you provide a little background on what you need this functionality for and when?
Comment 2 Jakub Libosvar 2012-01-27 02:15:43 EST
These events are used in oVirt Project by guest agents on Fedora guest OS to lock user Gnome or KDE session. If this event is not handled in libvirt, the session in guest VM is not locked so I considered it as security issue.
Comment 3 Daniel Berrange 2012-01-27 05:06:39 EST
This is a case where we added support for those events in RHEL first, and then forgot to apply the patch upstream later :-( The existing RHEL patch should just be commited upstream.
Comment 4 Dave Allan 2012-02-17 15:05:50 EST
(In reply to comment #3)
> This is a case where we added support for those events in RHEL first, and then
> forgot to apply the patch upstream later :-( The existing RHEL patch should
> just be commited upstream.

Laine, would you mind doing that?
Comment 5 Laine Stump 2012-02-17 22:10:45 EST
The patch I see in RHEL is one that adds the events "__com.redhat_SPICE_INITIALIZED" and "__com.redhat_SPICE_DISCONNECTED". This sounds like not exactly what we want upstream. Or am I misunderstanding something?
Comment 6 Dave Allan 2012-02-22 14:20:32 EST
I believe that's generally what's wanted, but you do need to make sure that the event names are correct.  IMO we should support whatever upstream qemu does + any RHEL specific versions.
Comment 7 Laine Stump 2012-03-15 11:32:39 EDT
A patch has been pushed upstream:

commit 89ae6a5a30bd91cfb2365544f9dd2e6c2a36ecca
Author: Laine Stump <laine@laine.org>
Date:   Wed Mar 14 01:41:35 2012 -0400

    Emit graphics events when a SPICE client connects/disconnects
    Wire up the domain graphics event notifications for SPICE. Adapted
    from a RHEL-only patch written by Dan Berrange that used custom
    __com.redhat_SPICE events - equivalent events are now available in
    upstream QEMU (including a SPICE_CONNECTED event, which was missing in
    the __COM.redhat_SPICE version).
Comment 8 Laine Stump 2012-03-15 11:36:16 EDT
Created attachment 570328 [details]
upstream patch backported to Fedora 16

This patch was backported from upstream to Fedora 16. You should be able to just drop it into the f16 libvirt directory and add it to the patch list. There were no conflicts in the backport.

Note that it does *not* add support for the redhat-specific events, as those will never be in upstream qemu, and will eventually be deprecated in RHEL.
Comment 9 Fedora Update System 2012-06-24 19:54:04 EDT
libvirt- has been submitted as an update for Fedora 16.
Comment 10 Fedora Update System 2012-06-25 20:54:57 EDT
Package libvirt-
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing libvirt-'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
Comment 11 Fedora Update System 2012-07-05 19:43:52 EDT
libvirt- has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.