qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] make qemu.log name unique
@ 2010-06-29  8:46 Christophe LYON
  2010-06-29  8:59 ` Kevin Wolf
  0 siblings, 1 reply; 5+ messages in thread
From: Christophe LYON @ 2010-06-29  8:46 UTC (permalink / raw)
  To: qemu-devel

Hello,

I propose this small patch so that the qemu log file has a unique name, 
to help running several QEmu processes at once (or with different users).

Is it OK?

Thanks

Christophe.

diff --git a/exec.c b/exec.c
index 5969eb2..5ba8d7e 100644
--- a/exec.c
+++ b/exec.c
@@ -1516,7 +1516,10 @@ void cpu_set_log(int log_flags)

  void cpu_set_log_filename(const char *filename)
  {
-    logfilename = strdup(filename);
+    /* Assume 10 chars is enough to hold pid */
+    int len = strlen(filename) + 10 + 1;
+    logfilename = malloc(len);
+    sprintf((char*)logfilename, "%s.%d", filename, getpid());
      if (logfile) {
          fclose(logfile);
          logfile = NULL;

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-07-05 15:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-29  8:46 [Qemu-devel] [PATCH] make qemu.log name unique Christophe LYON
2010-06-29  8:59 ` Kevin Wolf
2010-07-01 11:53   ` Christophe LYON
2010-07-01 13:18     ` Stefan Weil
2010-07-05 15:41       ` Christophe LYON

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).