aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/tmem_xen.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-06-10 22:39:52 +0100
committerKeir Fraser <keir.fraser@citrix.com>2010-06-10 22:39:52 +0100
commit425bbceb733bfae83b6e4055b8db2ebcc497fb16 (patch)
tree47e71ec517cfbdd8b83f39ee312fc11b864e7de2 /xen/common/tmem_xen.c
parentc9b5c0a4b070dbe8e43d4b37309cde052a6e249a (diff)
downloadxen-425bbceb733bfae83b6e4055b8db2ebcc497fb16.tar.gz
xen-425bbceb733bfae83b6e4055b8db2ebcc497fb16.tar.bz2
xen-425bbceb733bfae83b6e4055b8db2ebcc497fb16.zip
tmem: Fix domain lifecycle synchronisation.
Obtaining a domain reference count is neither necessary nor sufficient. Instead we simply check whether a domain is already dying when it first becomes a client of tmem. If it is not then we will correctly clean up later via tmem_destroy() called from domain_kill(). Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Diffstat (limited to 'xen/common/tmem_xen.c')
-rw-r--r--xen/common/tmem_xen.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xen/common/tmem_xen.c b/xen/common/tmem_xen.c
index d10f49306d..41c37bc57f 100644
--- a/xen/common/tmem_xen.c
+++ b/xen/common/tmem_xen.c
@@ -339,10 +339,10 @@ EXPORT tmh_client_t *tmh_client_init(cli_id_t cli_id)
EXPORT void tmh_client_destroy(tmh_client_t *tmh)
{
+ ASSERT(tmh->domain->is_dying);
#ifndef __i386__
xmem_pool_destroy(tmh->persistent_pool);
#endif
- put_domain(tmh->domain);
tmh->domain = NULL;
}