qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] writing a QEMU block driver
@ 2014-10-17 14:59 Sandeep Joshi
  2014-10-20  7:50 ` Max Reitz
  0 siblings, 1 reply; 5+ messages in thread
From: Sandeep Joshi @ 2014-10-17 14:59 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1437 bytes --]

Hi there,

Do let me know if I am asking these questions on the wrong forum.  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 <http://bugnik.us/kvm2013> and also
browsed the source code for sheepdog, nbd and gluster in the "block"
directory and had a few questions to confirm or correct my understanding.

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) ?  In
other words, can I only set the "protocol_name" and not "format_name" in
BlockDriver ?  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
-Sandeep

[-- Attachment #2: Type: text/html, Size: 1817 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-10-22  7:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-17 14:59 [Qemu-devel] writing a QEMU block driver Sandeep Joshi
2014-10-20  7:50 ` Max Reitz
2014-10-21  7:30   ` Sandeep Joshi
2014-10-22  3:08     ` Sandeep Joshi
2014-10-22  7:12       ` Max Reitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).