aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2010-07-01 09:30:38 +0200
committerKevin Wolf <kwolf@redhat.com>2010-07-02 13:18:02 +0200
commit3ac906f771c42363dc05e0a393defd21a57d3790 (patch)
tree16ba492fb5c6340b1c10c19c88dc8c7862991764 /block.c
parentf9092b108f7b35e463e58bd3dd348ff002ba9e63 (diff)
block: Clean up bdrv_snapshots()
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r--block.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/block.c b/block.c
index feda755294..003d13213e 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,