]> git.ipfire.org Git - thirdparty/libvirt.git/commit
libxl: MigratePrepare: use standard begin and end API pattern
authorJim Fehlig <jfehlig@suse.com>
Tue, 13 Mar 2018 16:48:28 +0000 (10:48 -0600)
committerJim Fehlig <jfehlig@suse.com>
Fri, 16 Mar 2018 20:37:01 +0000 (14:37 -0600)
commit60b3fcd90cbd83e5721484d72414dfee1706dab8
treea8c93e32cec6bd823bdf5b6ef5a0821cbeeb16ed
parentfe51dbda56b5e51e17b238210a19e3c9887a3f15
libxl: MigratePrepare: use standard begin and end API pattern

libxlDomainMigrationPrepare adds the incoming domain def to the list
of domains via virDomainObjListAdd, but never adds its own ref to the
returned virDomainObj as other callers of virDomainObjListAdd do.
libxlDomainMigrationPrepareTunnel3 suffers the same discrepancy.

Change both to add a ref to the virDomainObj after a successful
virDomainObjListAdd, similar to other callers. This ensures a consistent
pattern throughout the drivers and allows using the virDomainObjEndAPI
function for cleanup.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
src/libxl/libxl_migration.c