qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jun Li <junmuzi@gmail.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, famz@redhat.com, juli@redhat.com,
	stefanha@redhat.com, josh.durgin@inktank.com,
	Jun Li <junmuzi@gmail.com>
Subject: [Qemu-devel] [PATCH v2] rbd: print a clear error message when write beyond EOF
Date: Thu, 11 Dec 2014 14:25:07 +0800	[thread overview]
Message-ID: <1418279107-10339-1-git-send-email-junmuzi@gmail.com> (raw)

Currently, as rbd driver do not support dynamic growth when write beyond EOF,
so just print a clear error message.

Signed-off-by: Jun Li <junmuzi@gmail.com>
---
v2:
Just use rbd_aio_write to realize error detection.
---
 block/rbd.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/block/rbd.c b/block/rbd.c
index 5b5a64a..710ee3e 100644
--- a/block/rbd.c
+++ b/block/rbd.c
@@ -661,6 +661,10 @@ static BlockAIOCB *rbd_start_aio(BlockDriverState *bs,
     }
 
     if (r < 0) {
+        if (r == -EINVAL && cmd == RBD_AIO_WRITE) {
+            fprintf(stderr, "Image formats that grow on demand "
+                            "are not supported on rbd.\n");
+        }
         goto failed_completion;
     }
 
-- 
1.9.3

             reply	other threads:[~2014-12-11  6:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-11  6:25 Jun Li [this message]
2014-12-11  9:12 ` [Qemu-devel] [PATCH v2] rbd: print a clear error message when write beyond EOF Kevin Wolf
2014-12-11  9:13   ` Max Reitz
2014-12-11  9:54     ` jun muzi
2014-12-11  9:58       ` Max Reitz

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=1418279107-10339-1-git-send-email-junmuzi@gmail.com \
    --to=junmuzi@gmail.com \
    --cc=famz@redhat.com \
    --cc=josh.durgin@inktank.com \
    --cc=juli@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /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).