Received: from eggs.gnu.org ([2001:4830:134:3::10]:37116) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XyznH-0003rG-Dw for qemu-devel@nongnu.org; Thu, 11 Dec 2014 04:12:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XyznB-00022I-43 for qemu-devel@nongnu.org; Thu, 11 Dec 2014 04:12:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56617) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XyznA-00022A-TE for qemu-devel@nongnu.org; Thu, 11 Dec 2014 04:12:13 -0500 Date: Thu, 11 Dec 2014 10:12:06 +0100 From: Kevin Wolf Message-ID: <20141211091206.GB3909@noname.redhat.com> References: <1418279107-10339-1-git-send-email-junmuzi@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1418279107-10339-1-git-send-email-junmuzi@gmail.com> Subject: Re: [Qemu-devel] [PATCH v2] rbd: print a clear error message when write beyond EOF List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jun Li Cc: famz@redhat.com, juli@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com, stefanha@redhat.com, josh.durgin@inktank.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 > --- > 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