[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Re: [PATCH 2/3] block: Do not cache device size for rem
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] Re: [PATCH 2/3] block: Do not cache device size for removable media |
Date: |
Wed, 23 Mar 2011 20:46:26 +0000 |
On Wed, Mar 23, 2011 at 8:18 PM, Juan Quintela <address@hidden> wrote:
> Stefan Hajnoczi <address@hidden> wrote:
>> diff --git a/block.c b/block.c
>> index 8f224b4..89f6ded 100644
>> --- a/block.c
>> +++ b/block.c
>> @@ -1153,14 +1153,12 @@ int64_t bdrv_getlength(BlockDriverState *bs)
>> if (!drv)
>> return -ENOMEDIUM;
>>
>> - /* Fixed size devices use the total_sectors value for speed instead of
>> - issuing a length query (like lseek) on each call. Also, legacy block
>> - drivers don't provide a bdrv_getlength function and must use
>> - total_sectors. */
>> - if (!bs->growable || !drv->bdrv_getlength) {
>
> if (!bs->growable || !bs->removable|| !drv->bdrv_getlength) {
>
> changing just the test don't give exactly the same result?
I didn't like the inverted logic. I think it's clearer this way.
Stefan
[Qemu-devel] [PATCH 1/3] trace: Trace bdrv_set_locked(), Stefan Hajnoczi, 2011/03/23