qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Christophe LYON <christophe.lyon@st.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] make qemu.log name unique
Date: Tue, 29 Jun 2010 10:46:20 +0200	[thread overview]
Message-ID: <4C29B2DC.2030309@st.com> (raw)

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;

             reply	other threads:[~2010-06-29  8:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-29  8:46 Christophe LYON [this message]
2010-06-29  8:59 ` [Qemu-devel] [PATCH] make qemu.log name unique Kevin Wolf
2010-07-01 11:53   ` Christophe LYON
2010-07-01 13:18     ` Stefan Weil
2010-07-05 15:41       ` Christophe LYON

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C29B2DC.2030309@st.com \
    --to=christophe.lyon@st.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).