Patchwork [2/5] Block migration fail, ignore error from bdrv_getlength

login
register
mail settings
Submitter Kevin Wolf
Date July 13, 2010, 3:54 p.m.
Message ID <1279036466-19934-3-git-send-email-kwolf@redhat.com>
Download mbox | patch
Permalink /patch/58798/
State New
Headers show

Comments

Kevin Wolf - July 13, 2010, 3:54 p.m.
From: Shahar Havivi <shaharh@redhat.com>

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>
---
 block-migration.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/block-migration.c b/block-migration.c
index 7db6f02..a77106e 100644
--- a/block-migration.c
+++ b/block-migration.c
@@ -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;
         }