[libvirt] virsh list shows first domain twice

Eric Blake eblake at redhat.com
Mon Aug 12 14:21:57 UTC 2013


On 08/12/2013 03:11 AM, Stefan Scheglmann wrote:
> Hi,
> 
> do not know since when but i recently realized that the 'virsh list' command shows me the first dom (the one with id 1) twice in the output List, e.g.
> 
> virsh # list
>  Id Name                 Status
> ----------------------------------
>   1 essir                laufend
>   1 essir                laufend

> Not a serious issue but i encounter it on several hypervisors. All hypervisors running  3.2.0-40-generic with libvirt version 0.9.8. 

There is a known race in the design of the API used in older libvirt.
Anything older than 0.9.13 lacks the virConnectListAllDomains, so virsh
has to fall back to calling virConnectListDomains and
virConnectListDefinedDomains and piece the two lists together, plus lots
of calls to virDomainLookupBy* to learn what state each domain is in.
With the older style, the list can change contents in between the two
list-collection calls, and domains can change state between when the
list was collected and when virsh does the lookup to learn the state.
The race-free version of virConnectListAllDomains was added precisely to
avoid these sorts of races.  As such, the only thing I can suggest is to
upgrade to a newer version of libvirt.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130812/9cd750e0/attachment-0001.sig>


More information about the libvir-list mailing list