diff options
Diffstat (limited to 'block.c')
-rw-r--r-- | block.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -1132,6 +1132,8 @@ int bdrv_truncate(BlockDriverState *bs, int64_t offset) return -ENOTSUP; if (bs->read_only) return -EACCES; + if (bdrv_in_use(bs)) + return -EBUSY; ret = drv->bdrv_truncate(bs, offset); if (ret == 0) { ret = refresh_total_sectors(bs, offset >> BDRV_SECTOR_BITS); |