Bug 707212

Summary: support connected paramater in set_password
Product: Red Hat Enterprise Linux 6 Reporter: Alon Levy <alevy>
Component: libvirtAssignee: Michal Privoznik <mprivozn>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: medium    
Version: 6.2CC: bazulay, berrange, dallan, dblechte, djasa, dyuan, eblake, gren, iheim, jlibosva, mkrcmari, rwu, vbian, veillard, zpeng
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-0.9.4-2.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 11:10:58 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 689363, 730297, 818350, 818351, 818354    
Attachments:
Description Flags
/var/log/libvirtd.log none

Description Alon Levy 2011-05-24 12:15:50 UTC
Description of problem:
when issueing a setVmTicket with a spice connection there is an additional parameter available in qemu that determines the behavior with an existing client. This needs to be exported to libvirt users.

The complete command that needs to be supported is:
 set_password protocol password action-if-connected

action-if-connected supported (see monitor.c) are:
 fail
 disconnect
 keep

Comment 2 Michal Privoznik 2011-05-30 16:24:34 UTC
Patch sent upstream for review:

https://www.redhat.com/archives/libvir-list/2011-May/msg01854.html

Comment 4 Michal Privoznik 2011-06-13 15:50:15 UTC
Wasn't good enough. Sent another version:

https://www.redhat.com/archives/libvir-list/2011-June/msg00413.html

Comment 5 Michal Privoznik 2011-07-08 15:05:44 UTC
Pushed upstream:

commit 30c43afd73e8c2931dc210562066ba37a8b9fe26
Author: Michal Privoznik <mprivozn>
Date:   Thu May 26 16:15:54 2011 +0200

    graphics: add support for action_if_connected in qemu
    
    This option accepts 3 values:
    -keep, to keep current client connected (Spice+VNC)
    -disconnect, to disconnect client (Spice)
    -fail, to fail setting password if there is a client connected (Spice)

v0.9.3-39-g30c43af

This feature is accesible via 'connected' attribute of <graphics> element.

Comment 7 Vivian Bian 2011-07-18 11:45:13 UTC
tested with 
libvirt-0.9.3-5.el6.x86_64
qemu-kvm-0.12.1.2-2.169.el6.x86_64
kernel-2.6.32-166.el6.x86_64

# virsh dumpxml --security-info spice
<graphics type='spice' port='5900' tlsPort='5901' autoport='yes' listen='0.0.0.0' passwd='aaabbb' connected='disconnect'/>

# cat spice-new.xml
    <graphics type='spice' port='5900' tlsPort='5901' autoport='yes' listen='0.0.0.0' passwd='cccddd' connected='disconnect'/>

# virsh update-device spice spice-new.xml
Device updated successfully

spice client doesn't get disconnected 


# virsh dumpxml --security-info spice
<graphics type='spice' port='5900' tlsPort='5901' autoport='yes' listen='0.0.0.0' passwd='aaabbb' connected='keep'/>

# cat spice-new.xml
    <graphics type='spice' port='5900' tlsPort='5901' autoport='yes' listen='0.0.0.0' passwd='cccddd' connected='keep'/>

# virsh update-device spice spice-new.xml
Device updated successfully

spice client keep connection


# virsh dumpxml --security-info spice
<graphics type='spice' port='5900' tlsPort='5901' autoport='yes' listen='0.0.0.0' passwd='aaabbb' connected='fail'/>

# cat spice-new.xml
    <graphics type='spice' port='5900' tlsPort='5901' autoport='yes' listen='0.0.0.0' passwd='cccddd' connected='fail'/>

# virsh update-device spice spice-new.xml
Device updated successfully

there is no error prompt for spice passwd changing . 


# virsh dumpxml --security-info vnc
<graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0' passwd='aaabbb' connected='keep'/>

# cat vnc-new.xml
    <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0' passwd='cccddd' connected='keep'/>

# virsh update-device spice spice-new.xml
Device updated successfully

vnc connection keeps connected . 


From the result ,we can see the spice part doesn't meet the expected result 
keep = keep them connected, disconnect - disconnect them, fail - fail changing password


Set the bug status to ASSIGNED

Comment 8 Michal Privoznik 2011-07-21 09:53:34 UTC
Vivian,

