From 1980f9d9a9e42154382f1b8970f28ca9e2c71edb Mon Sep 17 00:00:00 2001 From: Thanos Makatos Date: Wed, 5 Oct 2022 15:34:28 +0100 Subject: only call debug_region_access if in debug mode (#716) Signed-off-by: Thanos Makatos Reviewed-by: John Levon --- lib/libvfio-user.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/libvfio-user.c b/lib/libvfio-user.c index 6359d5d..97ed4e7 100644 --- a/lib/libvfio-user.c +++ b/lib/libvfio-user.c @@ -164,6 +164,7 @@ dev_get_caps(vfu_ctx_t *vfu_ctx, vfu_reg_info_t *vfu_reg, bool is_migr_reg, return 0; } +#ifdef DEBUG static void debug_region_access(vfu_ctx_t *vfu_ctx, size_t region, char *buf, size_t count, uint64_t offset, bool is_write) @@ -192,6 +193,14 @@ debug_region_access(vfu_ctx_t *vfu_ctx, size_t region, char *buf, count); } } +#else +static void +debug_region_access(vfu_ctx_t *vfu_ctx UNUSED, size_t region UNUSED, + char *buf UNUSED, size_t count UNUSED, + uint64_t offset UNUSED, bool is_write UNUSED) +{ +} +#endif static ssize_t region_access(vfu_ctx_t *vfu_ctx, size_t region, char *buf, @@ -236,7 +245,6 @@ out: } else { debug_region_access(vfu_ctx, region, buf, count, offset, is_write); } - return ret; } -- cgit v1.1