[Qemu-devel] [PATCH v3 0/8] Implement a warning_report function

Alistair Francis posted 8 patches 6 years, 9 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/cover.1499774331.git.alistair.francis@xilinx.com
Test FreeBSD passed
Test checkpatch failed
Test docker passed
Test s390x passed
There is a newer version of this series
block/backup.c                 |  10 ++--
block/gluster.c                |   4 +-
block/iscsi.c                  |   6 +--
block/nfs.c                    |  12 ++---
block/rbd.c                    |   6 +--
block/ssh.c                    |   4 +-
blockdev.c                     |   2 +-
chardev/char-socket.c          |   4 +-
cpus.c                         |   2 +-
hw/9pfs/9p.c                   |   2 +-
hw/arm/highbank.c              |   6 +--
hw/arm/imx25_pdk.c             |   6 +--
hw/arm/kzm.c                   |   6 +--
hw/core/machine.c              |  10 ++--
hw/core/qdev-properties.c      |  10 ++--
hw/i386/acpi-build.c           |  11 +++--
hw/i386/kvm/pci-assign.c       |   6 +--
hw/i386/pc.c                   |  16 +++---
hw/i386/pc_piix.c              |   8 +--
hw/i386/pc_q35.c               |   6 +--
hw/misc/aspeed_sdmc.c          |   8 +--
hw/nvram/fw_cfg.c              |   2 +-
hw/pci-host/piix.c             |   2 +-
hw/ppc/pnv.c                   |   6 +--
hw/ppc/spapr.c                 |   4 +-
hw/ppc/spapr_iommu.c           |   2 +-
hw/scsi/scsi-bus.c             |   6 +--
hw/usb/dev-smartcard-reader.c  |   4 +-
hw/usb/redirect.c              |   2 +-
include/qapi/error.h           |  11 +++++
include/qemu/error-report.h    |   7 +++
net/tap-linux.c                |   2 +-
scripts/checkpatch.pl          |   7 ++-
target/i386/cpu.c              |   8 +--
target/i386/kvm.c              |   4 +-
target/s390x/cpu_models.c      |   2 +-
target/s390x/kvm.c             |   2 +-
tests/test-qdev-global-props.c |   6 +--
trace/control.c                |   4 +-
util/error.c                   |  20 ++++++++
util/qemu-error.c              | 107 ++++++++++++++++++++++++++++++++++++++---
vl.c                           |  20 ++++----
42 files changed, 254 insertions(+), 119 deletions(-)
[Qemu-devel] [PATCH v3 0/8] Implement a warning_report function
Posted by Alistair Francis 6 years, 9 months ago
QEMU currently has a standard method to report errors with
error_repot(). This ensure a sane and standard format when printing
errors. This series is attempting to extend this functionality for
warnings and information as well.

This patch renames error_print_loc() function to be more clear, but I
didn't bother renaming the others. It seems silly to change
error_printf() to error_warning_printf() and printf is already taken so
I just left it as is.
v3:
 - Regenerate the replacement patch
v1:
 - Convert all of the existing warning messages in QEMU
 - Add a error_report*_err() functions as well
RFCv3:
 - Use more detailed enum and function names
 - Add wrapper functions for the info and warning reporting
RFCv2:
 - Use enums for ERROR, WARN and INFO with a generic report() function
   instead of adding new functions



