Message ID | 20180621180224.8312-12-f4bug@amsat.org |
---|---|
State | New |
Headers | show |
Series | hw/arm: use qemu_log_mask instead of fprintf | expand |
On 21.06.2018 20:02, Philippe Mathieu-Daudé wrote: > hw_error() finally calls abort(), but there is no need to abort here. > > Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> > --- > hw/net/smc91c111.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/hw/net/smc91c111.c b/hw/net/smc91c111.c > index c8cc5379b7..705a034cb9 100644 > --- a/hw/net/smc91c111.c > +++ b/hw/net/smc91c111.c > @@ -11,6 +11,7 @@ > #include "hw/sysbus.h" > #include "net/net.h" > #include "hw/devices.h" > +#include "qemu/log.h" > /* For crc32 */ > #include <zlib.h> > > @@ -478,7 +479,9 @@ static void smc91c111_writeb(void *opaque, hwaddr offset, > } > break; > } > - hw_error("smc91c111_write: Bad reg %d:%x\n", s->bank, (int)offset); > + qemu_log_mask(LOG_GUEST_ERROR, > + "smc91c111_write(bank:%d) 0x%" HWADDR_PRIx " = 0x%x\n", > + s->bank, offset, value); > } > > static uint32_t smc91c111_readb(void *opaque, hwaddr offset) > @@ -621,7 +624,9 @@ static uint32_t smc91c111_readb(void *opaque, hwaddr offset) > } > break; > } > - hw_error("smc91c111_read: Bad reg %d:%x\n", s->bank, (int)offset); > + qemu_log_mask(LOG_GUEST_ERROR, > + "smc91c111_read(bank:%d) 0x%" HWADDR_PRIx "\n", > + s->bank, offset); > return 0; > } Please keep "bad register" or a similar text in here. Thomas
diff --git a/hw/net/smc91c111.c b/hw/net/smc91c111.c index c8cc5379b7..705a034cb9 100644 --- a/hw/net/smc91c111.c +++ b/hw/net/smc91c111.c @@ -11,6 +11,7 @@ #include "hw/sysbus.h" #include "net/net.h" #include "hw/devices.h" +#include "qemu/log.h" /* For crc32 */ #include <zlib.h> @@ -478,7 +479,9 @@ static void smc91c111_writeb(void *opaque, hwaddr offset, } break; } - hw_error("smc91c111_write: Bad reg %d:%x\n", s->bank, (int)offset); + qemu_log_mask(LOG_GUEST_ERROR, + "smc91c111_write(bank:%d) 0x%" HWADDR_PRIx " = 0x%x\n", + s->bank, offset, value); } static uint32_t smc91c111_readb(void *opaque, hwaddr offset) @@ -621,7 +624,9 @@ static uint32_t smc91c111_readb(void *opaque, hwaddr offset) } break; } - hw_error("smc91c111_read: Bad reg %d:%x\n", s->bank, (int)offset); + qemu_log_mask(LOG_GUEST_ERROR, + "smc91c111_read(bank:%d) 0x%" HWADDR_PRIx "\n", + s->bank, offset); return 0; }
hw_error() finally calls abort(), but there is no need to abort here. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> --- hw/net/smc91c111.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)