[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 01/15] qemu-log: Open file for logging when specified
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 01/15] qemu-log: Open file for logging when specified |
Date: |
Fri, 19 Jun 2015 09:45:22 +0200 |
From: Pranith Kumar <address@hidden>
qemu-log defaults to stderr when there is no '-D' option mentioned on command
line. When '-D' option is specified, we also need to specify '-d' option for it
to use the specified logfile. When using monitor to enable logging this is
troublesome since there will be no '-d' option because of which monitor dumps
the logs to stderr.
Fix this by opening the log file when '-D' is specified on the command line.
Also fix an ancient comment which does not hold true since changing location and
log level has now been streamlined.
Signed-off-by: Pranith Kumar <address@hidden>
CC: Paolo Bonzini <address@hidden>
CC: Luiz Capitulino <address@hidden>
CC: Markus Armbruster <address@hidden>
CC: Peter Maydell <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
vl.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/vl.c b/vl.c
index 2201e27..63ce07f 100644
--- a/vl.c
+++ b/vl.c
@@ -3916,17 +3916,14 @@ int main(int argc, char **argv, char **envp)
exit(0);
}
- /* Open the logfile at this point, if necessary. We can't open the logfile
- * when encountering either of the logging options (-d or -D) because the
- * other one may be encountered later on the command line, changing the
- * location or level of logging.
+ /* Open the logfile at this point and set the log mask if necessary.
*/
+ if (log_file) {
+ qemu_set_log_filename(log_file);
+ }
+
if (log_mask) {
int mask;
- if (log_file) {
- qemu_set_log_filename(log_file);
- }
-
mask = qemu_str_to_log_mask(log_mask);
if (!mask) {
qemu_print_log_usage(stdout);
--
2.4.3
- [Qemu-devel] [PULL 00/15] Timer, virtio-scsi-test, build, memory changes for 2015-06-19, Paolo Bonzini, 2015/06/19
- [Qemu-devel] [PULL 01/15] qemu-log: Open file for logging when specified,
Paolo Bonzini <=
- [Qemu-devel] [PULL 03/15] qemu-ga: debug printouts to help troubleshoot installation, Paolo Bonzini, 2015/06/19
- [Qemu-devel] [PULL 04/15] qemu-ga: Introduce Windows MSI script, Paolo Bonzini, 2015/06/19
- [Qemu-devel] [PULL 02/15] qemu-ga: adding vss-[un]install options, Paolo Bonzini, 2015/06/19
- [Qemu-devel] [PULL 06/15] i8254: fix out-of-bounds memory access in pit_ioport_read(), Paolo Bonzini, 2015/06/19
- [Qemu-devel] [PULL 05/15] qemu-ga: Building Windows MSI installation with configure/Makefile, Paolo Bonzini, 2015/06/19
- [Qemu-devel] [PULL 07/15] tests: Link libqos virtio object to virtio-scsi-test, Paolo Bonzini, 2015/06/19
- [Qemu-devel] [PULL 08/15] libqos: Allow calling guest_free on NULL pointer, Paolo Bonzini, 2015/06/19
- [Qemu-devel] [PULL 09/15] libqos: Complete virtio device ID definition list, Paolo Bonzini, 2015/06/19
- [Qemu-devel] [PULL 10/15] tests: virtio-scsi: Move start/stop to individual test functions, Paolo Bonzini, 2015/06/19
- [Qemu-devel] [PULL 11/15] tests: virtio-scsi: Add test for unaligned WRITE SAME, Paolo Bonzini, 2015/06/19