Bug 1009008 - virsh resume command should raise error for running VM
virsh resume command should raise error for running VM
Product: Virtualization Tools
Classification: Community
Component: libvirt (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Libvirt Maintainers
Depends On:
  Show dependency treegraph
Reported: 2013-09-17 09:28 EDT by liumbj
Modified: 2016-10-26 13:47 EDT (History)
13 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-10-26 13:47:08 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description liumbj 2013-09-17 09:28:49 EDT
Description of problem:
virsh resume command should raise error for running VM. It seems due to the bug of libvirt.

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

How reproducible:

Steps to Reproduce:
1.[root@host ~]# virsh list --all
 Id    Name                           State
 7     vm1                            running

2.root@host ~]# virsh resume vm1
Domain vm1 resumed

3.[root@host ~]# echo $?

Actual results:
Resume operation doesn't fail.

Expected results:
Error should be raised.

Additional info:
Comment 1 Cole Robinson 2013-10-04 16:51:10 EDT
Not particularly important for Fedora, so moving to the upstream tracker.
Comment 2 Cole Robinson 2016-04-20 12:21:32 EDT
Both the qemu and lxc driver are affected. If the VM is not 'resume'able, the drivers should raise an explicit error, like:

                       "%s", _("domain is not in a resumable state"));
        goto endjob;

For qemu, see src/qemu/qemu_driver.c function qemuDomainResume
For lxc, see src/lxc/lxc_driver.c function lxcDomainResume
Comment 3 Michael Liu 2016-04-27 06:48:01 EDT
please post the version of libvirt? what state is the vm after the operation?
Comment 4 Cole Robinson 2016-04-27 12:41:58 EDT
Relevant with libvirt.git, so libvirt 1.3.3 at least. The VM state doesn't change, the API just doesn't report any error when it doesn't perform any operation.
Comment 5 Sławek Kapłoński 2016-10-20 16:58:23 EDT
I will try to push patch to fix it in next few days.
Comment 6 Martin Kletzander 2016-10-26 13:47:08 EDT
Fixed with commit v2.3.0-134-g62535195bb52

commit 3e044e6e4918905a6b16b3284007856f6b68cf7b
Author: Sławek Kapłoński <slawek@kaplonski.pl>
Date:   Sat Oct 22 12:30:01 2016 +0200

    qemu, lxc: Raise error message when resuming running domain

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