From 66f82ceed6781261c09e65fb440ca76842fd0500 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Wed, 14 Apr 2010 14:17:38 +0200 Subject: block: Open the underlying image file in generic code Format drivers shouldn't need to bother with things like file names, but rather just get an open BlockDriverState for the underlying protocol. This patch introduces this behaviour for bdrv_open implementation. For protocols which need to access the filename to open their file/device/connection/... a new callback bdrv_file_open is introduced which doesn't get an underlying file opened. For now, also some of the more obscure formats use bdrv_file_open because they open() the file themselves instead of using the block.c functions. They need to be fixed in later patches. Signed-off-by: Kevin Wolf --- block/nbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'block/nbd.c') diff --git a/block/nbd.c b/block/nbd.c index 7bac38d..a1ec123 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -177,7 +177,7 @@ static int64_t nbd_getlength(BlockDriverState *bs) static BlockDriver bdrv_nbd = { .format_name = "nbd", .instance_size = sizeof(BDRVNBDState), - .bdrv_open = nbd_open, + .bdrv_file_open = nbd_open, .bdrv_read = nbd_read, .bdrv_write = nbd_write, .bdrv_close = nbd_close, -- cgit v1.1