qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH v2 3/3] Return -errno on write failure
Date: Thu, 15 Jan 2009 12:12:52 +0200	[thread overview]
Message-ID: <20090115101252.13211.23542.stgit@dhcp-1-237.tlv.redhat.com> (raw)
In-Reply-To: <20090115101241.13211.64596.stgit@dhcp-1-237.tlv.redhat.com>

Signed-off-by: Gleb Natapov <gleb@redhat.com>
---

 block-raw-posix.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/block-raw-posix.c b/block-raw-posix.c
index 2fbb714..d17af0b 100644
--- a/block-raw-posix.c
+++ b/block-raw-posix.c
@@ -252,7 +252,7 @@ static int raw_pwrite_aligned(BlockDriverState *bs, int64_t offset,
 
     ret = fd_open(bs);
     if (ret < 0)
-        return ret;
+        return -errno;
 
     if (offset >= 0 && lseek(s->fd, offset, SEEK_SET) == (off_t)-1) {
         ++(s->lseek_err_cnt);
@@ -262,7 +262,7 @@ static int raw_pwrite_aligned(BlockDriverState *bs, int64_t offset,
                               s->fd, bs->filename, offset, buf, count,
                               bs->total_sectors, errno, strerror(errno));
         }
-        return -1;
+        return -EIO;
     }
     s->lseek_err_cnt = 0;
 
@@ -277,7 +277,7 @@ static int raw_pwrite_aligned(BlockDriverState *bs, int64_t offset,
 
 label__raw_write__success:
 
-    return ret;
+    return  (ret < 0) ? -errno : ret;
 }
 
 

  parent reply	other threads:[~2009-01-15 10:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-15 10:12 [Qemu-devel] [PATCH v2 1/3] Stop VM on ENOSPC error Gleb Natapov
2009-01-15 10:12 ` [Qemu-devel] [PATCH v2 2/3] bdrv_write should not stop on partial write Gleb Natapov
2009-01-15 20:44   ` Anthony Liguori
2009-01-15 10:12 ` Gleb Natapov [this message]
2009-01-15 20:44   ` [Qemu-devel] [PATCH v2 3/3] Return -errno on write failure Anthony Liguori
2009-01-15 20:39 ` [Qemu-devel] [PATCH v2 1/3] Stop VM on ENOSPC error Anthony Liguori

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=20090115101252.13211.23542.stgit@dhcp-1-237.tlv.redhat.com \
    --to=gleb@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 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).