From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:46146) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qbd6o-0004xH-Ed for qemu-devel@nongnu.org; Tue, 28 Jun 2011 14:34:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qbd6m-0003qN-M7 for qemu-devel@nongnu.org; Tue, 28 Jun 2011 14:34:01 -0400 Received: from mail-fx0-f47.google.com ([209.85.161.47]:50491) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qbd6m-0003q2-5o for qemu-devel@nongnu.org; Tue, 28 Jun 2011 14:34:00 -0400 Received: by fxg11 with SMTP id 11so535182fxg.34 for ; Tue, 28 Jun 2011 11:33:58 -0700 (PDT) Date: Tue, 28 Jun 2011 20:33:54 +0200 From: "Edgar E. Iglesias" Message-ID: <20110628183354.GA30019@laped.lan> References: <4DEDE627.1070907@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH] Command line support for altering the log file location List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Matthew Fernandez Cc: Kevin Wolf , Blue Swirl , Anthony Liguori , qemu-devel@nongnu.org On Wed, Jun 08, 2011 at 12:32:40PM +1000, Matthew Fernandez wrote: > Add command line support for logging to a location other than /tmp/qemu.log. > > With logging enabled (command line option -d), the log is written to > the hard-coded path /tmp/qemu.log. This patch adds support for writing > the log to a different location by passing the -D option. > > Signed-off-by: Matthew Fernandez Hi, This patch broke -d for all *-user targets AFAICT. r is passed to cpu_str_to_log_mask(r) instead of log_mask. Cheers > } else if (!strcmp(r, "d")) { > - int mask; > - const CPULogItem *item; > - > - if (optind >= argc) > + if (optind >= argc) { > break; > - > - r = argv[optind++]; > - mask = cpu_str_to_log_mask(r); > - if (!mask) { > - printf("Log items (comma separated):\n"); > - for(item = cpu_log_items; item->mask != 0; item++) { > - printf("%-10s %s\n", item->name, item->help); > - } > - exit(1); > } > - cpu_set_log(mask); > + log_mask = argv[optind++]; > + } else if (!strcmp(r, "D")) { > + if (optind >= argc) { > + break; > + } > + log_file = argv[optind++]; > } else if (!strcmp(r, "E")) { > r = argv[optind++]; > if (envlist_setenv(envlist, r) != 0) > @@ -867,6 +860,23 @@ int main(int argc, char **argv) > usage(); > filename = argv[optind]; > > + /* init debug */ > + cpu_set_log_filename(log_file); > + if (log_mask) { > + int mask; > + const CPULogItem *item; > + > + mask = cpu_str_to_log_mask(r);