qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH trivial] block.c: Correct the return value and the failure object when failure occurs
@ 2014-06-21 14:59 Chen Gang
  2014-06-23  7:38 ` Stefan Hajnoczi
  0 siblings, 1 reply; 3+ 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] 3+ messages in thread

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

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).