libxl: events: Assert that libxl_ctx_free is not called from a hook
authorIan Jackson <ian.jackson@eu.citrix.com>
Wed, 26 Nov 2014 16:17:49 +0000 (16:17 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Wed, 10 Dec 2014 13:48:30 +0000 (13:48 +0000)
No-one in their right mind would do this, and if they did everything
would definitely collapse.  Arrange that if this happens, we crash
ASAP.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Tested-by: Ian Campbell <ian.campbell@citrix.com>
Release-Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
tools/libxl/libxl.c

index 74c00dc4148d2f67e2afe94c17eefd3abf69f766..55ef5357b0802024746075c53433a32c18b86d3d 100644 (file)
@@ -148,6 +148,8 @@ int libxl_ctx_free(libxl_ctx *ctx)
 {
     if (!ctx) return 0;
 
+    assert(!ctx->osevent_in_hook);
+
     int i;
     GC_INIT(ctx);