* [Qemu-devel] [PATCH v2] rbd: print a clear error message when write beyond EOF
@ 2014-12-11 6:25 Jun Li
2014-12-11 9:12 ` Kevin Wolf
0 siblings, 1 reply; 5+ messages in thread
From: Jun Li @ 2014-12-11 6:25 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, famz, juli, stefanha, josh.durgin, Jun Li
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH v2] rbd: print a clear error message when write beyond EOF
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
2014-12-11 9:13 ` Max Reitz
0 siblings, 1 reply; 5+ messages in thread
From: Kevin Wolf @ 2014-12-11 9:12 UTC (permalink / raw)
To: Jun Li; +Cc: famz, juli, qemu-devel, mreitz, stefanha, josh.durgin
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH v2] rbd: print a clear error message when write beyond EOF
2014-12-11 9:12 ` Kevin Wolf
@ 2014-12-11 9:13 ` Max Reitz
2014-12-11 9:54 ` jun muzi
0 siblings, 1 reply; 5+ messages in thread
From: Max Reitz @ 2014-12-11 9:13 UTC (permalink / raw)
To: Kevin Wolf, Jun Li; +Cc: juli, famz, qemu-devel, stefanha, josh.durgin
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.
>> ---
>> 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH v2] rbd: print a clear error message when write beyond EOF
2014-12-11 9:13 ` Max Reitz
@ 2014-12-11 9:54 ` jun muzi
2014-12-11 9:58 ` Max Reitz
0 siblings, 1 reply; 5+ messages in thread
From: jun muzi @ 2014-12-11 9:54 UTC (permalink / raw)
To: Max Reitz; +Cc: Kevin Wolf, Josh Durgin, Fam Zheng, qemu-devel, stefanha
[-- Attachment #1: Type: text/plain, Size: 1585 bytes --]
Jun Li
2014-12-11 下午5:13于 "Max Reitz" <mreitz@redhat.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 <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.
>
>
> 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.
Jun Li
[-- Attachment #2: Type: text/html, Size: 2320 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH v2] rbd: print a clear error message when write beyond EOF
2014-12-11 9:54 ` jun muzi
@ 2014-12-11 9:58 ` Max Reitz
0 siblings, 0 replies; 5+ messages in thread
From: Max Reitz @ 2014-12-11 9:58 UTC (permalink / raw)
To: jun muzi; +Cc: Kevin Wolf, Josh Durgin, Fam Zheng, qemu-devel, stefanha
[-- Attachment #1: Type: text/plain, Size: 1877 bytes --]
On 2014-12-11 at 10:54, jun muzi wrote:
>
> Jun Li
> 2014-12-11 下午5:13于 "Max Reitz" <mreitz@redhat.com
> <mailto:mreitz@redhat.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 <junmuzi@gmail.com <mailto: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.
> >
> >
> > 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/archive/html/qemu-devel/2014-07/msg02088.html
Max
[-- Attachment #2: Type: text/html, Size: 3395 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-12-11 9:59 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2014-12-11 9:13 ` Max Reitz
2014-12-11 9:54 ` jun muzi
2014-12-11 9:58 ` Max Reitz
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).