qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] da0025: vl: Error messages need to go to stde


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] da0025: vl: Error messages need to go to stderr, fix some
Date: Mon, 20 Jun 2016 09:30:06 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: da002526ac30f679b0c797b0d71102dcdf200fe6
      
https://github.com/qemu/qemu/commit/da002526ac30f679b0c797b0d71102dcdf200fe6
  Author: Markus Armbruster <address@hidden>
  Date:   2016-06-20 (Mon, 20 Jun 2016)

  Changed paths:
    M vl.c

  Log Message:
  -----------
  vl: Error messages need to go to stderr, fix some

We print a few fatal error messages to stdout instead of stderr.
Reproducer:

    $ qemu-system-x86_64 -g 1024x768
    Option g not supported for this target
    $ qemu-system-x86_64 -g 1024x768 >/dev/null

Fix by printing them with error_report().  This also improves the messages.
The above one becomes

    qemu-system-x86_64: -g 1024x768: Option not supported for this target

Reported-by: Tobi {github.com/tobimensch}
Signed-off-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Marcel Apfelbaum <address@hidden>


  Commit: 621ff94d5074d88253a5818c6b9c4db718fbfc65
      
https://github.com/qemu/qemu/commit/621ff94d5074d88253a5818c6b9c4db718fbfc65
  Author: Eduardo Habkost <address@hidden>
  Date:   2016-06-20 (Mon, 20 Jun 2016)

  Changed paths:
    M block.c
    M block/qcow2.c
    M block/quorum.c
    M block/raw-posix.c
    M block/raw_bsd.c
    M block/snapshot.c
    M blockdev.c
    M bootdevice.c
    M dump.c
    M hw/ide/qdev.c
    M hw/net/ne2000-isa.c
    M hw/s390x/virtio-ccw.c
    M hw/usb/dev-storage.c
    M qga/commands-win32.c
    M qom/object.c
    A scripts/coccinelle/error_propagate_null.cocci

  Log Message:
  -----------
  error: Remove NULL checks on error_propagate() calls

error_propagate() already ignores local_err==NULL, so there's no
need to check it before calling.

Coccinelle patch used to perform the changes added to
scripts/coccinelle/error_propagate_null.cocci.

Reviewed-by: Eric Blake <address@hidden>
Acked-by: Cornelia Huck <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 6b62d961373e0327f2af8fb77d6d5d6308864180
      
https://github.com/qemu/qemu/commit/6b62d961373e0327f2af8fb77d6d5d6308864180
  Author: Eduardo Habkost <address@hidden>
  Date:   2016-06-20 (Mon, 20 Jun 2016)

  Changed paths:
    M block/raw-posix.c
    M block/raw_bsd.c
    M hw/s390x/s390-virtio-ccw.c
    M hw/s390x/virtio-ccw.c
    A scripts/coccinelle/remove_local_err.cocci
    M target-i386/cpu.c

  Log Message:
  -----------
  error: Remove unnecessary local_err variables

This patch simplifies code that uses a local_err variable just to
immediately use it for an error_propagate() call.

Coccinelle patch used to perform the changes added to
scripts/coccinelle/remove_local_err.cocci.

Reviewed-by: Eric Blake <address@hidden>
Acked-by: Cornelia Huck <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
[Blank line in s390-virtio-ccw.c restored]
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 9be385980d37e8f4fd33f605f5fb1c3d144170a8
      
