Bug 874979

Summary: The guest can't be resumed successfully when it's managedsaved in "pmsuspended" status
Product: Red Hat Enterprise Linux 7 Reporter: dyuan
Component: libvirtAssignee: Michal Privoznik <mprivozn>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: acathrow, ajia, dallan, dyasny, eblake, honzhang, mzhan, rwu, shyu
Target Milestone: rc   
Target Release: 7.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 875096 (view as bug list) Environment:
Last Closed: 2013-06-27 15:11:32 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:
Bug Depends On: 875096    
Bug Blocks: 923626    

Description dyuan 2012-11-09 09:01:34 UTC
Description of problem:
managedsave the guest which is in "pmsuspended" status ,
then start guest, the status become to "paused" but not "pmsuspemded" and can't resume to original status.

Version-Release number of selected component (if applicable):
libvirt-0.10.2-7.el6
qemu-kvm-rhev-0.12.1.2-2.330.el6
kernel-2.6.32-336.el6

How reproducible:
100%

Steps to Reproduce:
1. pmsuspend the guest to memory

# virsh dompmsuspend --target mem rhel63
Domain rhel63 successfully suspended

# virsh list
Id Name State
----------------------------------------------------
2 rhel63 pmsuspended
1 rhel62 running

2. managed save the guest

# virsh managedsave rhel63

Domain rhel63 state saved by libvirt

# virsh list --all
Id Name State
----------------------------------------------------
1 rhel62 running
- qed shut off
- rhel63 shut off

3. start the guest

====expected result for dompmwakeup
# virsh dompmwakeup rhel63
error: Domain rhel63 could not be woken up
error: Requested operation is not valid: domain is not running

# virsh start rhel63
Domain rhel63 started

====the guest status become to "paused"
# virsh list --all
Id Name State
----------------------------------------------------
1 rhel62 running
2 rhel63 paused
- qed shut off

4. resume the guest

====expected result for dompmwakeup
# virsh dompmwakeup rhel63
Domain rhel63 successfully woken up

# virsh list
Id Name State
----------------------------------------------------
1 rhel62 running
2 rhel63 paused

====can't resume to the original status
# virsh resume rhel63
Domain rhel63 resumed

# virsh list --all
Id Name State
----------------------------------------------------
1 rhel62 running
2 rhel63 running

Actual results:
The guest can't be resumed to the original status when it's pmsuspended.

Expected results:
Can be resumed successfully or can't be saved when it's in pmsuspended status.

Additional info:

Comment 2 Eric Blake 2012-11-09 13:53:35 UTC
This is an inherent limitation of qemu.  Qemu is unable to migrate pmsuspended state, and documents that if you attempt to migrate a guest in pmsuspended state, then the guest will be awakened on the destination end.  Since [managed]save uses migration to and from a file, this is a case where restoring the guest will therefore wake it up, and the best libvirt can do is put the guest in a paused or running state.  There is no way libvirt can restore the guest to an S3 state without a change to qemu.

Comment 5 Michal Privoznik 2013-06-27 15:11:32 UTC
I don't think there's anything libvirt can do about this bug. I mean, if qemu is unable to migrate PMSuspended state, libvirt cannot do anything. If qemu learns to migrate the state, then again - the state will be resumed once the migration data is loaded in. Again, no work for libvirt required. Hence, I think this bug should be closed. If somebody disagrees, please reopen the bug.