Red Hat Bugzilla – Bug 813226
get_state() does not work correctly when domain is shutdown
Last modified: 2012-07-27 05:17:33 EDT
Description of problem:
I find it when I test vm installation with perl-sys-virt, after vm finishing installing and shutdown, the perl function get_state() still show that the vm state is running; If I destroy the vm during installation, then get_state() show the vm state is blocked; If I then restart libvirtd, then get_state() will show that vm state is nostate
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. run script with perl-sys-virt
get_state() return confusing
get_state() can return the real vm state when domain is shutdown
The 'get_state' function doesn't do anything special - it just calls into the virDomainGetState() C API. So if there is a flaw here, it is probably in the libvirt layer.
Can you try creating a simple demo in C that reproduces the problem, or see if 'virsh dominfo' shows the same behaviour
(In reply to comment #2)
> The 'get_state' function doesn't do anything special - it just calls into the
> virDomainGetState() C API. So if there is a flaw here, it is probably in the
> libvirt layer.
> Can you try creating a simple demo in C that reproduces the problem, or see if
> 'virsh dominfo' shows the same behaviour
# virsh dominfo rhel6
OS Type: hvm
State: shut off
Max memory: 1048576 kB
Used memory: 524288 kB
Managed save: no
Security model: selinux
Security DOI: 0
At the same time, run dom->get_state() return 0, which means nostate
Since RHEL 6.3 External Beta has begun, and this bug remains
unresolved, it has been rejected as it is not proposed as
exception or blocker.
Red Hat invites you to ask your support representative to
propose this request, if appropriate and relevant, in the
next release of Red Hat Enterprise Linux.