Bug 813226 - get_state() does not work correctly when domain is shutdown
Summary: get_state() does not work correctly when domain is shutdown
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: perl-Sys-Virt
Version: 6.3
Hardware: x86_64
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Daniel Berrangé
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-04-17 09:26 UTC by weizhang
Modified: 2012-07-27 09:17 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-07-27 09:17:33 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description weizhang 2012-04-17 09:26:36 UTC
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 Berrangé 2012-04-17 09:34:47 UTC
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 09:45:24 UTC
(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 Program Management 2012-05-03 05:11:01 UTC
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.