Benoît Canet <benoit.ca...@nodalink.com> writes: > On Sat, Sep 13, 2014 at 05:00:05PM +0200, Markus Armbruster wrote: >> Creating an anonymous BDS can't fail. Make that obvious. >> >> Signed-off-by: Markus Armbruster <arm...@redhat.com> >> --- >> block.c | 28 +++++++++++++++++++--------- >> block/iscsi.c | 2 +- >> block/vvfat.c | 2 +- >> blockdev.c | 2 +- >> hw/block/xen_disk.c | 2 +- >> include/block/block.h | 3 ++- >> qemu-img.c | 6 +++--- >> qemu-io.c | 2 +- >> qemu-nbd.c | 2 +- >> 9 files changed, 30 insertions(+), 19 deletions(-) >> >> diff --git a/block.c b/block.c >> index 02ea90f..4fe3b62 100644 >> --- a/block.c >> +++ b/block.c >> @@ -336,10 +336,11 @@ void bdrv_register(BlockDriver *bdrv) >> } >> > >> /* create a new block device (by default it is empty) */ > I wonder if this comment is stale. > What is the emptiness of a block device anyway ?
No medium. To make an empty BDS non-empty, bdrv_open() an image. To make it empty again, bdrv_close() it. The comment still applies. In the BB world, there's no such thing as an empty BDS. A BB without medium simply has no BDS. This series doesn't get us there, it's just a first step. When we get there, bdrv_new() will be folded into bdrv_open(), and bdrv_close() into bdrv_delete(). [...] > Reviewed-by: Benoît Canet <benoit.ca...@nodalink.com> Thanks!