Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 510459

Summary: KVM does not honour the -S flag, and resumes CPU execution after incoming migration completes.
Product: Red Hat Enterprise Linux 5 Reporter: Paolo Bonzini <pbonzini>
Component: kvmAssignee: Paolo Bonzini <pbonzini>
Status: CLOSED DUPLICATE QA Contact: Lawrence Lim <llim>
Severity: high Docs Contact:
Priority: low    
Version: 5.5CC: berrange, gcosta, tburke, tools-bugs, virt-maint, xen-maint, ykaul
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-08-04 12:00:20 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:
Attachments:
Description Flags
qemu patch to fix the bug
none
patch matching upstream none

Description Paolo Bonzini 2009-07-09 11:41:21 UTC
Description of problem:
When a suspended VM is saved and later restored, virsh list shows it as paused, but the VM is actually running

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

How reproducible:
Create a KVM virtual machine, suspend it, save it, restore it, run virt-viewer on it.

Steps to Reproduce:
1. Start a task in a KVM virtual machine, e.g. seq 1 10000000
2. Suspend the virtual machine: virsh suspend EXAMPLE
3. virsh save EXAMPLE test.qemu
4. virsh restore test.qemu
5. virt-viewer EXAMPLE

Actual results:
Numbers keep scrolling on the VM

Expected results:
Numbers should not scroll in the VM

Additional info:
libvirt actually believes the domain is paused, so that you need "virsh resume EXAMPLE && virsh suspend EXAMPLE" to really pause it.

Saving a suspended VM does not work at all for Xen.

Comment 1 Paolo Bonzini 2009-07-09 13:06:09 UTC
The Xen bug, for the record, is bug 504910.  This bug is a bit more severe though, IMO (doing nothing is worse than doing it wrong).

Comment 2 Daniel Veillard 2009-07-10 12:41:21 UTC
Hum, this is coming a bit late in the game for Update 4, we have no patch
yet, it's not a very common scenario, and probably not very crucial, the
resume/suspend after restore is not ideal but probably workable in most cases.
So I suggest to retarget it for update 5 at this point,

 thanks for raising the issue though we need to get this fixed upstream,
my assumption is that we don't look at the suspended information when
restoring the domain at some low level while libvirt is aware of it.

Daniel

Comment 3 Daniel Berrangé 2009-07-10 12:54:09 UTC
This isn't a libvirt problem. This is a bug in QEMU/KVM. After the 'migrate' command finishes it should *not* be starting execution of the CPUs. Resuming execution is a policy decision for the management tool to make. libvirt explicitly starts the VM with '-S' for stopped, and QEMU should not override this and start the VM after migrate when this is the case.

Comment 4 Paolo Bonzini 2009-07-14 13:45:15 UTC
Created attachment 351586 [details]
qemu patch to fix the bug

I submitted this patch upstream.

Comment 5 Paolo Bonzini 2009-07-30 14:19:53 UTC
Created attachment 355681 [details]
patch matching upstream

This patch includes an additional fix from Glauber Costa.

Comment 6 Dor Laor 2009-08-04 12:00:20 UTC

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