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.fernan...@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);

Reply via email to