qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: Matthew Fernandez <matthew.fernandez@gmail.com>
Cc: Kevin Wolf <kwolf@redhat.com>, Blue Swirl <blauwirbel@gmail.com>,
	Anthony Liguori <aliguori@us.ibm.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Command line support for altering the log file location
Date: Tue, 28 Jun 2011 20:33:54 +0200	[thread overview]
Message-ID: <20110628183354.GA30019@laped.lan> (raw)
In-Reply-To: <BANLkTimkBR7ZNOGaUO1gDmq2haBO41ciZ0F+5tdXoSdUgTxB=g@mail.gmail.com>

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 <matthew.fernandez@gmail.com>


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);

  parent reply	other threads:[~2011-06-28 18:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-31  6:20 [Qemu-devel] [PATCH] Command line support for altering the log file location Matthew Fernandez
2011-06-04 10:18 ` Blue Swirl
2011-06-05  0:46   ` Matthew Fernandez
2011-06-07  8:49     ` Kevin Wolf
2011-06-08  2:32       ` Matthew Fernandez
2011-06-15 16:54         ` Blue Swirl
2011-06-28 18:33         ` Edgar E. Iglesias [this message]
2011-06-28 19:02         ` Edgar E. Iglesias
2011-06-29 12:48           ` Matthew Fernandez

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=20110628183354.GA30019@laped.lan \
    --to=edgar.iglesias@gmail.com \
    --cc=aliguori@us.ibm.com \
    --cc=blauwirbel@gmail.com \
    --cc=kwolf@redhat.com \
    --cc=matthew.fernandez@gmail.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).