Re: [libvirt] [PATCH] domain_conf: fix crash in virDomainObjListFindByUUIDInternal

2015-03-11 Thread Peter Krempa
On Wed, Mar 11, 2015 at 13:19:54 +1100, Michael Chapman wrote:
> If a domain object is being removed and looked up concurrently we must
> ensure we unlock the object before unreferencing it, since the latter
> might free the object.

It should be noted that the flaw was introduced in commit
feb1a4d792e1c35b1009e69c00bf351b39fe666b.

I'll ammend the commit message.

> 
> Signed-off-by: Michael Chapman 
> ---
>  src/conf/domain_conf.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

ACK, I'll push this patch shortly.

Peter


signature.asc
Description: Digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH] domain_conf: fix crash in virDomainObjListFindByUUIDInternal

2015-03-10 Thread Michael Chapman
If a domain object is being removed and looked up concurrently we must
ensure we unlock the object before unreferencing it, since the latter
might free the object.

Signed-off-by: Michael Chapman 
---
 src/conf/domain_conf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index cc8616b..ce0e173 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -1068,9 +1068,9 @@ virDomainObjListFindByUUIDInternal(virDomainObjListPtr 
doms,
 if (obj) {
 virObjectLock(obj);
 if (obj->removing) {
+virObjectUnlock(obj);
 if (ref)
 virObjectUnref(obj);
-virObjectUnlock(obj);
 obj = NULL;
 }
 }
-- 
2.1.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list