Skip to content

Commit

Permalink
Block migration fail, ignore error from bdrv_getlength
Browse files Browse the repository at this point in the history
When there is no block driver associate with BlockDriverState bdrv_getlength
returns -ENOMEDIUM that cause block migration to fail

Signed-off-by: Shahar Havivi <shaharh@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
  • Loading branch information
shaharha authored and kevmw committed Jul 13, 2010
1 parent 5fb58b0 commit 31f54f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion block-migration.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ static void init_blk_migration_it(void *opaque, BlockDriverState *bs)

if (!bdrv_is_read_only(bs)) {
sectors = bdrv_getlength(bs) >> BDRV_SECTOR_BITS;
if (sectors == 0) {
if (sectors <= 0) {
return;
}

Expand Down

0 comments on commit 31f54f2

Please sign in to comment.