From a7b39c8bd6cba3fe1c8012987b9e28bdbac7e92d Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Sun, 6 Sep 2015 21:05:39 +0100 Subject: [PATCH] libxc: add assertion to avoid setting same bit more than once Signed-off-by: Wei Liu Reviewed-by: Andrew Cooper --- tools/libxc/xc_sr_restore.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/libxc/xc_sr_restore.c b/tools/libxc/xc_sr_restore.c index 924dd5534d..f48e7fcfe0 100644 --- a/tools/libxc/xc_sr_restore.c +++ b/tools/libxc/xc_sr_restore.c @@ -181,6 +181,7 @@ static int pfn_set_populated(struct xc_sr_context *ctx, xen_pfn_t pfn) ctx->restore.max_populated_pfn = new_max; } + assert(!test_bit(pfn, ctx->restore.populated_pfns)); set_bit(pfn, ctx->restore.populated_pfns); return 0; -- 2.30.2