spice: add chardev (v5)

Adding a chardev backend for spice, where spice determines what
to do with it based on the name attribute given during chardev creation.
For usage by spice vdagent in conjunction with a properly named
virtio-serial device, and future smartcard channel usage.

Example usage:
 qemu -device virtio-serial -chardev spicevmc,name=vdagent,id=vdagent \
 -device virtserialport,chardev=vdagent,name=com.redhat.spice.0

v4->v5:
 * add tracing events
 * fix missing comma
 * fix help string to show debug is optional

v3->v4:
 * updated commit message

v1->v3 changes: (v2 had a wrong commit message)
 * removed spice-qemu-char.h, folded into ui/qemu-spice.h
 * removed dead IOCTL code
 * removed comment
 * removed ifdef CONFIG_SPICE from qemu-config.c and qemu-options.hx help.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Alon Levy 2011-01-19 10:49:50 +02:00 committed by Gerd Hoffmann
parent 710fc4f5f1
commit cbcc6336ce
7 changed files with 225 additions and 2 deletions

View file

@ -97,6 +97,7 @@
#endif
#include "qemu_socket.h"
#include "ui/qemu-spice.h"
#define READ_BUF_LEN 4096
@ -2495,6 +2496,9 @@ static const struct {
|| defined(__FreeBSD_kernel__)
{ .name = "parport", .open = qemu_chr_open_pp },
#endif
#ifdef CONFIG_SPICE
{ .name = "spicevmc", .open = qemu_chr_open_spice },
#endif
};
CharDriverState *qemu_chr_open_opts(QemuOpts *opts,