hw/ide/ahci: Replace fprintf() by qemu_log_mask(GUEST_ERROR)
PATCH 1/1 hw/ide/ahci: Replace fprintf() by qemu_log_mask(GUEST_ERROR)
Replace fprintf() calls by qemu_log_mask(LOG_GUEST_ERROR).
Signed-off-by Philippe Mathieu-Daudé <[email protected]>
--- hw/ide/ahci.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
hw/ide/ahci.c +5 -3
@@ -465,8 +465,9 @@ static void ahci_mem_write(void *opaque, hwaddr addr,/* Only aligned reads are allowed on AHCI */ if (addr &3 ) { -fprintf (stderr,"ahci: Mis-aligned write to addr 0x" - TARGET_FMT_plx"\n" , addr); +qemu_log_mask (LOG_GUEST_ERROR , +"ahci: Mis-aligned write to addr 0x%03" HWADDR_PRIX "\n" , + addr);return ; }
@@ -1111,7 +1112,8 @@ static void process_ncq_command(AHCIState *s, int port, uint8_t *cmd_fis,g_assert (is_ncq (ncq_fis->command));if (ncq_tfs->used) {/* error - already in use */ -fprintf (stderr,"%s: tag %d already used\n" , __func__, tag); +qemu_log_mask (LOG_GUEST_ERROR ,"%s: tag %d already used\n" , + __func__, tag);return ; }
Signature · 1 line
2.26.2
Quoted 25 lines · Philippe Mathieu-Daudé
Replace
fprintf()calls byqemu_log_mask(LOG_GUEST_ERROR).Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/ide/ahci.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)hw/ide/ahci.c +3
-2@@ -465,8 +465,9 @@ static void ahci_mem_write(void *opaque, hwaddr addr,/* Only aligned reads are allowed on AHCI */ if (addr &3 ) { -fprintf (stderr,"ahci: Mis-aligned write to addr 0x" - TARGET_FMT_plx"\n" , addr); +qemu_log_mask (LOG_GUEST_ERROR , +"ahci: Mis-aligned write to addr 0x%03" HWADDR_PRIX "\n" , + addr);return ; }
hw/ide/ahci.c static void process_ncq_command(AHCIState *s, int port, uint8_t *cmd_fis, · line 1119
Quoted 9 lines
hw/ide/ahci.c +2
-1@@ -1111,7 +1112,8 @@ static void process_ncq_command(AHCIState *s, int port, uint8_t *cmd_fis,g_assert (is_ncq (ncq_fis->command));if (ncq_tfs->used) {/* error - already in use */ -fprintf (stderr,"%s: tag %d already used\n" , __func__, tag); +qemu_log_mask (LOG_GUEST_ERROR ,"%s: tag %d already used\n" , + __func__, tag);return ; }
Reviewed-by Thomas Huth <[email protected]>
Laurent Vivier
AppliedLe 12/01/2021 à 12:29, Philippe Mathieu-Daudé a écrit :
Quoted 25 lines
Replace
fprintf()calls byqemu_log_mask(LOG_GUEST_ERROR).Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/ide/ahci.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)hw/ide/ahci.c +3
-2@@ -465,8 +465,9 @@ static void ahci_mem_write(void *opaque, hwaddr addr,/* Only aligned reads are allowed on AHCI */ if (addr &3 ) { -fprintf (stderr,"ahci: Mis-aligned write to addr 0x" - TARGET_FMT_plx"\n" , addr); +qemu_log_mask (LOG_GUEST_ERROR , +"ahci: Mis-aligned write to addr 0x%03" HWADDR_PRIX "\n" , + addr);return ; }
hw/ide/ahci.c static void process_ncq_command(AHCIState *s, int port, uint8_t *cmd_fis, · line 1119
Quoted 9 lines
hw/ide/ahci.c +2
-1@@ -1111,7 +1112,8 @@ static void process_ncq_command(AHCIState *s, int port, uint8_t *cmd_fis,g_assert (is_ncq (ncq_fis->command));if (ncq_tfs->used) {/* error - already in use */ -fprintf (stderr,"%s: tag %d already used\n" , __func__, tag); +qemu_log_mask (LOG_GUEST_ERROR ,"%s: tag %d already used\n" , + __func__, tag);return ; }
Applied to my trivial-patches branch.
Thanks,
Laurent