* [Qemu-devel] [PATCH v2] Block migration fail, ignore error from bdrv_getlength
@ 2010-07-10 15:59 Shahar Havivi
2010-07-12 8:09 ` Kevin Wolf
0 siblings, 1 reply; 2+ messages in thread
From: Shahar Havivi @ 2010-07-10 15:59 UTC (permalink / raw
To: qemu-devel
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 <shaharh@redhat.com>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH v2] Block migration fail, ignore error from bdrv_getlength
2010-07-10 15:59 [Qemu-devel] [PATCH v2] Block migration fail, ignore error from bdrv_getlength Shahar Havivi
@ 2010-07-12 8:09 ` Kevin Wolf
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Wolf @ 2010-07-12 8:09 UTC (permalink / raw
To: Shahar Havivi; +Cc: qemu-devel
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 <shaharh@redhat.com>
> ---
> 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-07-12 8:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-10 15:59 [Qemu-devel] [PATCH v2] Block migration fail, ignore error from bdrv_getlength Shahar Havivi
2010-07-12 8:09 ` Kevin Wolf
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.