docs: show how to spawn qemu-storage-daemon with fd passing
commit3f14b909ebe7296eef6d4b1a1ed5f602ab129602
authorStefan Hajnoczi <stefanha@redhat.com>
Mon, 1 Mar 2021 17:27:27 +0000 (1 17:27 +0000)
committerKevin Wolf <kwolf@redhat.com>
Mon, 8 Mar 2021 13:55:19 +0000 (8 14:55 +0100)
treefce96b20cbb87121b00b8d7270b04d37d432ddcf
parent03d2b412aaf2078425f8472f31c8a9c2340969eb
docs: show how to spawn qemu-storage-daemon with fd passing

The QMP monitor, NBD server, and vhost-user-blk export all support file
descriptor passing. This is a useful technique because it allows the
parent process to spawn and wait for qemu-storage-daemon without busy
waiting, which may delay startup due to arbitrary sleep() calls.

This Python example is inspired by the test case written for libnbd by
Richard W.M. Jones <rjones@redhat.com>:
https://gitlab.com/nbdkit/libnbd/-/commit/89113f484effb0e6c322314ba75c1cbe07a04543

Thanks to Daniel P. BerrangĂ© <berrange@redhat.com> for suggestions on
how to get this working. Now let's document it!

Reported-by: Richard W.M. Jones <rjones@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20210301172728.135331-2-stefanha@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
docs/tools/qemu-storage-daemon.rst