Bug 746007 - After using 'shutdown' on a xen guest, virt-manager still reports guest is running
After using 'shutdown' on a xen guest, virt-manager still reports guest is ru...
Product: Fedora
Classification: Fedora
Component: libvirt (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Libvirt Maintainers
Fedora Extras Quality Assurance
: 733433 746503 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2011-10-13 11:41 EDT by Tim Flink
Modified: 2012-07-05 19:44 EDT (History)
16 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-07-05 19:44:32 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
screenshot of xm, virsh and virt-manager showing status (315.65 KB, image/png)
2011-10-13 11:41 EDT, Tim Flink
no flags Details

  None (edit)
Description Tim Flink 2011-10-13 11:41:42 EDT
Created attachment 528059 [details]
screenshot of xm, virsh and virt-manager showing status

Description of problem:
When I shutdown a xen guest, vmm still shows it as running even though virsh and xm don't (see attached screenshot).

This means that I can't start the domain from virt-manager again because the only options are shutdown related (pause, force-off etc.)

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

How reproducible:
Every time

Steps to Reproduce:
1. start Xen domain
2. stop xen domain
Actual results:
xen domain still shows up as running in virt-manager after it has been stopped and the domain cannot be "powered on" from virt-manager

Expected results:
Xen domain shows up as stopped in virt-manager, able to "power on" domain from virt-manager
Comment 1 Cole Robinson 2012-01-29 13:51:55 EST
This is a libvirt issue, present in f16 and current upstream. The issue is that invoking shutdown() on a xen guest leaves it reporting domain state 0 (unknown) for the vm object that was shut down. However, if you re-fetch the domain object, it reports the correct state of 5 (shutoff). So something is funky in xen or the xen driver.

This doesn't seem to affect the 'destroy'/'force poweroff' command


$ cat test.py 
import libvirt
import time

conn = "xen:///"
vmname = "xenlivecd"

conn = libvirt.open(conn)
vm = conn.lookupByName(vmname)

if vm.info()[0] == libvirt.VIR_DOMAIN_SHUTOFF:
    print "Starting %s" % vmname

print "Shutting off %s" % vmname

print "Domain state is %s" % vm.info()[0]
print "Refreshed domain state is %s" % conn.lookupByName(vmname).info()[0]
print "Old domain is still %s" % vm.info()[0]

$ sudo python test.py 
Starting xenlivecd
Shutting off xenlivecd
Domain state is 0
Refreshed domain state is 5
Old domain is still 0

Reassigning to libvirt but this could be a xen issue.
Comment 2 Cole Robinson 2012-01-29 13:52:53 EST
*** Bug 733433 has been marked as a duplicate of this bug. ***
Comment 3 Cole Robinson 2012-04-10 15:14:45 EDT
Possible patch upstream:

Comment 4 Cole Robinson 2012-06-07 15:40:14 EDT
*** Bug 746503 has been marked as a duplicate of this bug. ***
Comment 5 Fedora Update System 2012-06-24 19:54:46 EDT
libvirt- has been submitted as an update for Fedora 16.
Comment 6 Fedora Update System 2012-06-25 20:55:25 EDT
Package libvirt-
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing libvirt-'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
Comment 7 Fedora Update System 2012-07-05 19:44:32 EDT
libvirt- has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.

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