From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=51753 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OXcTX-00033T-TR for qemu-devel@nongnu.org; Sat, 10 Jul 2010 12:00:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OXcTW-0002tT-RQ for qemu-devel@nongnu.org; Sat, 10 Jul 2010 12:00:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59705) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OXcTW-0002tA-LD for qemu-devel@nongnu.org; Sat, 10 Jul 2010 12:00:22 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o6AG0LcK022944 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 10 Jul 2010 12:00:21 -0400 Received: from localhost (dhcp-1-229.tlv.redhat.com [10.35.1.229]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o6AG0JPZ018280 for ; Sat, 10 Jul 2010 12:00:20 -0400 Date: Sat, 10 Jul 2010 18:59:06 +0300 From: Shahar Havivi Message-ID: <20100710155902.GA7402@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] [PATCH v2] Block migration fail, ignore error from bdrv_getlength List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org When there is no block driver associate with BlockDriverState bdrv_getlength returns -ENOMEDIUM that cause block migration to fail v2: fix sectors<0 to sectors<=0 Signed-off-by: Shahar Havivi --- block-migration.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) 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; } -- 1.7.1.1