introduce spice-qemu-char chardev
cover introduce spice-qemu-char chardev
Adding a chardev backend for spice, for usage by spice vdagent over a with virtio-serial device.
Alon Levy (1):
spice: add chardev
Makefile.objs | 2 +- qemu-char.c | 7 ++ qemu-config.c | 9 ++ qemu-options.hx | 18 ++++- spice-qemu-char.c | 222 +++++++++++++++++++++++++++++++++++++++++++++++++++++ spice-qemu-char.h | 9 ++ 6 files changed, 265 insertions(+), 2 deletions(-) create mode 100644 spice-qemu-char.c create mode 100644 spice-qemu-char.h
Signature · 1 line
1.7.3.2
PATCH 1/1 spice: add chardev
--- Makefile.objs | 2 +- qemu-char.c | 7 ++ qemu-config.c | 9 ++ qemu-options.hx | 18 ++++- spice-qemu-char.c | 222 +++++++++++++++++++++++++++++++++++++++++++++++++++++ spice-qemu-char.h | 9 ++ 6 files changed, 265 insertions(+), 2 deletions(-) create mode 100644 spice-qemu-char.c create mode 100644 spice-qemu-char.h
Makefile.objs +1 -1
@@ -102,7 +102,7 @@ common-obj-$(CONFIG_BRLAPI) += baum.o common-obj-$(CONFIG_POSIX) += migration-exec.o migration-unix.o migration-fd.o common-obj-$(CONFIG_WIN32) += version.o -common-obj-$(CONFIG_SPICE) += ui/spice-core.o ui/spice-input.o ui/spice-display.o +common-obj-$(CONFIG_SPICE) += ui/spice-core.o ui/spice-input.o ui/spice-display.o spice-qemu-char.o audio-obj-y = audio.o noaudio.o wavaudio.o mixeng.o audio-obj-$(CONFIG_SDL) += sdlaudio.o
qemu-char.c +7 -0
@@ -98,6 +98,10 @@#include "qemu_socket.h" +#ifdef CONFIG_SPICE +#include "spice-qemu-char.h" +#endif +#define READ_BUF_LEN 4096/***********************************************************/
@@ -2431,6 +2435,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,
qemu-config.c +9 -0
@@ -147,6 +147,15 @@ static QemuOptsList qemu_chardev_opts = { .name = "signal", .type = QEMU_OPT_BOOL, }, +#ifdef CONFIG_SPICE + { + .name = "name", + .type = QEMU_OPT_STRING, + },{ + .name = "debug", + .type = QEMU_OPT_NUMBER, + }, +#endif {/* end of list */ } }, };
qemu-options.hx +17 -1
@@ -1357,6 +1357,9 @@ DEF("chardev", HAS_ARG, QEMU_OPTION_chardev, #if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__) "-chardev parport,id=id,path=path[,mux=on|off]\n" #endif +#if defined(CONFIG_SPICE) + "-chardev spicevmc,id=id,debug=debug,name=name\n" +#endif , QEMU_ARCH_ALL )
@@ -1381,7 +1384,10 @@ Backend is one of: @option{stdio}, @option{braille}, @option{tty}, -@option{parport}. +@option{parport} +#if defined(CONFIG_SPICE) +@option{spicevmc}. +#endif The specific backend will determine the applicable options. All devices must have an id, which can be any string up to 127 characters long.
@@ -1557,6 +1563,16 @@ Connect to a local parallel port. @option{path} specifies the path to the parallel port device. @option{path} is required. +#if defined(CONFIG_SPICE) +@item -chardev spicevmc ,id=@var{id} ,debug=@var{debug}, name=@var{name} + +@option{debug} debug level for spicevmc + +@option{name} name of spice channel to connect to + +Connect to a spice virtual machine channel, such as vdiport. +#endif + @end table ETEXI
spice-qemu-char.c new file +222 -0
222 lines not on this page · raw message
spice-qemu-char.h new file +9 -0
@@ -0,0 +1,9 @@ +#ifndef __SPICE_QEMU_CHAR_H__ +#define __SPICE_QEMU_CHAR_H__ + +#include "qemu-char.h" + +CharDriverState *qemu_chr_open_spice (QemuOpts *opts); + +#endif // __SPICE_QEMU_CHAR_H__ +
Signature · 1 line
1.7.3.2
Quoted 2 lines · Alon Levy
Adding a chardev backend for spice, for usage by spice vdagent over a with virtio-serial device.
Please put this into PATCH 1/1, so it gets committed. Thanks.