block.c: Don't return success for bdrv_append_temp_snapshot() failure
commit6b8aeca574a15668c47296d8e0c4f96c72e63c36
authorChen Gang <gang.chen.5i5j@gmail.com>
Mon, 23 Jun 2014 15:28:23 +0000 (23 23:28 +0800)
committerKevin Wolf <kwolf@redhat.com>
Fri, 27 Jun 2014 18:00:00 +0000 (27 20:00 +0200)
tree276eb681dd5e5649ea49a37f35ad6116d6bfd1ad
parentd88964aeda6cfc44585fe35c97c37537235c0a96
block.c: Don't return success for bdrv_append_temp_snapshot() failure

When failure occurs, 'ret' need be set, or may return 0 to indicate
success. Previously, an error was set in errp, but 0 was returned
anyway. So let bdrv_append_temp_snapshot() return an error code and
use that for the bdrv_open() return value.

Also, error_propagate() need be called only one time within a function.

Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c
include/block/block.h