]> xenbits.xensource.com Git - libvirt.git/commit
virsh: Don't fetch status for all domains in cmdList
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 20 Jan 2016 14:44:45 +0000 (15:44 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 21 Jan 2016 07:13:34 +0000 (08:13 +0100)
commit3bd2ee5d55f6f8324f984c0cfbc532ae3406c757
tree1709faed3743e09d9ec9e05a450e4f00c44bcf31
parenta6cfd22eba5f204deaf0fde3bd3ca96474d77c55
virsh: Don't fetch status for all domains in cmdList

We are getting the list of domains and after that we iterate over
the list and try to get status for each domain hoping it will
skip over domains that disappeared meanwhile. However, this
solution to race is bogus - domain may disappear right after we
have checked its state and before we exec another API over it
(e.g. virDomainHasManagedSaveImage()). Also, when printing just
names or uuids (list --name / --uuid) we issue APIs to obtain the
values, however these require no RPC call as all requested info
is in virDomain object that client already has.
Therefore move the status obtaining only to the place that really
needs it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
tools/virsh-domain-monitor.c