Bug 825600 - spice client could not disconnect after update graphics with connected='disconnect'
spice client could not disconnect after update graphics with connected='disco...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.3
Unspecified Linux
medium Severity medium
: rc
: ---
Assigned To: Peter Krempa
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-27 23:03 EDT by yanbing du
Modified: 2013-02-21 02:15 EST (History)
7 users (show)

See Also:
Fixed In Version: libvirt-0.9.13-3.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-21 02:15:41 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description yanbing du 2012-05-27 23:03:43 EDT
Description of problem:
set attribute connected='disconnect' of <graphics> element. Then with the same password, after updating device , spice client could not disconnect.


Version-Release number of selected component (if applicable):
libvirt-0.9.10-21.el6
spice-server-0.10.1-6.el6.x86_64
spice-glib-0.11-9.el6.x86_64
spice-gtk-0.11-9.el6.x86_64
spice-client-0.8.2-15.el6.x86_64
spice-gtk-python-0.11-9.el6.x86_64


How reproducible:
100%

Steps to Reproduce:
# virsh dumpxml --security-info spice-test
<graphics type='spice' port='5900' autoport='yes' listen='0.0.0.0' passwd='aaabbb' connected='disconnect'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
2. Start the guest and open the spice client.
# spicec -h 127.0.0.1 -p 5900 -w aaabbb
3. Prepare a graphics xml file for guest update
#cat spice-new.xml
<graphics type='spice' port='5900' autoport='yes' listen='0.0.0.0' passwd='aaabbb' connected='disconnect'/>
4. update the guest with the xml 
# virsh update-device spice-test spcie-new.xml 
Device updated successfully
  
Actual results:
spice client could not disconnect

Expected results:
with the same password , after updating device , spice console gets disconnected

Additional info:
In bug 707212, this problem is covered and verified.
https://bugzilla.redhat.com/show_bug.cgi?id=707212#c13
Comment 2 Andrew Cathrow 2012-05-28 15:33:47 EDT
Are we sure this is libvirt specific, eg does this work with commandline/qemu -
Comment 4 yanbing du 2012-05-31 22:49:53 EDT
(In reply to comment #2)
> Are we sure this is libvirt specific, eg does this work with
> commandline/qemu -

In fact, this feature work with qemu, you can reference to bug 707212 - support connected paramater in set_password.
"when issueing a setVmTicket with a spice connection there is an additional parameter available in qemu that determines the behavior with an existing client."
libvirt add this parameter to export it in libvirt side. In fact, it works well when update the graphics with different password, but fail with the same password.
Comment 5 Peter Krempa 2012-06-14 09:21:54 EDT
Fixed upstream:

commit e0f0131d33e283f1b76c05eb7bef4bbbb3f2fd72
Author: Peter Krempa <pkrempa@redhat.com>
Date:   Thu Jun 14 14:48:42 2012 +0200

    qemu: Enable disconnecting SPICE clients without changing password
    
    Libvirt updates the configuration of SPICE server only when something
    changes. This is unfortunate when the user wants to disconnect a
    existing spice session when the connected attribute is already
    "disconnect".
    
    This patch modifies the conditions for calling the password updater to
    be called when nothing changes, but the connected attribute is already
    "disconnect".
Comment 7 zhe peng 2012-07-24 02:00:57 EDT
can reproduce with libvirt-0.9.10-21.el6

verify with:
libvirt-0.9.13-3.el6.x86_64
spice-gtk-0.11-11.el6.x86_64
spice-server-0.10.1-10.el6.x86_64

step:
  1:prepare a guest with spice,and set spice password to 'redhat'
  2:virsh dumpxml $guest --security-info
  ......
  <graphics type='spice' port='5900' tlsPort='5907' autoport='yes' listen='0.0.0.0' keymap='en-us' passwd='redhat' passwdValidTo='2022-02-27T19:46:10' connected='disconnect'>
      <listen type='address' address='0.0.0.0'/>
      <channel name='main' mode='secure'/>
      <channel name='inputs' mode='secure'/>
    </graphics>
  ......
  3:start the guest and connect the console with virt-viewer or spicec:
   remote-viewer spice://127.0.0.1/?port=5900\&tls-port=5907 --spice-host-subject="C=IL,L=Raanana,O=Red Hat,CN=my server" --spice-ca-file='/etc/pki/libvirt-spice/ca-cert.pem' or
   spicec -h 127.0.0.1 -p 5900 -s 5907 -w redhat --host-subject "C=IL,L=Raanana,O=Red Hat,CN=my server" --ca-file '/etc/pki/libvirt-spice/ca-cert.pem'
  4:prepare a xml
  #cat spice-new.xml
  <graphics type='spice' port='5900' tlsPort='5907' autoport='yes' listen='0.0.0.0' keymap='en-us' passwd='redhat' passwdValidTo='2022-02-27T19:46:10' connected='disconnect'>
      <listen type='address' address='0.0.0.0'/>
            <channel name='main' mode='secure'/>
                  <channel name='inputs' mode='secure'/>
                      </graphics>
  5:update the guest with the xml 
   # virsh update-device $guest spcie-new.xml 
   Device updated successfully

  with the same password , after updating device , spice console gets disconnected. verification passed.
Comment 8 errata-xmlrpc 2013-02-21 02:15:41 EST
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.

http://rhn.redhat.com/errata/RHSA-2013-0276.html

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