From patchwork Sat Jul 10 15:59:06 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shahar Havivi X-Patchwork-Id: 58489 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 09513B6EFE for ; Sun, 11 Jul 2010 02:06:31 +1000 (EST) Received: from localhost ([127.0.0.1]:60838 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OXcYx-0004pZ-9M for incoming@patchwork.ozlabs.org; Sat, 10 Jul 2010 12:05:59 -0400 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 To: qemu-devel@nongnu.org Message-ID: <20100710155902.GA7402@redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-12-10) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH v2] Block migration fail, ignore error from bdrv_getlength X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@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; }