diff --git a/block.c b/block.c index feda755294ee8dd0b99f8ac06900a21721fd2978..003d13213e0fa716658bd30c1f3fd7b6e5d7a59c 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,