Do not include "qemu/error-report.h" in headers that do not need it
RFC PATCH 1/1 Do not include "qemu/error-report.h" in headers that do not need it
Include it in the .c files instead that use the error reporting functions.
---
RFC since it's more lines of code - but I think it's still cleaner this way.
include/hw/arm/allwinner-a10.h | 1 - include/qemu/vhost-user-server.h | 1 - include/ui/console.h | 1 - hw/display/vhost-user-gpu.c | 1 + hw/display/virtio-gpu-virgl.c | 1 + hw/misc/applesmc.c | 1 + ui/console.c | 1 + ui/egl-headless.c | 1 + ui/spice-app.c | 1 + ui/spice-display.c | 1 + ui/udmabuf.c | 1 + ui/vdagent.c | 1 + util/vhost-user-server.c | 1 + 13 files changed, 10 insertions(+), 3 deletions(-)
include/hw/arm/allwinner-a10.h +0 -1
@@ -1,7 +1,6 @@#ifndef HW_ARM_ALLWINNER_A10_H #define HW_ARM_ALLWINNER_A10_H -#include "qemu/error-report.h" #include "hw/char/serial.h" #include "hw/arm/boot.h" #include "hw/pci/pci_device.h"
include/qemu/vhost-user-server.h +0 -1
@@ -15,7 +15,6 @@#include "io/channel-socket.h" #include "io/channel-file.h" #include "io/net-listener.h" -#include "qemu/error-report.h" #include "qapi/error.h" #include "standard-headers/linux/virtio_blk.h"
include/ui/console.h +0 -1
@@ -4,7 +4,6 @@#include "ui/qemu-pixman.h" #include "qom/object.h" #include "qemu/notify.h" -#include "qemu/error-report.h" #include "qapi/qapi-types-ui.h" #ifdef CONFIG_OPENGL
hw/display/vhost-user-gpu.c +1 -0
@@ -11,6 +11,7 @@*/ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu/sockets.h" #include "hw/qdev-properties.h" #include "hw/virtio/virtio-gpu.h"
hw/display/virtio-gpu-virgl.c +1 -0
@@ -12,6 +12,7 @@*/ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu/iov.h" #include "trace.h" #include "hw/virtio/virtio.h"
hw/misc/applesmc.c +1 -0
@@ -34,6 +34,7 @@#include "hw/isa/isa.h" #include "hw/qdev-properties.h" #include "ui/console.h" +#include "qemu/error-report.h" #include "qemu/module.h" #include "qemu/timer.h" #include "qom/object.h"
ui/console.c +1 -0
@@ -28,6 +28,7 @@#include "qapi/error.h" #include "qapi/qapi-commands-ui.h" #include "qemu/coroutine.h" +#include "qemu/error-report.h" #include "qemu/fifo8.h" #include "qemu/main-loop.h" #include "qemu/module.h"
ui/egl-headless.c +1 -0
@@ -1,4 +1,5 @@#include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu/module.h" #include "sysemu/sysemu.h" #include "ui/console.h"
ui/spice-app.c +1 -0
@@ -29,6 +29,7 @@#include "ui/console.h" #include "ui/spice-display.h" #include "qemu/config-file.h" +#include "qemu/error-report.h" #include "qemu/option.h" #include "qemu/cutils.h" #include "qemu/module.h"
ui/spice-display.c +1 -0
@@ -17,6 +17,7 @@#include "qemu/osdep.h" #include "ui/qemu-spice.h" +#include "qemu/error-report.h" #include "qemu/timer.h" #include "qemu/lockable.h" #include "qemu/main-loop.h"
ui/udmabuf.c +1 -0
@@ -7,6 +7,7 @@#include "qemu/osdep.h" #include "qapi/error.h" #include "ui/console.h" +#include "qemu/error-report.h" #include <sys/ioctl.h>
ui/vdagent.c +1 -0
@@ -2,6 +2,7 @@#include "qapi/error.h" #include "chardev/char.h" #include "qemu/buffer.h" +#include "qemu/error-report.h" #include "qemu/option.h" #include "qemu/units.h" #include "hw/qdev-core.h"
util/vhost-user-server.c +1 -0
@@ -8,6 +8,7 @@* later. See the COPYING file in the top-level directory. */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu/main-loop.h" #include "qemu/vhost-user-server.h" #include "block/aio-wait.h"
Signature · 1 line
2.31.1
Quoted 7 lines · Thomas Huth
Include it in the .c files instead that use the error reporting functions.
Signed-off-by Thomas Huth <[email protected]>---
RFC since it's more lines of code - but I think it's still cleaner this way.
This is less pressure on the various .c files including these .h, so it is an improvement IMO.
Quoted 6 lines
include/hw/arm/allwinner-a10.h | 1 - include/qemu/vhost-user-server.h | 1 - include/ui/console.h | 1 - hw/display/vhost-user-gpu.c | 1 + hw/display/virtio-gpu-virgl.c | 1 + hw/misc/applesmc.c | 1 +
Quoted 8 lines
ui/console.c | 1 + ui/egl-headless.c | 1 + ui/spice-app.c | 1 + ui/spice-display.c | 1 + ui/udmabuf.c | 1 + ui/vdagent.c | 1 + util/vhost-user-server.c | 1 + 13 files changed, 10 insertions(+), 3 deletions(-)
Quoted 7 lines · Thomas Huth
Include it in the .c files instead that use the error reporting functions.
Signed-off-by Thomas Huth <[email protected]>---
RFC since it's more lines of code - but I think it's still cleaner this way.
Yes, please!
Quoted 5 lines · Markus Armbruster
Quoted 3 lines · Thomas Huth
Include it in the .c files instead that use the error reporting functions.
Quoted 8 lines
Quoted 4 lines
Signed-off-by Thomas Huth <[email protected]>---
RFC since it's more lines of code - but I think it's still cleaner this way.Yes, please!
Reviewed-by Markus Armbruster <[email protected]>
FWIW, I just noticed (thanks to the gitlab CI) that I was missing two more hunks:
ui/dbus-console.c +1 -0
@@ -22,6 +22,7 @@* THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include "ui/input.h" #include "ui/kbd-state.h"
ui/gtk.c +1 -0
@@ -36,6 +36,7 @@#include "qapi/qapi-commands-machine.h" #include "qapi/qapi-commands-misc.h" #include "qemu/cutils.h" +#include "qemu/error-report.h" #include "qemu/main-loop.h" #include "ui/console.h"
Thomas
Philippe Mathieu-Daudé
Reviewed-byQuoted 32 lines · Thomas Huth
Quoted 5 lines · Markus Armbruster
Quoted 3 lines · Thomas Huth
Include it in the .c files instead that use the error reporting functions.
Quoted 8 lines
Quoted 4 lines
Signed-off-by Thomas Huth <[email protected]>---
RFC since it's more lines of code - but I think it's still cleaner this way.Yes, please!
Reviewed-by Markus Armbruster <[email protected]>FWIW, I just noticed (thanks to the gitlab CI) that I was missing two more hunks:
ui/dbus-console.c +1
-0@@ -22,6 +22,7 @@* THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include "ui/input.h" #include "ui/kbd-state.h"
ui/gtk.c line 40
Quoted 5 lines
ui/gtk.c +1
-0@@ -36,6 +36,7 @@ #include "qapi/qapi-commands-machine.h" #include "qapi/qapi-commands-misc.h" #include "qemu/cutils.h" +#include "qemu/error-report.h" #include "qemu/main-loop.h"
Uses without include:
$ git grep -L qemu/error-report.h \ $(git grep -wEl '(error_report|error_report_once|error_report_once_cond)')