Il 31/10/2012 12:23, Christoph Hellwig ha scritto: > On Mon, Oct 01, 2012 at 04:52:23PM +0200, Paolo Bonzini wrote: >> Adding an NBD server inside QEMU is trivial, since all the logic is >> in nbd.c and can be shared easily between qemu-nbd and QEMU itself. >> The main difference is that qemu-nbd serves a single unnamed export, >> while QEMU serves named exports. > > I've started playing around with qemu-nbd and have started looking into > named exports, aio, and adding snapshort support. I'm wondering if instead > of adding this I should try to base it on your embedded server.
qemu-nbd does support AIO in the latest versions. There's also --cache=MODE and --aio=MODE command-line options. In fact, a large part of the code is shared between qemu-nbd and the embedded server. The only difference is that qemu-nbd uses unnamed exports, while qemu names them. qemu-nbd also has options to show only one partition, which you probably do not need. But if you need a QMP interface, adding it to qemu-nbd would really be a bad idea. :) > That would give me the named exports, aio and monitor/qmp based > snapshot creation. > > The only thing to add would be a qemu mode where it doesn't run an > actual guest. You can use qtest mode to get very close to this (even if you send stop/cont by mistake on the monitor, no code will actually run): qemu-system-x86_64 -chardev file,id=null,path=/dev/null -qtest null -machine accel=qtest -m 1 -nodefaults -nographic but having a separate do-nothing target would probably be nicer... though Anthony may have different opinions. Paolo > Does anyone have opinions on this?