[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 02/14] block: Add blk_new_open()
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH 02/14] block: Add blk_new_open() |
Date: |
Thu, 18 Dec 2014 16:19:52 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Am 11.12.2014 um 14:20 hat Max Reitz geschrieben:
> blk_new_with_bs() creates a BlockBackend with an empty BlockDriverState
> attached to it. Empty BDSs are not nice, therefore add an alternative
> function which combines blk_new_with_bs() with bdrv_open().
>
> Note: In contrast to bdrv_open() which takes a BlockDriver parameter,
> blk_new_open() does not take such a parameter. This is because
> bdrv_open() opens a BlockDriverState, therefore it is naturally to be
> able to set the BlockDriver for that BDS. The fact that bdrv_open() can
> open more than a single BDS is merely some form of a byproduct.
>
> blk_new_open() on the other hand is intended to be used to create a
> whole tree of BlockDriverStates. Therefore, setting a single BlockDriver
> does not make much sense. Instead, the drivers to be used for each of
> the nodes must be configured through the "options" QDict; including the
> driver of the root BDS.
This is an interesting point. I generally agree with your reasoning, but
if we did things right, the same would apply to filename and flags as
well. But we don't, so we can't remove them now.
I'm actually surprised that leaving out the driver option seem to work
well enough.
Should at least a TODO be left here for removing filename and flags?
Kevin
- [Qemu-devel] [PATCH 00/14] block: Remove "growable", add blk_new_open(), Max Reitz, 2014/12/11
- [Qemu-devel] [PATCH 02/14] block: Add blk_new_open(), Max Reitz, 2014/12/11
- Re: [Qemu-devel] [PATCH 02/14] block: Add blk_new_open(),
Kevin Wolf <=
- [Qemu-devel] [PATCH 04/14] block/xen: Use blk_new_open() in blk_connect(), Max Reitz, 2014/12/11
- [Qemu-devel] [PATCH 05/14] qemu-img: Use blk_new_open() in img_open(), Max Reitz, 2014/12/11
- [Qemu-devel] [PATCH 06/14] qemu-img: Use blk_new_open() in img_rebase(), Max Reitz, 2014/12/11
- [Qemu-devel] [PATCH 07/14] qemu-img: Use BlockBackend as far as possible, Max Reitz, 2014/12/11
- [Qemu-devel] [PATCH 10/14] qemu-io: Remove "growable" option, Max Reitz, 2014/12/11
- [Qemu-devel] [PATCH 08/14] qemu-nbd: Use blk_new_open() in main(), Max Reitz, 2014/12/11
- [Qemu-devel] [PATCH 11/14] qemu-io: Use BlockBackend, Max Reitz, 2014/12/11
- [Qemu-devel] [PATCH 13/14] block: Remove "growable" from BDS, Max Reitz, 2014/12/11
- [Qemu-devel] [PATCH 14/14] block: Keep bdrv_check*_request()'s return value, Max Reitz, 2014/12/11