Skip to content

Commit

Permalink
block: Drop useless bdrv_new() call
Browse files Browse the repository at this point in the history
bdrv_append_temp_snapshot() uses bdrv_new() to create an empty BDS
before invoking bdrv_open() on that BDS. This is probably a relict from
when it used to do some modifications on that empty BDS, but now that is
unnecessary, so we can just set bs_snapshot to NULL and let bdrv_open()
do the rest.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
  • Loading branch information
XanClic authored and kevmw committed May 25, 2016
1 parent 88be7b4 commit 506f870
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions block.c
Original file line number Diff line number Diff line change
Expand Up @@ -1470,8 +1470,7 @@ static int bdrv_append_temp_snapshot(BlockDriverState *bs, int flags,
qdict_put(snapshot_options, "driver",
qstring_from_str("qcow2"));

bs_snapshot = bdrv_new();

bs_snapshot = NULL;
ret = bdrv_open(&bs_snapshot, NULL, NULL, snapshot_options,
flags, &local_err);
snapshot_options = NULL;
Expand Down

0 comments on commit 506f870

Please sign in to comment.