xend_internal: Use domain/status for shutdown check
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 <00beb3b1b08625be3b68f3989c75be8de7f2fd89@canonical.com>

zippy2/libvirt,rlaager/libvirt,rmarwaha/libvirt,shugaoye/libvirt,nertpinx/libvirt,jeckersb/libvirt,datto/libvirt,rmarwaha/libvirt1,elmarco/libvirt,emaste/libvirt,fabianfreyer/libvirt,novel/fbsd-libvirt,emaste/libvirt,cbosdo/libvirt,jardasgit/libvirt,agx/libvirt,siboulet/libvirt-openvz,agx/libvirt,jardasgit/libvirt,iam-TJ/libvirt,cbosdo/libvirt,trainstack/libvirt,dumbbell/libvirt,siboulet/libvirt-openvz,trainstack/libvirt,libvirt/libvirt,eskultety/libvirt,jfehlig/libvirt,novel/fbsd-libvirt,datto/libvirt,novel/fbsd-libvirt,libvirt/libvirt,warewolf/libvirt,jeckersb/libvirt,cbosdo/libvirt,trainstack/libvirt,emaste/libvirt,datto/libvirt,warewolf/libvirt,eskultety/libvirt,libvirt/libvirt,bjzhang/libvirt,elmarco/libvirt,zhlcindy/libvirt-1.1.4-maintain,bjzhang/libvirt,taget/libvirt,jfehlig/libvirt,rmarwaha/libvirt1,iam-TJ/libvirt,dumbbell/libvirt,bjzhang/libvirt,crobinso/libvirt,zhlcindy/libvirt-1.1.4-maintain,jeckersb/libvirt,andreabolognani/libvirt,olafhering/libvirt,shugaoye/libvirt,jfehlig/libvirt,warewolf/libvirt,trainstack/libvirt,olafhering/libvirt,shugaoye/libvirt,warewolf/libvirt,jeckersb/libvirt,novel/fbsd-libvirt,wiedi/libvirt,foomango/libvirt,foomango/libvirt,shugaoye/libvirt,foomango/libvirt,VenkatDatta/libvirt,andreabolognani/libvirt,bjzhang/libvirt,novel/fbsd-libvirt,dumbbell/libvirt,elmarco/libvirt,jardasgit/libvirt,iam-TJ/libvirt,wiedi/libvirt,trainstack/libvirt,siboulet/libvirt-openvz,nertpinx/libvirt,fabianfreyer/libvirt,nertpinx/libvirt,iam-TJ/libvirt,dumbbell/libvirt,novel/fbsd-libvirt,VenkatDatta/libvirt,rmarwaha/libvirt1,rmarwaha/libvirt,emaste/libvirt,rmarwaha/libvirt1,wiedi/libvirt,agx/libvirt,iam-TJ/libvirt,shugaoye/libvirt,cbosdo/libvirt,rmarwaha/libvirt1,datto/libvirt,zippy2/libvirt,jfehlig/libvirt,nertpinx/libvirt,rlaager/libvirt,taget/libvirt,rmarwaha/libvirt,rlaager/libvirt,zhlcindy/libvirt-1.1.4-maintain,zhlcindy/libvirt-1.1.4-maintain,rmarwaha/libvirt,emaste/libvirt,taget/libvirt,emaste/libvirt,wiedi/libvirt,andreabolognani/libvirt,zhlcindy/libvirt-1.1.4-maintain,VenkatDatta/libvirt,libvirt/libvirt,rlaager/libvirt,elmarco/libvirt,foomango/libvirt,jardasgit/libvirt,wiedi/libvirt,taget/libvirt,VenkatDatta/libvirt,trainstack/libvirt,andreabolognani/libvirt,rmarwaha/libvirt1,cbosdo/libvirt,jardasgit/libvirt,novel/fbsd-libvirt,eskultety/libvirt,andreabolognani/libvirt,foomango/libvirt,eskultety/libvirt,rlaager/libvirt,warewolf/libvirt,trainstack/libvirt,novel/fbsd-libvirt,rmarwaha/libvirt,olafhering/libvirt,VenkatDatta/libvirt,taget/libvirt,jeckersb/libvirt,crobinso/libvirt,siboulet/libvirt-openvz,fabianfreyer/libvirt,fabianfreyer/libvirt,fabianfreyer/libvirt,wiedi/libvirt,siboulet/libvirt-openvz,iam-TJ/libvirt,jeckersb/libvirt,wiedi/libvirt,bjzhang/libvirt,emaste/libvirt,jeckersb/libvirt,datto/libvirt,crobinso/libvirt,dumbbell/libvirt,warewolf/libvirt,elmarco/libvirt,nertpinx/libvirt,crobinso/libvirt,rmarwaha/libvirt,novel/fbsd-libvirt,warewolf/libvirt,zippy2/libvirt,dumbbell/libvirt,iam-TJ/libvirt,agx/libvirt,agx/libvirt,olafhering/libvirt,eskultety/libvirt,zippy2/libvirt