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

login
register
mail settings
Submitter Markus Armbruster
Date July 1, 2010, 7:30 a.m.
Message ID <1277969441-22879-11-git-send-email-armbru@redhat.com>
Download mbox | patch
Permalink /patch/57487/
State New
Headers show

Comments

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

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,