Bug 846639 - Should forbid suspend&resume operate when guest in pmsuspend status.
Summary: Should forbid suspend&resume operate when guest in pmsuspend status.
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.4
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Michal Privoznik
QA Contact: Virtualization Bugs
Depends On:
TreeView+ depends on / blocked
Reported: 2012-08-08 10:18 UTC by zhe peng
Modified: 2013-02-21 07:21 UTC (History)
8 users (show)

Fixed In Version: libvirt-0.10.0-1.el6
Doc Type: Bug Fix
Doc Text:
Cause: Due to a bug in libvirt code, it was possible to successfully call suspend on a pmsuspended domain. The difference is while in the former case guest OS doesn't know it is being suspended (suspend is just a matter of hypervisor), in the latter case, guest OS cooperation is required. This result in, e.g. guest clock to be synchronized after the resume. Obviously, these two cases are mutually exclusive. Consequence: Libvirt returned success on operation which should fail. Fix: A check for this special case has been added. Result: Libvirt will now refuse to suspend a pmsuspended domain.
Clone Of:
Last Closed: 2013-02-21 07:21:28 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2013:0276 normal SHIPPED_LIVE Moderate: libvirt security, bug fix, and enhancement update 2013-02-20 21:18:26 UTC

Description zhe peng 2012-08-08 10:18:45 UTC
Description of problem:
when guest in pmsuspend status, should forbid suspend&resume guest.

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

How reproducible:

Steps to Reproduce:
1. install qemu-ga in the domain [qemu-guest-agent]   and  add xml into

<channel type='unix'>
       <source mode='bind' path='/var/lib/libvirt/qemu/tests3.agent'/>
       <target type='virtio' name='org.qemu.guest_agent.0'/>
       <alias name='channel0'/>
       <address type='virtio-serial' controller='0' bus='0' port='1'/>

2. start domain   and login domain , run qemu-ga -d  in the domain
#qemu-ga -d

3.in the host  run pmsuspend
#virsh dompmsuspend $domain --target mem

check domain status
#virsh domstate $domain

4.suspend& resume $domain
#virsh suspend $domain
 Domain tests3 suspended

#virsh resume $domain
 Domain tests3 resumed

#virsh state $domain

use virt-viewer to check guest, seem in pmsuspend status.

Actual results:
see step 4

Expected results:
when guest in s3 , should not do suspend&resume

Additional info:

Comment 2 Michal Privoznik 2012-08-23 13:32:05 UTC
Patch proposed upstream:


Comment 3 Michal Privoznik 2012-08-24 06:29:34 UTC
Moving to POST:

commit 385ee0e982080d03ce0d11eab32396c0d7057961
Author:     Michal Privoznik <mprivozn@redhat.com>
AuthorDate: Thu Aug 23 15:26:20 2012 +0200
Commit:     Michal Privoznik <mprivozn@redhat.com>
CommitDate: Thu Aug 23 17:48:44 2012 +0200

    qemu: forbid suspend if already pmsuspended
    If a domain is pmsuspended then virsh suspend will succeed. Beside
    obvious flaw, virsh resume will report success and change domain
    state to running which is another mistake. Therefore we must forbid
    any attempts for suspend and resume when pmsuspended.


Comment 5 zhpeng 2012-08-30 06:31:59 UTC
Test with:

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

virsh # suspend rhel63
error: Failed to suspend domain rhel63
error: Requested operation is not valid: domain is pmsuspended

virsh # resume rhel63
error: Failed to resume domain rhel63
error: Requested operation is not valid: domain is pmsuspended

virsh # dompmwakeup rhel63
Domain rhel63 successfully woken up
virsh # domstate rhel63

virsh # suspend rhel63
Domain rhel63 suspended

virsh # domstate rhel63

virsh # resume rhel63
Domain rhel63 resumed

virsh # domstate rhel63

So change status to VERIFIED

Comment 6 errata-xmlrpc 2013-02-21 07:21:28 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.


Note You need to log in before you can comment on or make changes to this bug.