]> xenbits.xensource.com Git - libvirt.git/commit
Merge virDomainObjListIsDuplicate into virDomainObjListAdd
authorDaniel P. Berrange <berrange@redhat.com>
Mon, 14 Jan 2013 14:46:58 +0000 (14:46 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 5 Feb 2013 19:22:25 +0000 (19:22 +0000)
commiteea87129f121dcdb2079a9c948c35a08ae4f8d38
tree7976057ceb82ea4f84213fe7869fa568d1ceeca4
parent9fe43021f3dc326a536247cf6b3d8b9dc1958666
Merge virDomainObjListIsDuplicate into virDomainObjListAdd

The duplicate VM checking should be done atomically with
virDomainObjListAdd, so shoud not be a separate function.
Instead just use flags to indicate what kind of checks are
required.

This pair, used in virDomainCreateXML:

   if (virDomainObjListIsDuplicate(privconn->domains, def, 1) < 0)
     goto cleanup;
   if (!(dom = virDomainObjListAdd(privconn->domains,
                                   privconn->caps,
                                   def, false)))
     goto cleanup;

Changes to

   if (!(dom = virDomainObjListAdd(privconn->domains,
                                   privconn->caps,
                                   def,
                                   VIR_DOMAIN_OBJ_LIST_ADD_CHECK_LIVE,
                                   NULL)))
     goto cleanup;

This pair, used in virDomainRestoreFlags:

   if (virDomainObjListIsDuplicate(privconn->domains, def, 1) < 0)
     goto cleanup;
   if (!(dom = virDomainObjListAdd(privconn->domains,
                                   privconn->caps,
                                   def, true)))
     goto cleanup;

Changes to

   if (!(dom = virDomainObjListAdd(privconn->domains,
                                   privconn->caps,
                                   def,
                                   VIR_DOMAIN_OBJ_LIST_ADD_LIVE |
                                   VIR_DOMAIN_OBJ_LIST_ADD_CHECK_LIVE,
                                   NULL)))
     goto cleanup;

This pair, used in virDomainDefineXML:

   if (virDomainObjListIsDuplicate(privconn->domains, def, 0) < 0)
     goto cleanup;
   if (!(dom = virDomainObjListAdd(privconn->domains,
                                   privconn->caps,
                                   def, false)))
     goto cleanup;

Changes to

   if (!(dom = virDomainObjListAdd(privconn->domains,
                                   privconn->caps,
                                   def,
                                   0, NULL)))
     goto cleanup;
14 files changed:
src/conf/domain_conf.c
src/conf/domain_conf.h
src/libvirt_private.syms
src/libxl/libxl_driver.c
src/lxc/lxc_driver.c
src/openvz/openvz_conf.c
src/openvz/openvz_driver.c
src/parallels/parallels_driver.c
src/qemu/qemu_driver.c
src/qemu/qemu_migration.c
src/test/test_driver.c
src/uml/uml_driver.c
src/vmware/vmware_conf.c
src/vmware/vmware_driver.c