Block migration fail, ignore error from bdrv_getlength

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>
This commit is contained in:
Shahar Havivi 2010-07-10 18:59:06 +03:00 committed by Kevin Wolf
parent 5fb58b067a
commit 31f54f24bb
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}