https://github.com/qemu/qemu/commit/9be385980d37e8f4fd33f605f5fb1c3d144170a8
  Author: Eduardo Habkost <address@hidden>
  Date:   2016-06-20 (Mon, 20 Jun 2016)

  Changed paths:
    M audio/audio.c
    M block/archipelago.c
    M block/qcow2-cluster.c
    M block/qcow2-refcount.c
    M block/raw-posix.c
    M block/raw_bsd.c
    M block/rbd.c
    M block/vmdk.c
    M block/vvfat.c
    M hw/acpi/aml-build.c
    M hw/audio/intel-hda.c
    M hw/display/vga.c
    M hw/intc/s390_flic_kvm.c
    M hw/pci-host/uninorth.c
    M hw/ppc/spapr_vio.c
    M hw/scsi/megasas.c
    M hw/scsi/scsi-generic.c
    M hw/timer/mc146818rtc.c
    M hw/virtio/virtio-pci.c
    M linux-user/signal.c
    M page_cache.c
    M qga/commands-posix.c
    M qga/commands-win32.c
    M qobject/qlist.c
    A scripts/coccinelle/return_directly.cocci
    M target-i386/fpu_helper.c
    M target-i386/kvm.c
    M target-mips/op_helper.c
    M target-s390x/helper.c
    M target-sparc/cc_helper.c
    M target-tricore/op_helper.c
    M tests/display-vga-test.c
    M tests/endianness-test.c
    M tests/i440fx-test.c
    M tests/intel-hda-test.c
    M tests/test-filter-redirector.c
    M tests/virtio-blk-test.c
    M tests/virtio-console-test.c
    M tests/virtio-net-test.c
    M tests/virtio-scsi-test.c
    M tests/wdt_ib700-test.c
    M ui/cursor.c
    M ui/qemu-pixman.c
    M util/module.c
    M vl.c

  Log Message:
  -----------
  coccinelle: Remove unnecessary variables for function return value

Use Coccinelle script to replace 'ret = E; return ret' with
'return E'. The script will do the substitution only when the
function return type and variable type are the same.

Manual fixups:

* audio/audio.c: coding style of "read (...)" and "write (...)"
* block/qcow2-cluster.c: wrap line to make it shorter
* block/qcow2-refcount.c: change indentation of wrapped line
* target-tricore/op_helper.c: fix coding style of
  "remainder|quotient"
* target-mips/dsp_helper.c: reverted changes because I don't
  want to argue about checkpatch.pl
* ui/qemu-pixman.c: fix line indentation
* block/rbd.c: restore blank line between declarations and
  statements

Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
[Unused Coccinelle rule name dropped along with a redundant comment;
whitespace touched up in block/qcow2-cluster.c; stale commit message
paragraph deleted]
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 2ec62faea274aabb2feaad2b8f85961161b5e1e4
      
https://github.com/qemu/qemu/commit/2ec62faea274aabb2feaad2b8f85961161b5e1e4
  Author: Markus Armbruster <address@hidden>
  Date:   2016-06-20 (Mon, 20 Jun 2016)

  Changed paths:
    M util/log.c

  Log Message:
  -----------
  log: Plug memory leak on multiple -dfilter

-dfilter overwrites any previous filter.  The overwritten filter is
leaked.  Leaks since the beginning (commit 3514552, v2.6.0).  Free it
properly.

Signed-off-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: bd6fee9f1263dc5ba487c7ac57d33a727af63c00
      
https://github.com/qemu/qemu/commit/bd6fee9f1263dc5ba487c7ac57d33a727af63c00
  Author: Markus Armbruster <address@hidden>
  Date:   2016-06-20 (Mon, 20 Jun 2016)

  Changed paths:
    M include/qemu/log.h
    M tests/test-logging.c
    M util/log.c
    M vl.c

  Log Message:
  -----------
  log: Fix qemu_set_dfilter_ranges() error reporting

g_error() is not an acceptable way to report errors to the user:

    $ qemu-system-x86_64 -dfilter 1000+0

    ** (process:17187): ERROR **: Failed to parse range in: 1000+0
    Trace/breakpoint trap (core dumped)

g_assert() isn't, either:

    $ qemu-system-x86_64 -dfilter 1000x+64
    **
    ERROR:/work/armbru/qemu/util/log.c:180:qemu_set_dfilter_ranges: assertion 
failed: (e == range_op)
    Aborted (core dumped)

Convert qemu_set_dfilter_ranges() to Error.  Rework its deeply nested
control flow.  Touch up the error messages.  Call it with
&error_fatal.

This also permits testing without a subprocess, so do that.

Signed-off-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: daa76aa416b1e18ab1fac650ff53d966d8f21f68
      
https://github.com/qemu/qemu/commit/daa76aa416b1e18ab1fac650ff53d966d8f21f68
  Author: Markus Armbruster <address@hidden>
  Date:   2016-06-20 (Mon, 20 Jun 2016)

  Changed paths:
    M bsd-user/main.c
    M include/qemu/log.h
    M linux-user/main.c
    M monitor.c
    M tests/test-logging.c
    M trace/control.c
    M util/log.c
    M vl.c

  Log Message:
  -----------
  log: Fix qemu_set_log_filename() error handling

