Am 04.06.2012 15:10, schrieb Corey Bryant:
This sample server opens image files and passes the fds to QEMU. The
paths for two image files are passed as parameters, the first being
the boot image, and the second being an image to be hot-attached. The
server will open the files and pass the fds to QEMU in one of two ways:
1) Over the command line (using -drive file=/dev/fd/X) or
2) Via the QMP monitor with the getfd command (using SCM_RIGHTS)
followed by drive_add (using file=/dev/fd/X) and then
device_add.
Usage:
gcc -Wall -o test-fd-passing test-fd-passing.c -L/usr/local/lib -ljson
./test-fd-passing /path/hda.img /path/hdb.img
Note: This requires json-c and json-c-devel packages.
Signed-off-by: Corey Bryant<address@hidden>
---
test-fd-passing.c | 321 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 321 insertions(+)
create mode 100644 test-fd-passing.c
Is this meant to be applied or just for reference?