Skip to contentSkip to conversation

Block migration fail, ignore error from bdrv_getlength

PATCH Superseded Shahar Havivi 2 participants 2 messages Jul 10, 2010

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 block-migration.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
block-migration.c +1 -1
index 7db6f02..3d78748 100644
@@ -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;
         }
 
Signature · 1 line
1.7.1.1
#1 lore raw

It need to be sectors <= 0,
Will send v2

Quoted 24 lines · Shahar Havivi

When there is no block driver associate with BlockDriverState bdrv_getlength returns -ENOMEDIUM that cause block migration to fail.

---
block-migration.c | 2 +-

1 files changed, 1 insertions(+), 1 deletions(-)
block-migration.c +1 -1
index 7db6f02..3d78748 100644
@@ -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;
        }
 
Signature · 1 line
1.7.1.1