Bug 813226 - get_state() does not work correctly when domain is shutdown
get_state() does not work correctly when domain is shutdown
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: perl-Sys-Virt (Show other bugs)
6.3
x86_64 Linux
high Severity high
: rc
: ---
Assigned To: Daniel Berrange
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-17 05:26 EDT by weizhang
Modified: 2012-07-27 05:17 EDT (History)
3 users (show)

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


Attachments (Terms of Use)

  None (edit)
Description weizhang 2012-04-17 05:26:36 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):
perl-Sys-Virt-0.9.10-4.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1. run script with perl-sys-virt
2.
3.
  
Actual results:
get_state() return confusing

Expected results:
get_state() can return the real vm state when domain is shutdown

Additional info:
Comment 2 Daniel Berrange 2012-04-17 05:34:47 EDT
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
Comment 3 weizhang 2012-04-17 05:45:24 EDT
(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
Id:             -
Name:           rhel6
UUID:           8f7d7e4c-2c44-49f8-9c59-09b609b00ebd
OS Type:        hvm
State:          shut off
CPU(s):         1
Max memory:     1048576 kB
Used memory:    524288 kB
Persistent:     yes
Autostart:      disable
Managed save:   no
Security model: selinux
Security DOI:   0

At the same time, run dom->get_state() return 0, which means nostate
Comment 4 RHEL Product and Program Management 2012-05-03 01:11:01 EDT
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.

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