On Fri, Feb 21, 2020 at 11:49:06AM -0800, ted.h.kim@oracle.com wrote: >Hi Jan, > >Thanks for responding - let me see if I am understanding correctly. > > >I think you are saying on migration the process of determining the CID >assigned is the same as when you start a domain. > > means assignment to the first available value. >It also seems for auto='yes' that any address='' part of the >CID definition is ignored, even as a suggested value. >(I always get CID 3 when starting auto='yes' and no other domains have >started, even if there is an specific address in the definition, e.g. >address='12'.) > >But if auto='no', either the domain gets the address field value or if >the value is already assigned, the domain will fail to start/migrate. > >Is that right? > Yes. > >In cases, where auto='yes', it does not seem that the host/hypervisor >can find out what CID value was assigned to a domain. Even parsing the >XML only reveals that it was auto-assigned and no specific value can >be determined. The value is not recorded in the inactive XML, but after domain startup, the address should be visible in the live XML:
> >Is this correct? > >If this is the case, I would advocate for a specific API which can >lookup the current CID of a domain. This can already be queried from the XML through virDomainGetXMLDesc: $ virsh dumpxml libvirt-fedora-31 | xmllint --xpath 'string(//cid/@address)' - 3 Jano >Otherwise the host/hypervisor cannot tell which  auto='yes' domain is >on the other end of the connected socket, when there is more than one. > > >Thanks. >-ted > >