[libvirt] [PATCH] virsh: Don't fetch status for all domains in cmdList

Ján Tomko jtomko at redhat.com
Thu Jan 21 07:48:26 UTC 2016


On Wed, Jan 20, 2016 at 04:11:26PM +0100, Michal Privoznik wrote:
> 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

There seems to be a similar problem in virshDomainListCollect, but it is
only used with old libvirtd that does not support the atomic listing
API.

> 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 at redhat.com>
> ---
>  tools/virsh-domain-monitor.c | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 

ACK

Jan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20160121/d50fa407/attachment-0001.sig>


More information about the libvir-list mailing list