diff --git a/include/qapi/error.h b/include/qapi/error.h index 0576659603aa3be4a2a0e199c23aec45685e7f3d..7e532d00e9c8e092f9a01aa098f27a225dce856d 100644 --- a/include/qapi/error.h +++ b/include/qapi/error.h @@ -170,6 +170,9 @@ void error_setg_internal(Error **errp, * Just like error_setg(), with @os_error info added to the message. * If @os_error is non-zero, ": " + strerror(os_error) is appended to * the human-readable error message. + * + * The value of errno (which usually can get clobbered by almost any + * function call) will be preserved. */ #define error_setg_errno(errp, os_error, fmt, ...) \ error_setg_errno_internal((errp), __FILE__, __LINE__, __func__, \ diff --git a/monitor.c b/monitor.c index 0841d436b0c22a8443650858100b2e54811497d4..90c5bafcc35ceba0434516e41ead45d277d4ffef 100644 --- a/monitor.c +++ b/monitor.c @@ -3973,6 +3973,8 @@ void error_vprintf_unless_qmp(const char *fmt, va_list ap) { if (cur_mon && !monitor_cur_is_qmp()) { monitor_vprintf(cur_mon, fmt, ap); + } else if (!cur_mon) { + vfprintf(stderr, fmt, ap); } }