On Wed, Mar 23, 2011 at 8:18 PM, Juan Quintela <quint...@redhat.com> wrote: > Stefan Hajnoczi <stefa...@linux.vnet.ibm.com> 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