diff --git a/nyx/debug.h b/nyx/debug.h index 3827b64a12..d7722a4e2f 100644 --- a/nyx/debug.h +++ b/nyx/debug.h @@ -41,6 +41,14 @@ #define nyx_warn(format, ...) qemu_log(NYX_LOG_PREFIX "Warning: " format, ##__VA_ARGS__) #define nyx_trace(format, ...) nyx_debug("=> %s\n", __func__) +#define nyx_warn_once(format, ...) \ + ({ \ + static bool _printed = false; \ + if (_printed == false){ \ + _printed = true; \ + nyx_warn(format, ##__VA_ARGS__); \ + } \ + }) #ifdef ENABLE_BACKTRACES void qemu_backtrace(void);