[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 07/25] hw/i2c/smbus_slave: Add object path on error prints
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 07/25] hw/i2c/smbus_slave: Add object path on error prints |
Date: |
Wed, 21 Feb 2024 22:16:07 +0100 |
From: Joe Komlodi <komlodi@google.com>
The current logging doesn't tell us which specific smbus device is an
error state.
Signed-off-by: Joe Komlodi <komlodi@google.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20240202204847.2062798-3-komlodi@google.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/i2c/smbus_slave.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/hw/i2c/smbus_slave.c b/hw/i2c/smbus_slave.c
index 1300c9ec72..9f9afc25a4 100644
--- a/hw/i2c/smbus_slave.c
+++ b/hw/i2c/smbus_slave.c
@@ -25,11 +25,15 @@
#define DPRINTF(fmt, ...) \
do { printf("smbus(%02x): " fmt , dev->i2c.address, ## __VA_ARGS__); } while
(0)
#define BADF(fmt, ...) \
-do { fprintf(stderr, "smbus: error: " fmt , ## __VA_ARGS__); exit(1);} while
(0)
+do { g_autofree char *qom_path = object_get_canonical_path(OBJECT(dev)); \
+ fprintf(stderr, "%s: smbus: error: " fmt , qom_path, ## __VA_ARGS__); \
+ exit(1); } while (0)
#else
#define DPRINTF(fmt, ...) do {} while(0)
#define BADF(fmt, ...) \
-do { fprintf(stderr, "smbus: error: " fmt , ## __VA_ARGS__);} while (0)
+do { g_autofree char *qom_path = object_get_canonical_path(OBJECT(dev)); \
+ fprintf(stderr, "%s: smbus: error: " fmt , qom_path, ## __VA_ARGS__); \
+ } while (0)
#endif
enum {
--
2.41.0
- [PULL 00/25] Misc HW patches for 2024-02-21, Philippe Mathieu-Daudé, 2024/02/21
- [PULL 01/25] hw/input/pckbd: Open-code i8042_setup_a20_line() wrapper, Philippe Mathieu-Daudé, 2024/02/21
- [PULL 02/25] hw/sysbus: Inline and remove sysbus_add_io(), Philippe Mathieu-Daudé, 2024/02/21
- [PULL 03/25] hw/ppc/ppc4xx_pci: Remove unused "hw/ppc/ppc.h" header, Philippe Mathieu-Daudé, 2024/02/21
- [PULL 05/25] hw/ppc/ppc4xx_pci: Move ppc4xx_pci.c to hw/pci-host/, Philippe Mathieu-Daudé, 2024/02/21
- [PULL 04/25] hw/ppc/ppc4xx_pci: Extract PCI host definitions to hw/pci-host/ppc4xx.h, Philippe Mathieu-Daudé, 2024/02/21
- [PULL 06/25] hw/ppc/ppc440_pcix: Move ppc440_pcix.c to hw/pci-host/, Philippe Mathieu-Daudé, 2024/02/21
- [PULL 08/25] hw/i386/pc_piix: Share pc_cmos_init() invocation between pc and isapc machines, Philippe Mathieu-Daudé, 2024/02/21
- [PULL 09/25] hw/i386/pc: Store pointers to IDE buses in PCMachineState, Philippe Mathieu-Daudé, 2024/02/21
- [PULL 07/25] hw/i2c/smbus_slave: Add object path on error prints,
Philippe Mathieu-Daudé <=
- [PULL 10/25] hw/i386/pc: Do pc_cmos_init_late() from pc_machine_done(), Philippe Mathieu-Daudé, 2024/02/21
- [PULL 11/25] hw/i386/x86: Turn apic_xrupt_override into class attribute, Philippe Mathieu-Daudé, 2024/02/21
- [PULL 12/25] hw/i386/pc: Merge pc_guest_info_init() into pc_machine_initfn(), Philippe Mathieu-Daudé, 2024/02/21
- [PULL 13/25] hw/i386/pc: Defer smbios_set_defaults() to machine_done, Philippe Mathieu-Daudé, 2024/02/21
- [PULL 14/25] hw/i386/pc: Confine system flash handling to pc_sysfw, Philippe Mathieu-Daudé, 2024/02/21
- [PULL 15/25] hw/i386/pc_sysfw: Inline pc_system_flash_create() and remove it, Philippe Mathieu-Daudé, 2024/02/21
- [PULL 16/25] hw/i386/pc_q35: Populate interrupt handlers before realizing LPC PCI function, Philippe Mathieu-Daudé, 2024/02/21
- [PULL 17/25] hw/isa/meson.build: Sort alphabetically, Philippe Mathieu-Daudé, 2024/02/21
- [PULL 18/25] hw/ide: Add the possibility to disable the CompactFlash device in the build, Philippe Mathieu-Daudé, 2024/02/21
- [PULL 19/25] hw/ide: Split qdev.c into ide-bus.c and ide-dev.c, Philippe Mathieu-Daudé, 2024/02/21