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 <[email protected]> > --- > 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
