Revision bb8bf76f block.c
b/block.c | ||
---|---|---|
1515 | 1515 |
return 1; |
1516 | 1516 |
} |
1517 | 1517 |
|
1518 |
int bdrv_discard(BlockDriverState *bs, int64_t sector_num, int nb_sectors) |
|
1519 |
{ |
|
1520 |
if (!bs->drv) { |
|
1521 |
return -ENOMEDIUM; |
|
1522 |
} |
|
1523 |
if (!bs->drv->bdrv_discard) { |
|
1524 |
return 0; |
|
1525 |
} |
|
1526 |
return bs->drv->bdrv_discard(bs, sector_num, nb_sectors); |
|
1527 |
} |
|
1528 |
|
|
1518 | 1529 |
/* |
1519 | 1530 |
* Returns true iff the specified sector is present in the disk image. Drivers |
1520 | 1531 |
* not implementing the functionality are assumed to not support backing files, |
Also available in: Unified diff