qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Samuel Thibault <samuel.thibault@eu.citrix.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] report read/write errors to IDE guest driver as ECC errors
Date: Tue, 5 Aug 2008 12:55:06 +0100	[thread overview]
Message-ID: <20080805115506.GR4478@implementation.uk.xensource.com> (raw)

report read/write errors to IDE guest driver as ECC errors
so that the guest knows that e.g. writes on read-only backends have
failed.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>

Index: hw/ide.c
===================================================================
--- hw/ide.c	(révision 4985)
+++ hw/ide.c	(copie de travail)
@@ -891,7 +891,6 @@
     return 1;
 }
 
-/* XXX: handle errors */
 static void ide_read_dma_cb(void *opaque, int ret)
 {
     BMDMAState *bm = opaque;
@@ -899,6 +898,14 @@
     int n;
     int64_t sector_num;
 
+    if (ret) {
+        s->status = READY_STAT | ERR_STAT;
+        s->error = ABRT_ERR | ECC_ERR;
+        s->nsector = 0;
+        ide_set_irq(s);
+        goto eot;
+    }
+
     n = s->io_buffer_size >> 9;
     sector_num = ide_get_sector(s);
     if (n > 0) {
@@ -992,7 +999,6 @@
     }
 }
 
-/* XXX: handle errors */
 static void ide_write_dma_cb(void *opaque, int ret)
 {
     BMDMAState *bm = opaque;
@@ -1000,6 +1006,14 @@
     int n;
     int64_t sector_num;
 
+    if (ret) {
+        s->status = READY_STAT | ERR_STAT;
+        s->error = ABRT_ERR | ECC_ERR;
+        s->nsector = 0;
+        ide_set_irq(s);
+        goto eot;
+    }
+
     n = s->io_buffer_size >> 9;
     sector_num = ide_get_sector(s);
     if (n > 0) {

             reply	other threads:[~2008-08-05 11:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-05 11:55 Samuel Thibault [this message]
2008-08-06  2:26 ` [Qemu-devel] [PATCH] report read/write errors to IDE guest driver as ECC errors Anthony Liguori
2008-08-06  9:28   ` Daniel P. Berrange
2008-08-06 12:22     ` Jamie Lokier
2008-08-11 16:47     ` Ian Jackson
2008-08-11 17:01       ` [Qemu-devel] [PATCH] report read/write errors to IDE guest driver as ECC errorsj Samuel Thibault
2008-08-11 17:56         ` Jamie Lokier
2008-08-11 17:05       ` [Qemu-devel] [PATCH] report read/write errors to IDE guest driver as ECC errors Anthony Liguori
2008-08-06 16:21 ` [Qemu-devel] " Samuel Thibault

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=20080805115506.GR4478@implementation.uk.xensource.com \
    --to=samuel.thibault@eu.citrix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).