Hi,
I'd like to write a QEMU block
driver which forwards IO requests to a custom-built storage cluster.
I have seen
Jeff Cody's presentation
and also browsed the source code for sheepdog, nbd and gluster in the
"block" directory and had a few questions.
1) What is the difference between bdrv_open and bdrv_file_open function pointers in the BlockDriver ?
2)
Is it possible to implement only a protocol driver without a format
driver (the distinction that Jeff made in his presentation above) ? Do they work together or does one have to implement both for a particular file format and storage destination? I'd like to support all image formats (qemu, raw, etc)
without having to reimplement the logic for each.
3) The control flow for creating a file starts with the image format driver and later invokes the protocol driver.
image_driver->bdrv_create()
--> bdrv_create_file
--> bdrv_find_protocol(filename)
--> bdrv_create
---> Protocol_driver->bdrv_create()
Is
this the case for all functions? Does the read/write first flow
through the image format driver before getting passed down to the
protocol driver (possibly via some coroutine invoked from the block
layer or virtio-blk ) ? Can someone give me a hint as to how I can
trace the control flow ?
thx