[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 04/19] block: update bs->total_sectors on wri
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH v3 04/19] block: update bs->total_sectors on writes |
Date: |
Mon, 29 Jul 2013 16:18:24 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 |
Il 29/07/2013 16:10, Kevin Wolf ha scritto:
> Am 29.07.2013 um 15:47 hat Paolo Bonzini geschrieben:
>> Il 29/07/2013 15:13, Kevin Wolf ha scritto:
>>> Am 25.07.2013 um 16:23 hat Paolo Bonzini geschrieben:
>>>> If a BlockDriverState is growable, after every write we need to
>>>> check if bs->total_sectors might have changed.
>>>>
>>>> Signed-off-by: Paolo Bonzini <address@hidden>
>>>> ---
>>>> block.c | 3 +++
>>>> 1 file changed, 3 insertions(+)
>>>>
>>>> diff --git a/block.c b/block.c
>>>> index 6cd39fa..ebac2fa 100644
>>>> --- a/block.c
>>>> +++ b/block.c
>>>> @@ -2651,6 +2651,9 @@ static int coroutine_fn
>>>> bdrv_co_do_writev(BlockDriverState *bs,
>>>> if (bs->wr_highest_sector < sector_num + nb_sectors - 1) {
>>>> bs->wr_highest_sector = sector_num + nb_sectors - 1;
>>>> }
>>>> + if (bs->growable && ret >= 0) {
>>>> + bs->total_sectors = MAX(bs->total_sectors, sector_num +
>>>> nb_sectors);
>>>> + }
>>>
>>> Can we change bdrv_getlength() to use bs->total_sectors even for
>>> growable images after this patch?
>>
>> Probably, but not in 1.6. :)
>
> "Probably" was my conclusion as well. The answer to this question is the
> answer to whether this patch makes sense, I think. So I can give you a
> Probably-reviewed-by if that's of any use. ;-)
>
> FWIW, I've got the feeling that the whole series might be better suited
> for block-next. Is there anything urgent in it?
No, I don't think so.
Paolo
[Qemu-devel] [PATCH v3 03/19] cow: do not call bdrv_co_is_allocated, Paolo Bonzini, 2013/07/25
[Qemu-devel] [PATCH v3 05/19] block: make bdrv_co_is_allocated static, Paolo Bonzini, 2013/07/25
[Qemu-devel] [PATCH v3 06/19] block: remove bdrv_is_allocated_above/bdrv_co_is_allocated_above distinction, Paolo Bonzini, 2013/07/25
[Qemu-devel] [PATCH v3 07/19] block: expect errors from bdrv_co_is_allocated, Paolo Bonzini, 2013/07/25