From: Ian Jackson Date: Wed, 26 Nov 2014 16:17:49 +0000 (+0000) Subject: libxl: events: Assert that libxl_ctx_free is not called from a hook X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~4022 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=f49f9b4114d59a67b53322f3f6148ed0db497dca;p=xen.git libxl: events: Assert that libxl_ctx_free is not called from a hook 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 Acked-by: Ian Campbell Tested-by: Ian Campbell Release-Acked-by: Konrad Rzeszutek Wilk --- diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index 74c00dc414..55ef5357b0 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -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);