mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-11 03:24:58 -06:00
log: Fix qemu_set_dfilter_ranges() error reporting
g_error() is not an acceptable way to report errors to the user: $ qemu-system-x86_64 -dfilter 1000+0 ** (process:17187): ERROR **: Failed to parse range in: 1000+0 Trace/breakpoint trap (core dumped) g_assert() isn't, either: $ qemu-system-x86_64 -dfilter 1000x+64 ** ERROR:/work/armbru/qemu/util/log.c:180:qemu_set_dfilter_ranges: assertion failed: (e == range_op) Aborted (core dumped) Convert qemu_set_dfilter_ranges() to Error. Rework its deeply nested control flow. Touch up the error messages. Call it with &error_fatal. This also permits testing without a subprocess, so do that. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1466011636-6112-3-git-send-email-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
2ec62faea2
commit
bd6fee9f12
4 changed files with 77 additions and 93 deletions
|
@ -107,7 +107,7 @@ extern const QEMULogItem qemu_log_items[];
|
|||
void qemu_set_log(int log_flags);
|
||||
void qemu_log_needs_buffers(void);
|
||||
void qemu_set_log_filename(const char *filename);
|
||||
void qemu_set_dfilter_ranges(const char *ranges);
|
||||
void qemu_set_dfilter_ranges(const char *ranges, Error **errp);
|
||||
bool qemu_log_in_addr_range(uint64_t addr);
|
||||
int qemu_str_to_log_mask(const char *str);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue