Patchwork [17/23] block: Clean up bdrv_snapshots()

login
register
mail settings
Submitter Kevin Wolf
Date July 2, 2010, 4:38 p.m.
Message ID <1278088712-12302-18-git-send-email-kwolf@redhat.com>
Download mbox | patch
Permalink /patch/57689/
State New
Headers show

Comments

Kevin Wolf - July 2, 2010, 4:38 p.m.
From: Markus Armbruster <armbru@redhat.com>

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

Patch

diff --git a/block.c b/block.c
index feda755..003d132 100644
--- a/block.c
+++ b/block.c
@@ -1789,19 +1789,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,