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

Am 11.12.2014 um 07:25 hat Jun Li geschrieben:
> 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;
>      }

You can't fill up the log with messages like that. In general, if you
use fprintf() in a function whose call can be triggered by the guest,
you're doing it wrong.

What needs to be done is to check at open time whether the configuration
works. Max has sent a series to that end a while ago, not sure what its
status is. I think it ended up depending on some blockdev work.

Kevin

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

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-11  6:25 [Qemu-devel] [PATCH v2] rbd: print a clear error message when write beyond EOF Jun Li
2014-12-11  9:12 ` Kevin Wolf [this message]
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=20141211091206.GB3909@noname.redhat.com \
    --to=kwolf@redhat.com \
    --cc=famz@redhat.com \
    --cc=josh.durgin@inktank.com \
    --cc=juli@redhat.com \
    --cc=junmuzi@gmail.com \
    --cc=mreitz@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).