[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 4/7] block/vpc: Improve vpc_open (optimisation a
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH 4/7] block/vpc: Improve vpc_open (optimisation and error handling) |
Date: |
Tue, 05 Feb 2013 11:44:58 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0 |
Am 01.02.2013 22:51, schrieb Stefan Weil:
> * Always read the footer at the end of the image.
> The footer exists for all kinds of VHD images, so there is no need
> to read its copy at the start of dynamic VHD images.
>
> * Return error codes from bdrv_pread like in other block drivers.
>
> * Return -EMEDIUMTYPE for wrong medium (missing signature).
>
> * It's not necessary to return 0 on success, >= 0 is sufficient.
>
> Signed-off-by: Stefan Weil <address@hidden>
> ---
> block/vpc.c | 46 ++++++++++++++++++++++------------------------
> 1 file changed, 22 insertions(+), 24 deletions(-)
> @@ -271,9 +270,8 @@ static int vpc_open(BlockDriverState *bs, int flags)
> "vpc", bs->device_name, "live migration");
> migrate_add_blocker(s->migration_blocker);
>
> - return 0;
> fail:
> - return err;
> + return ret;
> }
I'd rather leave the return 0; there, it's more obvious than reusing a
return value from "somewhere", of which we just happen know that it
contains a non-negative number if we did the previous error handling right.
Kevin
- [Qemu-devel] block/vpc: Code cleanup and bug fix, Stefan Weil, 2013/02/01
- [Qemu-devel] [PATCH 4/7] block/vpc: Improve vpc_open (optimisation and error handling), Stefan Weil, 2013/02/01
- [Qemu-devel] [PATCH 7/7] block/vpc: Use macros for magic constants, Stefan Weil, 2013/02/01
- [Qemu-devel] [PATCH 2/7] block/vpc: Add link to available VHD documentation, Stefan Weil, 2013/02/01
- [Qemu-devel] [PATCH 1/7] block/vpc: Fix most coding style warnings and errors, Stefan Weil, 2013/02/01
- [Qemu-devel] [PATCH 5/7] block/vpc: Fix size calculation, Stefan Weil, 2013/02/01