Bug 737921

Summary: Spice password on migration target expires before Spice client is connected
Product: Red Hat Enterprise Linux 6 Reporter: Yonit Halperin <yhalperi>
Component: qemu-kvmAssignee: Yonit Halperin <yhalperi>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: urgent Docs Contact:
Priority: high    
Version: 6.1CC: abaron, acathrow, bazulay, berrange, cfergeau, dallan, danken, dblechte, dyuan, iheim, jdenemar, juzhang, kraxel, marcandre.lureau, michen, minovotn, mjenner, mkenneth, mkrcmari, mzhan, qzhang, rwu, tburke, uril, vbian, virt-maint, weizhan, yhalperi
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: qemu-kvm-0.12.1.2-2.206.el6 Doc Type: Bug Fix
Doc Text:
Cause Spice client connected to the migration target only after migration completed. However, the ticket on the target was set before migration started. Consequence If (migration_time > ticket_expiration_time) - spice client failed to connect to the target and aborted. Fix spice server informs spice client to connect to the target before migration starts, upon the client_migrate_info command. client_migrate_info was turned to an async command. spice server waits till the client performed the initial connection (or a timeout), and then calls the completion callback of client_migrate_info. Result Spice client is connected to the migration target after migration.
Story Points: ---
Clone Of: 725009 Environment:
Last Closed: 2011-12-06 16:03:09 UTC Type: ---
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:    
Bug Blocks: 725009, 727602, 731472, 738262, 738268    

Comment 6 Qunfang Zhang 2011-10-19 08:11:11 UTC
Reproduced this issue with the following packages:
kernel-2.6.32-131.0.15.el6.x86_64
qemu-kvm-0.12.1.2-2.160.el6.x86_64
spice-server-0.8.0-1.el6.x86_64
spice-client-0.8.2-3.el6.x86_64

Steps:
1.Boot a guest in the source host with "-spice port=5930,password=redhat -vga qxl -global qxl-vga.vram_size=33554432"
2.Connect the spice session: spicec -h $source_host_ip -p 5930 -w redhat
3.Boot the guest in the destination host with the same command line with listening mode "-incoming tcp:0:5800"
4.In source host:
(qemu)__com.redhat_spice_migrate_info $host_ip 5930
5.In destination host:
(qemu)expire_password spice +10
6.In the source host:
(qemu)migrate -d tcp:$destination_host_ip:5800
(If migration will take 10 seconds for example, then do step 5 on 4 or 5 seconds later after do step 4. To make sure the password expired during migration)

Result: Spice windows closed during migration. And in the destination host,there's some qemu logs as below:

reds_handle_ticket: Ticketing is enabled, but no password is set. please set a ticket first
spice_server_add_interface: SPICE_INTERFACE_TABLET


Verified with the same steps with the following packages:
kernel-2.6.32-209.el6.x86_64
qemu-kvm-0.12.1.2-2.196.el6.x86_64
spice-server-0.8.2-4.el6.x86_64
spice-client-0.8.2-7.el6.x86_64

Results: 
(1)During migration, the spice window does not close though the password has expired.
(2)There's spice notification at the beginning and ending of migration:
(qemu) migrate -d tcp:10.66.9.184:5800
spice_server_migrate_start: 
(qemu) handle_dev_input: stop
spice_server_migrate_end: completed=1
reds_mig_finished

So, this bug is fixed.

Comment 11 Eduardo Habkost 2011-10-28 18:00:04 UTC
Moving to ON_QA because Errata Tool did not do it

Comment 13 Yonit Halperin 2011-11-20 06:31:00 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause
 Spice client connected to the migration target only after migration completed.
However, the ticket on the target was set before migration started.

Consequence
 If (migration_time > ticket_expiration_time) - spice client failed to connect to the target and aborted.

Fix
 spice server informs spice client to connect to the target before migration starts, upon the client_migrate_info command.
client_migrate_info was turned to an async command.
spice server waits till the client performed the initial connection (or a timeout), and then calls the completion callback of client_migrate_info.

Result
 Spice client is connected to the migration target after migration.

Comment 14 errata-xmlrpc 2011-12-06 16:03:09 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/RHSA-2011-1531.html