ia64/xen-unstable

changeset 8320:bdcb115c667a

Rename QEMU device model log file from /tmp/qemu.log to
/var/log/qemu-dm.<pid>.log.
Also redirect stderr to this log file.

Signed-off-by: Xin Li <xin.b.li@intel.com>
author kaf24@firebug.cl.cam.ac.uk
date Sun Dec 11 00:20:08 2005 +0100 (2005-12-11)
parents 5f94478ca9b5
children 7ad6cf4260eb b4dfb49332d2
files tools/ioemu/exec.c tools/ioemu/vl.c
line diff
     1.1 --- a/tools/ioemu/exec.c	Sun Dec 11 00:17:11 2005 +0100
     1.2 +++ b/tools/ioemu/exec.c	Sun Dec 11 00:20:08 2005 +0100
     1.3 @@ -142,10 +142,9 @@ void cpu_set_log(int log_flags)
     1.4  #else
     1.5          setvbuf(logfile, NULL, _IOLBF, 0);
     1.6  #endif
     1.7 -/*
     1.8 -    	stdout = logfile;
     1.9 -    	stderr = logfile;
    1.10 -*/
    1.11 +
    1.12 +        stdout = logfile;
    1.13 +        stderr = logfile;
    1.14      }
    1.15  }
    1.16  
     2.1 --- a/tools/ioemu/vl.c	Sun Dec 11 00:17:11 2005 +0100
     2.2 +++ b/tools/ioemu/vl.c	Sun Dec 11 00:20:08 2005 +0100
     2.3 @@ -428,9 +428,9 @@ void hw_error(const char *fmt, ...)
     2.4      vfprintf(stderr, fmt, ap);
     2.5      fprintf(stderr, "\n");
     2.6      if (logfile) {
     2.7 -	fprintf(logfile, "qemu: hardware error: ");
     2.8 -	vfprintf(logfile, fmt, ap);
     2.9 -	fprintf(logfile, "\n");
    2.10 +        fprintf(logfile, "qemu: hardware error: ");
    2.11 +        vfprintf(logfile, fmt, ap);
    2.12 +        fprintf(logfile, "\n");
    2.13      }
    2.14      va_end(ap);
    2.15      abort();
    2.16 @@ -526,8 +526,8 @@ int64_t cpu_get_real_ticks(void)
    2.17  
    2.18  #elif defined(__ia64__)
    2.19  #include "ia64_intrinsic.h"
    2.20 -#define cpu_get_real_ticks()	\
    2.21 -	__ia64_getreg(_IA64_REG_AR_ITC)
    2.22 +#define cpu_get_real_ticks()    \
    2.23 +    __ia64_getreg(_IA64_REG_AR_ITC)
    2.24  
    2.25  #else
    2.26  #error unsupported CPU
    2.27 @@ -2645,6 +2645,7 @@ int main(int argc, char **argv)
    2.28      char monitor_device[128];
    2.29      char serial_devices[MAX_SERIAL_PORTS][128];
    2.30      int serial_device_index;
    2.31 +    char qemu_dm_logfilename[64];
    2.32      const char *loadvm = NULL;
    2.33      unsigned long nr_pages, extra_pages, ram_pages, *page_array;
    2.34      extern void *shared_page;
    2.35 @@ -2695,6 +2696,8 @@ int main(int argc, char **argv)
    2.36      macaddr[5] = 0x56;
    2.37  
    2.38      /* init debug */
    2.39 +    sprintf(qemu_dm_logfilename, "/var/log/qemu-dm.%d.log", getpid());
    2.40 +    cpu_set_log_filename(qemu_dm_logfilename);
    2.41      cpu_set_log(0);
    2.42  
    2.43      optind = 1;