On Tue, Aug 16, 2016 at 08:17:08PM +0800, Peter Xu wrote: > > > > > > Also, please make it a function, not a macro: > > > > > > void error_report_fatal(const char *fmt, ...) > > > { > > > va_list ap; > > > > > > va_start(ap, fmt); > > > error_vreport(fmt, ap); > > > va_end(ap); > > > exit(1); > > > }
Marcel (and reviewers), Now if we are having both error_report_fatal() and error_report_abort(), we'll write error_report() three times if we all take them as functions. How about we still use macro this time but leverage error_setg() macro as mentioned by Fam, like: +#define error_report_fatal(...) error_setg(&error_fatal, __VA_ARGS__) +#define error_report_abort(...) error_setg(&error_abort, __VA_ARGS__) In this case, we avoided calling exit() directly in the macro, and is much cleaner than writting error_report() content for three times. -- peterx