VNC supports "connected=keep" only. Spice should support all three parameters.
Can you please provide a full libvirt debug log, so I can see what commands are send to QEMU (this means don't set any filter in config)?

Thanks

Comment 9 Vivian Bian 2011-07-22 09:10:51 UTC
Created attachment 514642 [details]
/var/log/libvirtd.log

tested with libvirt-0.9.3-7.el6.x86_64

steps:
1. set log_level=1 and  log_outputs="1:file:/var/log/libvirtd.log" 
2. repeat the steps in comment7 . 

Paste the required log here called libvirtd.log

Comment 12 Vivian Bian 2011-08-01 09:01:51 UTC
VERIFIED with 
libvirt-0.9.4-0rc2.el6.x86_64
qemu-kvm-0.12.1.2-2.175.el6.x86_64


Steps:
# virsh dumpxml --security-info spice
<graphics type='spice' port='5900' tlsPort='5901' autoport='yes'
listen='0.0.0.0' passwd='aaabbb' connected='disconnect'/>

# cat spice-new.xml
    <graphics type='spice' port='5900' tlsPort='5901' autoport='yes'
listen='0.0.0.0' passwd='cccddd' connected='disconnect'/>

# virsh update-device spice spice-new.xml
Device updated successfully

spice console got disconnected 


# virsh dumpxml --security-info spice
<graphics type='spice' port='5900' tlsPort='5901' autoport='yes'
listen='0.0.0.0' passwd='aaabbb' connected='disconnect'/>

# cat spice-new.xml
    <graphics type='spice' port='5900' tlsPort='5901' autoport='yes'
listen='0.0.0.0' passwd='cccddd' connected='keep'/>

# virsh update-device spice spice-new.xml
Device updated successfully

spice console session got kept

# virsh dumpxml --security-info spice
<graphics type='spice' port='5900' tlsPort='5901' autoport='yes'
listen='0.0.0.0' passwd='aaabbb' connected='disconnect'/>

# cat spice-new.xml
    <graphics type='spice' port='5900' tlsPort='5901' autoport='yes'
listen='0.0.0.0' passwd='cccddd' connected='fail'/>

# virsh update-device spice spice-new.xml
error: Failed to update device from spice-new.xml
error: internal error unable to execute QEMU command '__com.redhat_set_password': Could not set password

threw error when failed to update passwd , and spice session kept 


# virsh dumpxml --security-info vnc
<graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0' passwd='aaabbb'
connected='keep'/>

# cat vnc-new.xml
    <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0'
passwd='cccddd' connected='keep'/>

# virsh update-device spice spice-new.xml
Device updated successfully

vnc connection keeps connected . 


So set bug status to VERIFIED

Comment 13 Vivian Bian 2011-08-01 09:21:58 UTC
tried with 
libvirt-0.9.4-0rc2.el6.x86_64
qemu-kvm-0.12.1.2-2.175.el6.x86_64

steps 
# virsh dumpxml --security-info spice
<graphics type='spice' port='5900' tlsPort='5901' autoport='yes'
listen='0.0.0.0' passwd='aaabbb' connected='disconnect'/>

# cat spice-new.xml
    <graphics type='spice' port='5900' tlsPort='5901' autoport='yes'
listen='0.0.0.0' passwd='aaabbb' connected='disconnect'/>

# virsh update-device spice spice-new.xml
Device updated successfully

with the same password , after updating device , spice console DID NOT get disconnected

So have to reassign this bug

Comment 14 Eric Blake 2011-08-02 14:23:29 UTC
next version of patch in POST (but with poor subject line):
http://post-office.corp.redhat.com/archives/rhvirt-patches/2011-July/msg01023.html

Comment 15 Eric Blake 2011-08-03 12:12:30 UTC
*** Bug 727841 has been marked as a duplicate of this bug. ***

Comment 16 Daniel Berrangé 2011-08-03 12:39:14 UTC
The patch committed in CVS does not match what Eric posted in comment #14, so putting this back to POST

Comment 17 Daniel Veillard 2011-08-04 01:57:18 UTC
Yeah I will have to incorporate this in a follow8ing build, possibly
next monday libvirt-0.9.4-2.el6


Daniel

Comment 18 Vivian Bian 2011-08-09 11:00:20 UTC
VERIFIED with 
libvirt-0.9.4-2.el6.x86_64
qemu-kvm-0.12.1.2-2.175.el6.x86_64


Steps:
# virsh dumpxml --security-info spice
<graphics type='spice' port='5900' tlsPort='5901' autoport='yes'
listen='0.0.0.0' passwd='aaabbb' connected='disconnect'/>

# cat spice-new.xml
    <graphics type='spice' port='5900' tlsPort='5901' autoport='yes'
listen='0.0.0.0' passwd='cccddd' connected='disconnect'/>

# virsh update-device spice spice-new.xml
Device updated successfully

spice console got disconnected 


# virsh dumpxml --security-info spice
<graphics type='spice' port='5900' tlsPort='5901' autoport='yes'
listen='0.0.0.0' passwd='aaabbb' connected='disconnect'/>

# cat spice-new.xml
    <graphics type='spice' port='5900' tlsPort='5901' autoport='yes'
listen='0.0.0.0' passwd='cccddd' connected='keep'/>

# virsh update-device spice spice-new.xml
Device updated successfully

spice console session got kept

# virsh dumpxml --security-info spice
<graphics type='spice' port='5900' tlsPort='5901' autoport='yes'
listen='0.0.0.0' passwd='aaabbb' connected='disconnect'/>

# cat spice-new.xml
    <graphics type='spice' port='5900' tlsPort='5901' autoport='yes'
listen='0.0.0.0' passwd='cccddd' connected='fail'/>

# virsh update-device spice spice-new.xml
error: Failed to update device from spice-new.xml
error: internal error unable to execute QEMU command
'__com.redhat_set_password': Could not set password

threw error when failed to update passwd , and spice session kept 


# virsh dumpxml --security-info vnc
<graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0' passwd='aaabbb'
connected='keep'/>

# cat vnc-new.xml
    <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0'
passwd='cccddd' connected='keep'/>

# virsh update-device spice spice-new.xml
Device updated successfully

vnc connection keeps connected . 

# virsh dumpxml --security-info spice
<graphics type='spice' port='5900' tlsPort='5901' autoport='yes'
listen='0.0.0.0' passwd='aaabbb' connected='disconnect'/>

# cat spice-new.xml
    <graphics type='spice' port='5900' tlsPort='5901' autoport='yes'
listen='0.0.0.0' passwd='aaabbb' connected='disconnect'/>

# virsh update-device spice spice-new.xml
Device updated successfully

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

without connected option set , guest could be started successfully . 

So set bug status to VERIFIED

Comment 21 errata-xmlrpc 2011-12-06 11:10:58 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.

http://rhn.redhat.com/errata/RHBA-2011-1513.html