From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=43592 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OTWSw-0001ne-Jb for qemu-devel@nongnu.org; Tue, 29 Jun 2010 04:46:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OTWSu-00047Y-GH for qemu-devel@nongnu.org; Tue, 29 Jun 2010 04:46:49 -0400 Received: from eu1sys200aog101.obsmtp.com ([207.126.144.111]:42166) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OTWSu-000473-7t for qemu-devel@nongnu.org; Tue, 29 Jun 2010 04:46:48 -0400 Received: from zeta.dmz-us.st.com (zeta.dmz-us.st.com [167.4.80.115]) by beta.dmz-us.st.com (STMicroelectronics) with ESMTP id B9ED170 for ; Tue, 29 Jun 2010 08:43:39 +0000 (GMT) Received: from Webmail-eu.st.com (safex1hubcas3.st.com [10.75.90.18]) by zeta.dmz-us.st.com (STMicroelectronics) with ESMTP id 416AA171 for ; Tue, 29 Jun 2010 08:46:42 +0000 (GMT) Message-ID: <4C29B2DC.2030309@st.com> Date: Tue, 29 Jun 2010 10:46:20 +0200 From: Christophe LYON MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] make qemu.log name unique List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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;