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 via email to