RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 846639 - Should forbid suspend&resume operate when guest in pmsuspend status.
Summary: Should forbid suspend&resume operate when guest in pmsuspend status.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.4
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Michal Privoznik
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
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:
Environment:
Last Closed: 2013-02-21 07:21:28 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2013:0276 0 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):
libvirt-0.10.0-0rc0.el6.x86_64
qemu-kvm-0.12.1.2-2.295.el6.x86_64

How reproducible:
always

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

<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'/>
     </channel>

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
pmsuspended

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

#virsh resume $domain
 Domain tests3 resumed

#virsh state $domain
running

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:

https://www.redhat.com/archives/libvir-list/2012-August/msg01637.html

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

commit 385ee0e982080d03ce0d11eab32396c0d7057961
Author:     Michal Privoznik <mprivozn>
AuthorDate: Thu Aug 23 15:26:20 2012 +0200
Commit:     Michal Privoznik <mprivozn>
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.


v0.10.0-rc1-16-g385ee0e

Comment 5 zhpeng 2012-08-30 06:31:59 UTC
Test with:
libvirt-0.10.0-1.el6.x86_64
qemu-kvm-0.12.1.2-2.307.el6.x86_64

Steps:
virsh # dompmsuspend rhel63 --target mem
Domain rhel63 successfully suspended
virsh # domstate rhel63
pmsuspended

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
running

virsh # suspend rhel63
Domain rhel63 suspended

virsh # domstate rhel63
paused

virsh # resume rhel63
Domain rhel63 resumed

virsh # domstate rhel63
running

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.

http://rhn.redhat.com/errata/RHSA-2013-0276.html


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