[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2] Block migration fail, ignore error from bdrv
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH v2] Block migration fail, ignore error from bdrv_getlength |
Date: |
Mon, 12 Jul 2010 10:09:21 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-2.fc12 Thunderbird/3.0.4 |
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 <address@hidden>
> ---
> 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