All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Hervé Poussineau" <hpoussin@reactos.org>
To: qemu-devel@nongnu.org
Cc: "Blue Swirl" <blauwirbel@gmail.com>,
	"Kevin Wolf" <kwolf@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Hervé Poussineau" <hpoussin@reactos.org>,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: [Qemu-devel] [PATCH 6/7] esp: use error_report()/hw_error() instead of stderr output
Date: Sun,  3 Jun 2012 12:38:08 +0200	[thread overview]
Message-ID: <1338719890-9935-7-git-send-email-hpoussin@reactos.org> (raw)
In-Reply-To: <1338719890-9935-1-git-send-email-hpoussin@reactos.org>

Use error_report() for guest errors, hw_error() for unimplemented parts.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
---
 hw/esp.c |   12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/hw/esp.c b/hw/esp.c
index 714069b..e3425bb 100644
--- a/hw/esp.c
+++ b/hw/esp.c
@@ -35,9 +35,6 @@
  * http://www.ibiblio.org/pub/historic-linux/early-ports/Sparc/NCR/NCR53C9X.txt
  */
 
-#define ESP_ERROR(fmt, ...)                                             \
-    do { printf("ESP ERROR: %s: " fmt, __func__ , ## __VA_ARGS__); } while (0)
-
 #define ESP_REGS 16
 #define TI_BUFSZ 16
 
@@ -498,7 +495,7 @@ static uint64_t esp_reg_read(ESPState *s, uint32_t saddr)
             s->ti_size--;
             if ((s->rregs[ESP_RSTAT] & STAT_PIO_MASK) == 0) {
                 /* Data out.  */
-                ESP_ERROR("PIO data read not implemented\n");
+                hw_error("esp: PIO data read not implemented");
                 s->rregs[ESP_FIFO] = 0;
             } else {
                 s->rregs[ESP_FIFO] = s->ti_buf[s->ti_rptr++];
@@ -538,7 +535,7 @@ static void esp_reg_write(ESPState *s, uint32_t saddr, uint64_t val)
         if (s->do_cmd) {
             s->cmdbuf[s->cmdlen++] = val & 0xff;
         } else if (s->ti_size == TI_BUFSZ - 1) {
-            ESP_ERROR("fifo overrun\n");
+            error_report("esp: fifo overrun");
         } else {
             s->ti_size++;
             s->ti_buf[s->ti_wptr++] = val & 0xff;
@@ -626,7 +623,7 @@ static void esp_reg_write(ESPState *s, uint32_t saddr, uint64_t val)
             esp_raise_irq(s);
             break;
         default:
-            ESP_ERROR("Unhandled ESP command (%2.2x)\n", (unsigned)val);
+            error_report("esp: unhandled command (%2.2x)", (unsigned)val);
             break;
         }
         break;
@@ -641,7 +638,8 @@ static void esp_reg_write(ESPState *s, uint32_t saddr, uint64_t val)
         s->rregs[saddr] = val;
         break;
     default:
-        ESP_ERROR("invalid write of 0x%02x at [0x%x]\n", (unsigned)val, saddr);
+        error_report("esp: invalid write of 0x%02x at [0x%x]",
+                     (unsigned int)val, saddr);
         return;
     }
     s->wregs[saddr] = val;
-- 
1.7.10

  parent reply	other threads:[~2012-06-03 10:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-03 10:38 [Qemu-devel] [PATCH 0/7] esp: add AMD PCscsi emulation Hervé Poussineau
2012-06-03 10:38 ` [Qemu-devel] [PATCH 1/7] esp: implement Disable selection command Hervé Poussineau
2012-06-03 10:38 ` [Qemu-devel] [PATCH 2/7] esp: implement Reset ATN command Hervé Poussineau
2012-06-03 10:38 ` [Qemu-devel] [PATCH 3/7] esp: support future change of chip_id Hervé Poussineau
2012-06-03 10:38 ` [Qemu-devel] [PATCH 4/7] esp: use hba_private field instead of a complex cast Hervé Poussineau
2012-06-03 10:38 ` [Qemu-devel] [PATCH 5/7] esp: split esp code into generic chip emulation and sysbus layer Hervé Poussineau
2012-06-03 10:38 ` Hervé Poussineau [this message]
2012-06-03 10:38 ` [Qemu-devel] [PATCH 7/7] esp: add AMD PCscsi emulation (PCI SCSI adapter) Hervé Poussineau
2012-06-03 10:46   ` Michael S. Tsirkin
2012-06-03 11:17     ` Hervé Poussineau
2012-06-03 11:23       ` Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1338719890-9935-7-git-send-email-hpoussin@reactos.org \
    --to=hpoussin@reactos.org \
    --cc=blauwirbel@gmail.com \
    --cc=kwolf@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.