From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46136) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xz0WN-0001gn-Gh for qemu-devel@nongnu.org; Thu, 11 Dec 2014 04:59:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xz0WH-0002Ks-8p for qemu-devel@nongnu.org; Thu, 11 Dec 2014 04:58:55 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40875) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xz0WH-0002Ki-25 for qemu-devel@nongnu.org; Thu, 11 Dec 2014 04:58:49 -0500 Message-ID: <54896AD1.6030600@redhat.com> Date: Thu, 11 Dec 2014 10:58:41 +0100 From: Max Reitz MIME-Version: 1.0 References: <1418279107-10339-1-git-send-email-junmuzi@gmail.com> <20141211091206.GB3909@noname.redhat.com> <5489601F.1060000@redhat.com> In-Reply-To: Content-Type: multipart/alternative; boundary="------------000409060504040003090808" 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 muzi Cc: Kevin Wolf , Josh Durgin , Fam Zheng , qemu-devel@nongnu.org, stefanha@redhat.com This is a multi-part message in MIME format. --------------000409060504040003090808 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id sBB9wiUN003887 On 2014-12-11 at 10:54, jun muzi wrote: > > Jun Li > 2014-12-11 =E4=B8=8B=E5=8D=885:13=E4=BA=8E "Max Reitz" >=E5=86=99=E9=81=93=EF=BC=9A > > > > 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=20 > 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=20 > *rbd_start_aio(BlockDriverState *bs, > >>> } > >>> if (r < 0) { > >>> + if (r =3D=3D -EINVAL && cmd =3D=3D 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 yo= u > >> 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=20 > 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 fir= st. > > > > Hi, which serial do you mean? Could you give a link? Thx. > Hi, here it is:=20 http://lists.nongnu.org/archive/html/qemu-devel/2014-07/msg02088.html Max --------------000409060504040003090808 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id sBB9wiUN003887
On 2014-12-11 at 10:54, jun muzi wrote= :

Jun Li
2014-12-11 =E4=B8=8B=E5=8D=885:13=E4=BA=8E "Max Reitz" <mreitz@redhat.com>=E5=86= =99=E9=81=93=EF=BC=9A
>
> 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 <junmuzi@gmail.com>
>>> ---
>>> v2:
>>> Just use rbd_aio_write to realize error detection. >>> ---
>>> =C2=A0 block/rbd.c | 4 ++++
>>> =C2=A0 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,
>>> =C2=A0 =C2=A0 =C2=A0 }
>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (r < 0) {
>>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (r =3D=3D -EINVAL &a= mp;& cmd =3D=3D RBD_AIO_WRITE) {
>>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 fprintf(s= tderr, "Image formats that grow on demand "
>>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "are not supported on rbd.\n");
>>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 }
>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 goto failed_compl= etion;
>>> =C2=A0 =C2=A0 =C2=A0 }
>>
>> 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.
>

Hi, which serial do you mean? Could you give a link? Thx.


Hi, here it is: http://lists.nongnu.org/arch= ive/html/qemu-devel/2014-07/msg02088.html

Max
--------------000409060504040003090808--