Bug 867737

Summary: spice migration: prevent race with libvirt
Product: Red Hat Enterprise Linux 6 Reporter: zhe peng <zpeng>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED DUPLICATE QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: medium    
Version: 6.4CC: acathrow, dyasny, dyuan, mprivozn, mzhan
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-10-18 08:23:45 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:

Description zhe peng 2012-10-18 08:19:11 UTC
Description of problem:
this issue same with bug: 836135, but before migration, using virt-viewer or remote-viewer to connect the guest.


Version-Release number of selected component (if applicable):
libvirt-0.10.2-4.el6.x86_64
qemu-kvm-0.12.1.2-2.320.el6.x86_64
spice-server-0.12.0-1.el6.x86_64
spice-gtk-0.14-2.el6.x86_64
spice-protocol-0.12.2-1.el6.noarch
virt-viewer-0.5.2-14.el6.x86_64

How reproducible:
alwasy

Steps to Reproduce:
1.before migrate, using virt-viewer or remote-viewer to connect the guest
2.doing migration
3.when migrate end,check libvirt log file
  
Actual results:
cat /var/log/libvirt/libvirtd.log
......
2012-10-18 02:33:02.456+0000: 30339: debug : qemuMonitorIOProcess:354 : QEMU_MONITOR_IO_PROCESS: mon=0x7ff5c40df5c0 buf={"return": {"migrated": false, "enabled": true, "auth": "none", "port": 5903, "host": "0.0.0.0", "channels": [{"port": "56172", "family": "ipv4", "channel-type": 1, "connection-id": 1681692777, "host": "127.0.0.1", "channel-id": 0, "tls": false}, {"port": "56178", "family": "ipv4", "channel-type": 4, "connection-id": 1681692777, "host": "127.0.0.1", "channel-id": 0, "tls": false}, {"port": "56179", "family": "ipv4", "channel-type": 3, "connection-id": 1681692777, "host": "127.0.0.1", "channel-id": 0, "tls": false}, {"port": "56177", "family": "ipv4", "channel-type": 2, "connection-id": 1681692777, "host": "127.0.0.1", "channel-id": 0, "tls": false}]}, "id": "libvirt-82"}^M
 len=681
......

only get false,not see any "migrated: true" in log.

Expected results:
libvirt should have waited for spice migration status changes, and only then close the src qemu.


Additional info:
refer https://bugzilla.redhat.com/show_bug.cgi?id=836133#c28
Yes, there is a problem: when a spice client is not opened, spice server will change the migration status to "true" immediately. But, when a spice client is up, the spice session data is migrated, and it takes longer (the data passes from the src ,via the client, to the destination). Only when this transfer ends, the migration status changes and the corresponding qmp event is emitted. libvirt should have waited for this change, and only then close the src qemu. According to what you have reported, libvirt didn't wait till the migration status had changed, and closed qemu before query-spice returned "Migrated: true".

Comment 1 Michal Privoznik 2012-10-18 08:23:45 UTC

*** This bug has been marked as a duplicate of bug 867724 ***