[v3,10/13] block: Clean up bdrv_snapshots()

Submitted by Markus Armbruster on July 1, 2010, 7:30 a.m.

Details

Message ID 1277969441-22879-11-git-send-email-armbru@redhat.com
State New
Headers show

Commit Message

Markus Armbruster July 1, 2010, 7:30 a.m.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 block.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

Patch hide | download patch | download mbox

diff --git a/block.c b/block.c
index acb4182..603874d 100644
--- a/block.c
+++ b/block.c
@@ -1783,19 +1783,18 @@  BlockDriverState *bdrv_snapshots(void)
 {
     BlockDriverState *bs;
 
-    if (bs_snapshots)
+    if (bs_snapshots) {
         return bs_snapshots;
+    }
 
     bs = NULL;
     while ((bs = bdrv_next(bs))) {
         if (bdrv_can_snapshot(bs)) {
-            goto ok;
+            bs_snapshots = bs;
+            return bs;
         }
     }
     return NULL;
- ok:
-    bs_snapshots = bs;
-    return bs;
 }
 
 int bdrv_snapshot_create(BlockDriverState *bs,