Alistair Francis (8):
  util/qemu-error: Rename error_print_loc() to be more generic
  error: Functions to report warnings and informational messages
  Convert error_report() to warn_report()
  hw/i386: Improve some of the warning messages
  char-socket: Report TCP socket waiting as information
  error: Implement the warn and free Error functions
  Convert error_report*_err() to warn_report*_err()
  error: Add a 'error: ' prefix to error_report()

 block/backup.c                 |  10 ++--
 block/gluster.c                |   4 +-
 block/iscsi.c                  |   6 +--
 block/nfs.c                    |  12 ++---
 block/rbd.c                    |   6 +--
 block/ssh.c                    |   4 +-
 blockdev.c                     |   2 +-
 chardev/char-socket.c          |   4 +-
 cpus.c                         |   2 +-
 hw/9pfs/9p.c                   |   2 +-
 hw/arm/highbank.c              |   6 +--
 hw/arm/imx25_pdk.c             |   6 +--
 hw/arm/kzm.c                   |   6 +--
 hw/core/machine.c              |  10 ++--
 hw/core/qdev-properties.c      |  10 ++--
 hw/i386/acpi-build.c           |  11 +++--
 hw/i386/kvm/pci-assign.c       |   6 +--
 hw/i386/pc.c                   |  16 +++---
 hw/i386/pc_piix.c              |   8 +--
 hw/i386/pc_q35.c               |   6 +--
 hw/misc/aspeed_sdmc.c          |   8 +--
 hw/nvram/fw_cfg.c              |   2 +-
 hw/pci-host/piix.c             |   2 +-
 hw/ppc/pnv.c                   |   6 +--
 hw/ppc/spapr.c                 |   4 +-
 hw/ppc/spapr_iommu.c           |   2 +-
 hw/scsi/scsi-bus.c             |   6 +--
 hw/usb/dev-smartcard-reader.c  |   4 +-
 hw/usb/redirect.c              |   2 +-
 include/qapi/error.h           |  11 +++++
 include/qemu/error-report.h    |   7 +++
 net/tap-linux.c                |   2 +-
 scripts/checkpatch.pl          |   7 ++-
 target/i386/cpu.c              |   8 +--
 target/i386/kvm.c              |   4 +-
 target/s390x/cpu_models.c      |   2 +-
 target/s390x/kvm.c             |   2 +-
 tests/test-qdev-global-props.c |   6 +--
 trace/control.c                |   4 +-
 util/error.c                   |  20 ++++++++
 util/qemu-error.c              | 107 ++++++++++++++++++++++++++++++++++++++---
 vl.c                           |  20 ++++----
 42 files changed, 254 insertions(+), 119 deletions(-)

-- 
2.11.0


Re: [Qemu-devel] [PATCH v3 0/8] Implement a warning_report function
Posted by no-reply@patchew.org 6 years, 9 months ago
Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Subject: [Qemu-devel] [PATCH v3 0/8]  Implement a warning_report function
Message-id: cover.1499774331.git.alistair.francis@xilinx.com

=== TEST SCRIPT BEGIN ===
#!/bin/bash

BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0

git config --local diff.renamelimit 0
git config --local diff.renames True

commits="$(git log --format=%H --reverse $BASE..)"
for c in $commits; do
    echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
        failed=1
        echo
    fi
    n=$((n+1))
done

exit $failed
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
60686e6 error: Add a 'error: ' prefix to error_report()
5364f27 Convert error_report*_err() to warn_report*_err()
a893104 error: Implement the warn and free Error functions
acb3d0e char-socket: Report TCP socket waiting as information
49d68cd hw/i386: Improve some of the warning messages
ec1a246 Convert error_report() to warn_report()
23f4974 error: Functions to report warnings and informational messages
fdc3c8a util/qemu-error: Rename error_print_loc() to be more generic

=== OUTPUT BEGIN ===
Checking PATCH 1/8: util/qemu-error: Rename error_print_loc() to be more generic...
Checking PATCH 2/8: error: Functions to report warnings and informational messages...
Checking PATCH 3/8: Convert error_report() to warn_report()...
ERROR: line over 90 characters
#694: FILE: tests/test-qdev-global-props.c:235:
+    g_test_trap_assert_stderr("*warning: global dynamic-prop-type-bad.prop3 has invalid class name\n*");

WARNING: line over 80 characters
#698: FILE: tests/test-qdev-global-props.c:237:
+    g_test_trap_assert_stderr("*warning: global nohotplug-type.prop5=105 not used\n*");

ERROR: line over 90 characters
#699: FILE: tests/test-qdev-global-props.c:238:
+    g_test_trap_assert_stderr("*warning: global nondevice-type.prop6 has invalid class name\n*");

total: 2 errors, 1 warnings, 539 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

Checking PATCH 4/8: hw/i386: Improve some of the warning messages...
Checking PATCH 5/8: char-socket: Report TCP socket waiting as information...
Checking PATCH 6/8: error: Implement the warn and free Error functions...
Checking PATCH 7/8: Convert error_report*_err() to warn_report*_err()...
Checking PATCH 8/8: error: Add a 'error: ' prefix to error_report()...
=== OUTPUT END ===

Test command exited with code: 1


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@freelists.org