[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 02/31] block: Drop useless bdrv_new() call
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 02/31] block: Drop useless bdrv_new() call |
Date: |
Wed, 25 May 2016 19:39:27 +0200 |
From: Max Reitz <address@hidden>
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 <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/block.c b/block.c
index d287771..f85c5a2 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;
--
1.8.3.1
- [Qemu-devel] [PULL 20/31] block: Add bdrv_has_blk(), (continued)
- [Qemu-devel] [PULL 20/31] block: Add bdrv_has_blk(), Kevin Wolf, 2016/05/19
- [Qemu-devel] [PULL 22/31] block: Don't return throttling info in query-named-block-nodes, Kevin Wolf, 2016/05/19
- [Qemu-devel] [PULL 24/31] block: Propagate AioContext change to all children, Kevin Wolf, 2016/05/19
- [Qemu-devel] [PULL 30/31] qemu-iotests: Simplify 109 with unaligned qemu-img compare, Kevin Wolf, 2016/05/19
- [Qemu-devel] [PULL 27/31] qemu-iotests: Some more write_zeroes tests, Kevin Wolf, 2016/05/19
- [Qemu-devel] [PULL 23/31] block: Remove BlockDriverState.blk, Kevin Wolf, 2016/05/19
- [Qemu-devel] [PULL 31/31] qemu-iotests: Fix regression in 136 on aio_read invalid, Kevin Wolf, 2016/05/19
- [Qemu-devel] [PULL 29/31] qemu-io: Fix recent UI updates, Kevin Wolf, 2016/05/19
- Re: [Qemu-devel] [PULL 00/31] Block layer patches, Peter Maydell, 2016/05/19
- [Qemu-devel] [PULL 00/31] Block layer patches, Kevin Wolf, 2016/05/25
- [Qemu-devel] [PULL 02/31] block: Drop useless bdrv_new() call,
Kevin Wolf <=
- [Qemu-devel] [PULL 01/31] block: Fix bdrv_next() memory leak, Kevin Wolf, 2016/05/25
- [Qemu-devel] [PULL 03/31] block: Let bdrv_open_inherit() return the snapshot, Kevin Wolf, 2016/05/25
- [Qemu-devel] [PULL 06/31] block: Drop bdrv_new_root(), Kevin Wolf, 2016/05/25
- [Qemu-devel] [PULL 08/31] block: Assert !bs->refcnt in bdrv_close(), Kevin Wolf, 2016/05/25
- [Qemu-devel] [PULL 05/31] block: Drop blk_new_with_bs(), Kevin Wolf, 2016/05/25
- [Qemu-devel] [PULL 09/31] block: Drop bdrv_parent_cb_...() from bdrv_close(), Kevin Wolf, 2016/05/25
- [Qemu-devel] [PULL 04/31] tests: Drop BDS from test-throttle.c, Kevin Wolf, 2016/05/25
- [Qemu-devel] [PULL 10/31] block: Drop errp parameter from blk_new(), Kevin Wolf, 2016/05/25
- [Qemu-devel] [PULL 13/31] block: Fix reconfiguring graph with drained nodes, Kevin Wolf, 2016/05/25
- [Qemu-devel] [PULL 11/31] block: Introduce bdrv_replace_child(), Kevin Wolf, 2016/05/25