qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Command line support for altering the log file


From: Edgar E. Iglesias
Subject: Re: [Qemu-devel] [PATCH] Command line support for altering the log file location
Date: Tue, 28 Jun 2011 20:33:54 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

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 <address@hidden>


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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]