From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=54634 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OYE4u-00074v-TD for qemu-devel@nongnu.org; Mon, 12 Jul 2010 04:09:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OYE4t-00035j-F5 for qemu-devel@nongnu.org; Mon, 12 Jul 2010 04:09:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56115) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OYE4t-00035T-26 for qemu-devel@nongnu.org; Mon, 12 Jul 2010 04:09:27 -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 o6C89Pei008148 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 12 Jul 2010 04:09:26 -0400 Message-ID: <4C3ACDB1.1090108@redhat.com> Date: Mon, 12 Jul 2010 10:09:21 +0200 From: Kevin Wolf MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH v2] Block migration fail, ignore error from bdrv_getlength References: <20100710155902.GA7402@redhat.com> In-Reply-To: <20100710155902.GA7402@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Shahar Havivi Cc: qemu-devel@nongnu.org Am 10.07.2010 17:59, schrieb Shahar Havivi: > 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 Please put the changes between patch versions below the --- line so that git am ignores it. > > 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; > } > Dealing with -errno shifted by 9 looks really strange, but it should be correct (sectors being -1 for error cases in practice). Thanks, applied to the block branch. Kevin