[libvirt] PATCH: Change virDomainAssignDef to lookup on UUID

The virDomainAssignDef method currently uses the 'name' field to lookup domains. The UUID is the best internal identifier, so this changes over to use that instead. Daniel diff -r 4b9560b57861 src/domain_conf.c --- a/src/domain_conf.c Fri Apr 17 11:50:54 2009 +0100 +++ b/src/domain_conf.c Fri Apr 17 12:05:11 2009 +0100 @@ -498,7 +498,7 @@ virDomainObjPtr virDomainAssignDef(virCo { virDomainObjPtr domain; - if ((domain = virDomainFindByName(doms, def->name))) { + if ((domain = virDomainFindByUUID(doms, def->uuid))) { if (!virDomainIsActive(domain)) { virDomainDefFree(domain->def); domain->def = def; -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Fri, Apr 17, 2009 at 12:07:49PM +0100, Daniel P. Berrange wrote:
The virDomainAssignDef method currently uses the 'name' field to lookup domains. The UUID is the best internal identifier, so this changes over to use that instead.
ACK, Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

On Fri, Apr 17, 2009 at 01:20:29PM +0200, Daniel Veillard wrote:
On Fri, Apr 17, 2009 at 12:07:49PM +0100, Daniel P. Berrange wrote:
The virDomainAssignDef method currently uses the 'name' field to lookup domains. The UUID is the best internal identifier, so this changes over to use that instead.
ACK,
Comitted. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
participants (2)
-
Daniel P. Berrange
-
Daniel Veillard