When qemu_set_log_filename() detects an invalid file name, it reports
an error, closes the log file (if any), and starts logging to stderr
(unless daemonized or nothing is being logged).

This is wrong.  Asking for an invalid log file on the command line
should be fatal.  Asking for one in the monitor should fail without
messing up an existing logfile.

Fix by converting qemu_set_log_filename() to Error.  Pass it
&error_fatal, except for hmp_logfile report errors.

This also permits testing without a subprocess, so do that.

Signed-off-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: 7fa124b273acd22a808e742ead78c065ccd9b4c4
      
https://github.com/qemu/qemu/commit/7fa124b273acd22a808e742ead78c065ccd9b4c4
  Author: Peter Maydell <address@hidden>
  Date:   2016-06-20 (Mon, 20 Jun 2016)

  Changed paths:
    M audio/audio.c
    M block.c
    M block/archipelago.c
    M block/qcow2-cluster.c
    M block/qcow2-refcount.c
    M block/qcow2.c
    M block/quorum.c
    M block/raw-posix.c
    M block/raw_bsd.c
    M block/rbd.c
    M block/snapshot.c
    M block/vmdk.c
    M block/vvfat.c
    M blockdev.c
    M bootdevice.c
    M bsd-user/main.c
    M dump.c
    M hw/acpi/aml-build.c
    M hw/audio/intel-hda.c
    M hw/display/vga.c
    M hw/ide/qdev.c
    M hw/intc/s390_flic_kvm.c
    M hw/net/ne2000-isa.c
    M hw/pci-host/uninorth.c
    M hw/ppc/spapr_vio.c
    M hw/s390x/s390-virtio-ccw.c
    M hw/s390x/virtio-ccw.c
    M hw/scsi/megasas.c
    M hw/scsi/scsi-generic.c
    M hw/timer/mc146818rtc.c
    M hw/usb/dev-storage.c
    M hw/virtio/virtio-pci.c
    M include/qemu/log.h
    M linux-user/main.c
    M linux-user/signal.c
    M monitor.c
    M page_cache.c
    M qga/commands-posix.c
    M qga/commands-win32.c
    M qobject/qlist.c
    M qom/object.c
    A scripts/coccinelle/error_propagate_null.cocci
    A scripts/coccinelle/remove_local_err.cocci
    A scripts/coccinelle/return_directly.cocci
    M target-i386/cpu.c
    M target-i386/fpu_helper.c
    M target-i386/kvm.c
    M target-mips/op_helper.c
    M target-s390x/helper.c
    M target-sparc/cc_helper.c
    M target-tricore/op_helper.c
    M tests/display-vga-test.c
    M tests/endianness-test.c
    M tests/i440fx-test.c
    M tests/intel-hda-test.c
    M tests/test-filter-redirector.c
    M tests/test-logging.c
    M tests/virtio-blk-test.c
    M tests/virtio-console-test.c
    M tests/virtio-net-test.c
    M tests/virtio-scsi-test.c
    M tests/wdt_ib700-test.c
    M trace/control.c
    M ui/cursor.c
    M ui/qemu-pixman.c
    M util/log.c
    M util/module.c
    M vl.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2016-06-20' into 
staging

Error reporting patches for 2016-06-20

# gpg: Signature made Mon 20 Jun 2016 15:56:15 BST
# gpg:                using RSA key 0x3870B400EB918653
# gpg: Good signature from "Markus Armbruster <address@hidden>"
# gpg:                 aka "Markus Armbruster <address@hidden>"
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653

* remotes/armbru/tags/pull-error-2016-06-20:
  log: Fix qemu_set_log_filename() error handling
  log: Fix qemu_set_dfilter_ranges() error reporting
  log: Plug memory leak on multiple -dfilter
  coccinelle: Remove unnecessary variables for function return value
  error: Remove unnecessary local_err variables
  error: Remove NULL checks on error_propagate() calls
  vl: Error messages need to go to stderr, fix some

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/fd2590bccc0b...7fa124b273ac

reply via email to

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