[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 1/9] block: Drop useless bdrv_new() call
From: |
Max Reitz |
Subject: |
[Qemu-devel] [PATCH v4 1/9] block: Drop useless bdrv_new() call |
Date: |
Tue, 17 May 2016 16:41:26 +0200 |
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>
---
block.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/block.c b/block.c
index cbc10f7..d2ecf93 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;
--
2.8.2
- [Qemu-devel] [PATCH v4 0/9] blockdev: (Nearly) free clean-up work, Max Reitz, 2016/05/17
- [Qemu-devel] [PATCH v4 1/9] block: Drop useless bdrv_new() call,
Max Reitz <=
- [Qemu-devel] [PATCH v4 4/9] block: Drop blk_new_with_bs(), Max Reitz, 2016/05/17
- [Qemu-devel] [PATCH v4 2/9] block: Let bdrv_open_inherit() return the snapshot, Max Reitz, 2016/05/17
- [Qemu-devel] [PATCH v4 3/9] tests: Drop BDS from test-throttle.c, Max Reitz, 2016/05/17
- [Qemu-devel] [PATCH v4 5/9] block: Drop bdrv_new_root(), Max Reitz, 2016/05/17
- [Qemu-devel] [PATCH v4 9/9] block: Drop errp parameter from blk_new(), Max Reitz, 2016/05/17
- [Qemu-devel] [PATCH v4 6/9] block: Make bdrv_open() return a BDS, Max Reitz, 2016/05/17
- [Qemu-devel] [PATCH v4 7/9] block: Assert !bs->refcnt in bdrv_close(), Max Reitz, 2016/05/17
- [Qemu-devel] [PATCH v4 8/9] block: Drop bdrv_parent_cb_...() from bdrv_close(), Max Reitz, 2016/05/17
- Re: [Qemu-devel] [PATCH v4 0/9] blockdev: (Nearly) free clean-up work, Kevin Wolf, 2016/05/23