diff options
author | Marcelo Tosatti <mtosatti@redhat.com> | 2011-01-26 12:12:35 -0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2011-02-07 12:51:19 +0100 |
commit | 8591675f44929a9e4b5d3a5fd702a4b6d41c7903 (patch) | |
tree | 1ad3ac6b6d162ea31f952922e1e4f4b7dce74725 /block.c | |
parent | db593f2565dc12442d6bac9e8eaefa027dfcada9 (diff) |
block: enable in_use flag
Set block device in use during block migration, disallow drive_del and
bdrv_truncate for in use devices.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
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); |