[Sheepdog] Direct read and write from VDIs

Chris Webb chris at arachsys.com
Wed Aug 3 15:01:15 CEST 2011


Another operation I could do with exposing to end users from the new
Sheepdog branch of our platform is drive read and write. From our existing
drives, we provide API calls to

  - read N bytes (or the remainder of the drive) starting at offset M
  - write bytes starting at offset M

as well as being able to attach drives to qemu virtual machines.

I don't think there's a qemu-img or collie operation to read data to stdout
or write data from stdin. Would it be reasonable to teach collie to do a vdi
read/write for this?

More generally, there are only a couple of operations which must be done via
qemu-img: snapshot, resize and create. Everything else is doable through
collie, i.e. without any dependency on qemu. I wonder whether for
completeness, and to make the sheepdog distribution fully stand-alone,
collie ought to gain these three operations? This might just be a matter of
lifting the relevant code from qemu/block/sheepdog.c and reformatting for
the sheepdog code conventions?

Apart from the aesthetic benefit of the sheepdog distribution being
meaningfully self-contained, this would presumably make a 'make test' target
for the sheepdog source tree easier to implement, and would also provide a
good foundation for a extracting a libsheepdog client library from collie
later on---paving the way for easy integration of sheepdog against other
virtualisation systems like kvm-tools.

Cheers,

Chris.



More information about the sheepdog mailing list