From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:58051) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOVNm-0004Kt-5y for qemu-devel@nongnu.org; Wed, 17 Oct 2012 11:18:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TOVNa-0006cx-GJ for qemu-devel@nongnu.org; Wed, 17 Oct 2012 11:18:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57970) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOVNa-0006aV-8P for qemu-devel@nongnu.org; Wed, 17 Oct 2012 11:17:54 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q9HFHq3Z012539 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 17 Oct 2012 11:17:52 -0400 From: Avi Kivity Date: Wed, 17 Oct 2012 17:17:45 +0200 Message-Id: <1350487065-32022-3-git-send-email-avi@redhat.com> In-Reply-To: <1350487065-32022-1-git-send-email-avi@redhat.com> References: <1350487065-32022-1-git-send-email-avi@redhat.com> Subject: [Qemu-devel] [PATCH 2/2] memory: abort if a memory region is destroyed during a transaction List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Destroying a memory region is illegal within a transaction, as until the transaction is committed, the memory core may hold references to the region. Add an assert to check for violations of this rule. Signed-off-by: Avi Kivity --- memory.c | 1 + 1 file changed, 1 insertion(+) diff --git a/memory.c b/memory.c index d2f2fd6..94049a7 100644 --- a/memory.c +++ b/memory.c @@ -1022,6 +1022,7 @@ void memory_region_init_reservation(MemoryRegion *mr, void memory_region_destroy(MemoryRegion *mr) { assert(QTAILQ_EMPTY(&mr->subregions)); + assert(memory_region_transaction_depth == 0); mr->destructor(mr); memory_region_clear_coalescing(mr); g_free((char *)mr->name); -- 1.7.12