]> git.proxmox.com Git - mirror_qemu.git/commit - vl.c
qemu-config: Add new -add-fd command line option
authorCorey Bryant <coreyb@linux.vnet.ibm.com>
Thu, 18 Oct 2012 19:19:34 +0000 (15:19 -0400)
committerKevin Wolf <kwolf@redhat.com>
Wed, 24 Oct 2012 08:26:19 +0000 (10:26 +0200)
commit587ed6be0b6331b11169da8846b8442840d5428c
treeba82b977f169e27edbab2539ab179d63d7c1b146
parentebe52b592dd5867fce7238f49b8c0416c3eedb6c
qemu-config: Add new -add-fd command line option

This option can be used for passing file descriptors on the
command line.  It mirrors the existing add-fd QMP command which
allows an fd to be passed to QEMU via SCM_RIGHTS and added to an
fd set.

This can be combined with commands such as -drive to link file
descriptors in an fd set to a drive:

    qemu-kvm -add-fd fd=3,set=2,opaque="rdwr:/path/to/file"
             -add-fd fd=4,set=2,opaque="rdonly:/path/to/file"
             -drive file=/dev/fdset/2,index=0,media=disk

This example adds dups of fds 3 and 4, and the accompanying opaque
strings to the fd set with ID=2.  qemu_open() already knows how
to handle a filename of this format.  qemu_open() searches the
corresponding fd set for an fd and when it finds a match, QEMU
goes on to use a dup of that fd just like it would have used an
fd that it opened itself.

Signed-off-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qemu-config.c
qemu-options.hx
vl.c