Rather than using virDomainObjListFindByUUID, use the ref counting API in order to use virDomainObjEndAPI instead of virObjectUnlock (for common look and feel). Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx> --- src/test/test_driver.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 043caa976..ce8c1001d 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -1725,7 +1725,7 @@ static virDomainPtr testDomainLookupByUUID(virConnectPtr conn, virDomainPtr ret = NULL; virDomainObjPtr dom; - if (!(dom = virDomainObjListFindByUUID(privconn->domains, uuid))) { + if (!(dom = virDomainObjListFindByUUIDRef(privconn->domains, uuid))) { virReportError(VIR_ERR_NO_DOMAIN, NULL); goto cleanup; } @@ -1733,8 +1733,7 @@ static virDomainPtr testDomainLookupByUUID(virConnectPtr conn, ret = virGetDomain(conn, dom->def->name, dom->def->uuid, dom->def->id); cleanup: - if (dom) - virObjectUnlock(dom); + virDomainObjEndAPI(&dom); return ret; } -- 2.13.6 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list