All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-trivial] [PATCH trivial] block.c: Correct the return value and the failure object when failure occurs
@ 2014-06-21 14:59 ` Chen Gang
  0 siblings, 0 replies; 6+ messages in thread
From: Chen Gang @ 2014-06-21 14:59 UTC (permalink / raw)
  To: kwolf, stefanha, Michael Tokarev; +Cc: qemu-trivial, qemu-devel

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 <gang.chen.5i5j@gmail.com>
---
 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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-06-23 15:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-21 14:59 [Qemu-trivial] [PATCH trivial] block.c: Correct the return value and the failure object when failure occurs Chen Gang
2014-06-21 14:59 ` [Qemu-devel] " Chen Gang
2014-06-23  7:38 ` [Qemu-trivial] " Stefan Hajnoczi
2014-06-23  7:38   ` Stefan Hajnoczi
2014-06-23 15:08   ` [Qemu-trivial] " Chen Gang
2014-06-23 15:08     ` Chen Gang

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.