From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37457) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XyzoB-0004od-1V for qemu-devel@nongnu.org; Thu, 11 Dec 2014 04:13:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xyzo4-0002OU-TC for qemu-devel@nongnu.org; Thu, 11 Dec 2014 04:13:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57232) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xyzo4-0002OP-Jr for qemu-devel@nongnu.org; Thu, 11 Dec 2014 04:13:08 -0500 Message-ID: <5489601F.1060000@redhat.com> Date: Thu, 11 Dec 2014 10:13:03 +0100 From: Max Reitz MIME-Version: 1.0 References: <1418279107-10339-1-git-send-email-junmuzi@gmail.com> <20141211091206.GB3909@noname.redhat.com> In-Reply-To: <20141211091206.GB3909@noname.redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit 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: Kevin Wolf , Jun Li Cc: juli@redhat.com, famz@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, josh.durgin@inktank.com On 2014-12-11 at 10:12, Kevin Wolf wrote: > 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. Yes, the status is that we need to remove "growable" from the BDS first. Max