[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH trivial] block.c: Correct the return value and the f
From: |
Chen Gang |
Subject: |
[Qemu-devel] [PATCH trivial] block.c: Correct the return value and the failure object when failure occurs |
Date: |
Sat, 21 Jun 2014 22:59:29 +0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 |
When failure occurs, 'ret' need be set, or may return 0 to indicate success.
And error_propagate() also need be called only one time within a function.
Signed-off-by: Chen Gang <address@hidden>
---
block.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block.c b/block.c
index 74af8d7..12ce4e4 100644
--- a/block.c
+++ b/block.c
@@ -1497,7 +1497,7 @@ int bdrv_open(BlockDriverState **pbs, const char
*filename,
if (snapshot_flags) {
bdrv_append_temp_snapshot(bs, snapshot_flags, &local_err);
if (local_err) {
- error_propagate(errp, local_err);
+ ret = -1;
goto close_and_fail;
}
}
--
1.7.11.7
- [Qemu-devel] [PATCH trivial] block.c: Correct the return value and the failure object when failure occurs,
Chen Gang <=