mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-11 03:24:58 -06:00
log: Fix qemu_set_log_filename() error handling
When qemu_set_log_filename() detects an invalid file name, it reports an error, closes the log file (if any), and starts logging to stderr (unless daemonized or nothing is being logged). This is wrong. Asking for an invalid log file on the command line should be fatal. Asking for one in the monitor should fail without messing up an existing logfile. Fix by converting qemu_set_log_filename() to Error. Pass it &error_fatal, except for hmp_logfile report errors. This also permits testing without a subprocess, so do that. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1466011636-6112-4-git-send-email-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
bd6fee9f12
commit
daa76aa416
8 changed files with 25 additions and 42 deletions
|
@ -106,7 +106,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_log_filename(const char *filename, Error **errp);
|
||||
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