]> git.ipfire.org Git - thirdparty/libvirt.git/commit
xend_internal: Use domain/status for shutdown check
authorStefan Bader <stefan.bader@canonical.com>
Thu, 12 Apr 2012 13:42:37 +0000 (15:42 +0200)
committerDaniel P. Berrange <berrange@redhat.com>
Mon, 16 Apr 2012 11:43:25 +0000 (12:43 +0100)
commit413d8670ec502389b0984880acdf1a61e02b205b
treecde0a41bed4a41bfd37d29fff5b5db40a991fd0d
parent965e7f1452752bf92cc6160b1c2fc588d6b50d90
xend_internal: Use domain/status for shutdown check

On newer xend (v3.x and after) there is no state and domid reported
for inactive domains. When initially creating connections this is
handled in various places by assigning domain->id = -1.
But once an instance has been running, the id is set to the current
domain id. And it does not change when the instance is shut down.
So when querying the domain info, the hypervisor driver, which gets
asked first will indicate it cannot find information, then the
xend driver is asked and will set the status to NOSTATE because it
checks for the -1 domain id.
Checking domain/status for 0 seems to be more reliable for that.

One note: I am not sure whether the domain->id also should get set
back to -1 whenever any sub-driver thinks the instance is no longer
running.

BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=746007
BugLink: http://bugs.launchpad.net/bugs/929626
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
(cherry picked from commit 26e9ef476239e8cb79f819092c5aac4afdd47d0d)
src/xen/xend_internal.c