aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2016-05-17 16:41:26 +0200
committerKevin Wolf <kwolf@redhat.com>2016-05-25 19:04:10 +0200
commit506f8709ceddd26542824d8cb9eac80201d085f1 (patch)
treea7492a94f2de08e04f081d429c9da1b4e31e13d2 /block.c
parent88be7b4be4aa17c88247e162bdd7577ea79db94f (diff)
block: Drop useless bdrv_new() call
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>
Diffstat (limited to 'block.c')
-rw-r--r--block.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/block.c b/block.c
index d287771659..f85c5a2c9b 100644
--- a/block.c
+++ b/block.c
@@ -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;