diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c index a2f9cc1cc32ae738e0597841a5fe48f0c4f56b91..c41ce9b32a86b05b70f3a7cd87eb1cdc1965f524 100644 --- a/hw/scsi-bus.c +++ b/hw/scsi-bus.c @@ -1,5 +1,5 @@ #include "hw.h" -#include "sysemu.h" +#include "qemu-error.h" #include "scsi.h" #include "scsi-defs.h" #include "block.h" diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index 8f7ffc143da363d1155c4fceadc08f0f7448e0db..9cc35f8e97a22ec2f351a057f2cb82eab8712c56 100644 --- a/hw/scsi-disk.c +++ b/hw/scsi-disk.c @@ -19,8 +19,6 @@ * the host adapter emulator. */ -#include -#include //#define DEBUG_SCSI #ifdef DEBUG_SCSI @@ -34,6 +32,7 @@ do { printf("scsi-disk: " fmt , ## __VA_ARGS__); } while (0) do { fprintf(stderr, "scsi-disk: " fmt , ## __VA_ARGS__); } while (0) #include "qemu-common.h" +#include "qemu-error.h" #include "block.h" #include "scsi.h" #include "scsi-defs.h" diff --git a/hw/scsi-generic.c b/hw/scsi-generic.c index de778efa3b66227866f6dfd4bbf686f2bc718c10..cfd990352f02516fc1d83ec093041f4eb0f07caa 100644 --- a/hw/scsi-generic.c +++ b/hw/scsi-generic.c @@ -12,6 +12,7 @@ */ #include "qemu-common.h" +#include "qemu-error.h" #include "block.h" #include "scsi.h" diff --git a/hw/usb-serial.c b/hw/usb-serial.c index 1410b11b2be5b83255d68652a556f54dc4aaf910..6db9446b82324763200cec4ad907567b6bbb8180 100644 --- a/hw/usb-serial.c +++ b/hw/usb-serial.c @@ -9,6 +9,7 @@ */ #include "qemu-common.h" +#include "qemu-error.h" #include "usb.h" #include "qemu-char.h" diff --git a/hw/virtio-net.c b/hw/virtio-net.c index 5c0093e879df5dde1f94fef47efceb099cac427e..8359be69e7dd259e23d6d567a78202087e86838c 100644 --- a/hw/virtio-net.c +++ b/hw/virtio-net.c @@ -15,6 +15,7 @@ #include "net.h" #include "net/checksum.h" #include "net/tap.h" +#include "qemu-error.h" #include "qemu-timer.h" #include "virtio-net.h" diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c index 799f664d8e50ea2db00d296a43f505f0a214b32d..52f8812b0b24a309b5b90c64bc0247edbc6b0f02 100644 --- a/hw/virtio-pci.c +++ b/hw/virtio-pci.c @@ -19,7 +19,7 @@ #include "virtio-blk.h" #include "virtio-net.h" #include "pci.h" -#include "sysemu.h" +#include "qemu-error.h" #include "msix.h" #include "net.h" #include "block_int.h" diff --git a/monitor.h b/monitor.h index cf3b3790c7cf105ddeda93969b2d14435b679ded..dbb7becba91d6289f47135492fcfecf1bf064368 100644 --- a/monitor.h +++ b/monitor.h @@ -3,6 +3,7 @@ #include "qemu-common.h" #include "qemu-char.h" +#include "qemu-error.h" #include "qerror.h" #include "qdict.h" #include "block.h" diff --git a/net/dump.c b/net/dump.c index d50b4eeac4f2f9773e3aec59b4d15785b1519c0e..e702830108db3a25069c23647fb0caf261ea4d1c 100644 --- a/net/dump.c +++ b/net/dump.c @@ -25,6 +25,7 @@ #include "dump.h" #include "qemu-common.h" #include "sysemu.h" +#include "qemu-error.h" #include "qemu-log.h" typedef struct DumpState { diff --git a/net/socket.c b/net/socket.c index 442a9c790c337d5a98862133349ec398b6396b60..474d573a47e0b765d9075e2b47ea7949fc5e3282 100644 --- a/net/socket.c +++ b/net/socket.c @@ -28,9 +28,9 @@ #include "net.h" #include "qemu-char.h" #include "qemu-common.h" +#include "qemu-error.h" #include "qemu-option.h" #include "qemu_socket.h" -#include "sysemu.h" typedef struct NetSocketState { VLANClientState nc; diff --git a/net/tap-linux.c b/net/tap-linux.c index 6af9e824d3c3c35c7825ffa539393ab2a0cc2299..c5748e631b8c8eeb6a8949d2ddd6fff984086f86 100644 --- a/net/tap-linux.c +++ b/net/tap-linux.c @@ -31,6 +31,7 @@ #include "sysemu.h" #include "qemu-common.h" +#include "qemu-error.h" int tap_open(char *ifname, int ifname_size, int *vnet_hdr, int vnet_hdr_required) { diff --git a/net/tap.c b/net/tap.c index 7a7320c1a223e47cba3c0be94f0aba32d9dd0365..9ba9b4a5d44b9c5131fa644bd009968edd4860cf 100644 --- a/net/tap.c +++ b/net/tap.c @@ -38,6 +38,7 @@ #include "sysemu.h" #include "qemu-char.h" #include "qemu-common.h" +#include "qemu-error.h" #include "net/tap-linux.h" diff --git a/qemu-config.c b/qemu-config.c index 246fae6f99ffbfe01fbfd2d09c29011c41656e69..2c9a7a5f2daa93ab941dc8e92f91c72911e7b5b6 100644 --- a/qemu-config.c +++ b/qemu-config.c @@ -1,4 +1,5 @@ #include "qemu-common.h" +#include "qemu-error.h" #include "qemu-option.h" #include "qemu-config.h" #include "sysemu.h" diff --git a/qemu-error.h b/qemu-error.h new file mode 100644 index 0000000000000000000000000000000000000000..fa161135fdefa4b2f6a78f0ff9d74f217578d637 --- /dev/null +++ b/qemu-error.h @@ -0,0 +1,12 @@ +#ifndef QEMU_ERROR_H +#define QEMU_ERROR_H + +void qemu_error(const char *fmt, ...) __attribute__ ((format(printf, 1, 2))); +void qemu_error_internal(const char *file, int linenr, const char *func, + const char *fmt, ...) + __attribute__ ((format(printf, 4, 5))); + +#define qemu_error_new(fmt, ...) \ + qemu_error_internal(__FILE__, __LINE__, __func__, fmt, ## __VA_ARGS__) + +#endif diff --git a/qemu-tool.c b/qemu-tool.c index bbce99fd8db1641878b6cdc6b166578a58930883..26f46eb09caee91c75db64405bd6e2c908833cc3 100644 --- a/qemu-tool.c +++ b/qemu-tool.c @@ -13,9 +13,9 @@ #include "qemu-common.h" #include "monitor.h" -#include "sysemu.h" #include "qemu-timer.h" #include "qemu-log.h" +#include "qemu-error.h" #include diff --git a/qerror.c b/qerror.c index 2f657f4f7b60906db0eeb6bc5f9aeeb6f479d272..a418bde37f5b0fcf0cec8ad51505d56adbd9c80b 100644 --- a/qerror.c +++ b/qerror.c @@ -12,8 +12,8 @@ #include "qjson.h" #include "qerror.h" #include "qstring.h" -#include "sysemu.h" #include "qemu-common.h" +#include "qemu-error.h" static void qerror_destroy_obj(QObject *obj); diff --git a/sysemu.h b/sysemu.h index 14de993afcf93d00812ba0bfe96d5a331bb961fb..8a9c630ebd1e743c6c67c3ef090133762328f5b6 100644 --- a/sysemu.h +++ b/sysemu.h @@ -73,14 +73,6 @@ int qemu_savevm_state_complete(Monitor *mon, QEMUFile *f); void qemu_savevm_state_cancel(Monitor *mon, QEMUFile *f); int qemu_loadvm_state(QEMUFile *f); -void qemu_error(const char *fmt, ...) __attribute__ ((format(printf, 1, 2))); -void qemu_error_internal(const char *file, int linenr, const char *func, - const char *fmt, ...) - __attribute__ ((format(printf, 4, 5))); - -#define qemu_error_new(fmt, ...) \ - qemu_error_internal(__FILE__, __LINE__, __func__, fmt, ## __VA_ARGS__) - #ifdef _WIN32 /* Polling handling */