Alon Levy | cbcc633 | 2011-01-19 10:49:50 +0200 | [diff] [blame] | 1 | #include "config-host.h" |
| 2 | #include "trace.h" |
| 3 | #include "ui/qemu-spice.h" |
Paolo Bonzini | dccfcd0 | 2013-04-08 16:55:25 +0200 | [diff] [blame] | 4 | #include "sysemu/char.h" |
Alon Levy | cbcc633 | 2011-01-19 10:49:50 +0200 | [diff] [blame] | 5 | #include <spice.h> |
| 6 | #include <spice-experimental.h> |
Marc-André Lureau | 5a49d3e | 2012-12-05 16:15:34 +0100 | [diff] [blame] | 7 | #include <spice/protocol.h> |
Alon Levy | cbcc633 | 2011-01-19 10:49:50 +0200 | [diff] [blame] | 8 | |
Paolo Bonzini | 1de7afc | 2012-12-17 18:20:00 +0100 | [diff] [blame] | 9 | #include "qemu/osdep.h" |
Alon Levy | cbcc633 | 2011-01-19 10:49:50 +0200 | [diff] [blame] | 10 | |
Alon Levy | cbcc633 | 2011-01-19 10:49:50 +0200 | [diff] [blame] | 11 | typedef struct SpiceCharDriver { |
| 12 | CharDriverState* chr; |
| 13 | SpiceCharDeviceInstance sin; |
| 14 | char *subtype; |
| 15 | bool active; |
Hans de Goede | ae893e5 | 2013-04-05 11:30:22 +0200 | [diff] [blame] | 16 | bool blocked; |
Alon Levy | b010cec | 2013-04-05 11:30:23 +0200 | [diff] [blame] | 17 | const uint8_t *datapos; |
| 18 | int datalen; |
Marc-André Lureau | 7a5448c | 2012-12-05 16:15:35 +0100 | [diff] [blame] | 19 | QLIST_ENTRY(SpiceCharDriver) next; |
Alon Levy | cbcc633 | 2011-01-19 10:49:50 +0200 | [diff] [blame] | 20 | } SpiceCharDriver; |
| 21 | |
Hans de Goede | ae893e5 | 2013-04-05 11:30:22 +0200 | [diff] [blame] | 22 | typedef struct SpiceCharSource { |
| 23 | GSource source; |
| 24 | SpiceCharDriver *scd; |
| 25 | } SpiceCharSource; |
| 26 | |
Marc-André Lureau | 7a5448c | 2012-12-05 16:15:35 +0100 | [diff] [blame] | 27 | static QLIST_HEAD(, SpiceCharDriver) spice_chars = |
| 28 | QLIST_HEAD_INITIALIZER(spice_chars); |
| 29 | |
Alon Levy | cbcc633 | 2011-01-19 10:49:50 +0200 | [diff] [blame] | 30 | static int vmc_write(SpiceCharDeviceInstance *sin, const uint8_t *buf, int len) |
| 31 | { |
| 32 | SpiceCharDriver *scd = container_of(sin, SpiceCharDriver, sin); |
| 33 | ssize_t out = 0; |
| 34 | ssize_t last_out; |
| 35 | uint8_t* p = (uint8_t*)buf; |
| 36 | |
| 37 | while (len > 0) { |
Hans de Goede | 75c439b | 2013-04-05 11:30:24 +0200 | [diff] [blame] | 38 | int can_write = qemu_chr_be_can_write(scd->chr); |
| 39 | last_out = MIN(len, can_write); |
Marc-André Lureau | 07a54d7 | 2012-12-05 16:15:32 +0100 | [diff] [blame] | 40 | if (last_out <= 0) { |
Alon Levy | cbcc633 | 2011-01-19 10:49:50 +0200 | [diff] [blame] | 41 | break; |
| 42 | } |
Anthony Liguori | fa5efcc | 2011-08-15 11:17:30 -0500 | [diff] [blame] | 43 | qemu_chr_be_write(scd->chr, p, last_out); |
Hans de Goede | 35106c2 | 2011-03-22 16:28:41 +0100 | [diff] [blame] | 44 | out += last_out; |
| 45 | len -= last_out; |
| 46 | p += last_out; |
Alon Levy | cbcc633 | 2011-01-19 10:49:50 +0200 | [diff] [blame] | 47 | } |
| 48 | |
Alon Levy | cbcc633 | 2011-01-19 10:49:50 +0200 | [diff] [blame] | 49 | trace_spice_vmc_write(out, len + out); |
| 50 | return out; |
| 51 | } |
| 52 | |
| 53 | static int vmc_read(SpiceCharDeviceInstance *sin, uint8_t *buf, int len) |
| 54 | { |
| 55 | SpiceCharDriver *scd = container_of(sin, SpiceCharDriver, sin); |
| 56 | int bytes = MIN(len, scd->datalen); |
| 57 | |
Alon Levy | cbcc633 | 2011-01-19 10:49:50 +0200 | [diff] [blame] | 58 | if (bytes > 0) { |
| 59 | memcpy(buf, scd->datapos, bytes); |
| 60 | scd->datapos += bytes; |
| 61 | scd->datalen -= bytes; |
| 62 | assert(scd->datalen >= 0); |
Hans de Goede | ae893e5 | 2013-04-05 11:30:22 +0200 | [diff] [blame] | 63 | } |
| 64 | if (scd->datalen == 0) { |
| 65 | scd->datapos = 0; |
| 66 | scd->blocked = false; |
Alon Levy | cbcc633 | 2011-01-19 10:49:50 +0200 | [diff] [blame] | 67 | } |
| 68 | trace_spice_vmc_read(bytes, len); |
| 69 | return bytes; |
| 70 | } |
| 71 | |
Marc-André Lureau | 5a49d3e | 2012-12-05 16:15:34 +0100 | [diff] [blame] | 72 | #if SPICE_SERVER_VERSION >= 0x000c02 |
| 73 | static void vmc_event(SpiceCharDeviceInstance *sin, uint8_t event) |
| 74 | { |
| 75 | SpiceCharDriver *scd = container_of(sin, SpiceCharDriver, sin); |
| 76 | int chr_event; |
| 77 | |
| 78 | switch (event) { |
| 79 | case SPICE_PORT_EVENT_BREAK: |
| 80 | chr_event = CHR_EVENT_BREAK; |
| 81 | break; |
| 82 | default: |
Marc-André Lureau | 5a49d3e | 2012-12-05 16:15:34 +0100 | [diff] [blame] | 83 | return; |
| 84 | } |
| 85 | |
Marc-André Lureau | 5a49d3e | 2012-12-05 16:15:34 +0100 | [diff] [blame] | 86 | trace_spice_vmc_event(chr_event); |
| 87 | qemu_chr_be_event(scd->chr, chr_event); |
| 88 | } |
| 89 | #endif |
| 90 | |
Hans de Goede | f76e4c7 | 2011-11-19 10:22:44 +0100 | [diff] [blame] | 91 | static void vmc_state(SpiceCharDeviceInstance *sin, int connected) |
| 92 | { |
| 93 | SpiceCharDriver *scd = container_of(sin, SpiceCharDriver, sin); |
| 94 | |
Hans de Goede | 16665b9 | 2013-03-26 11:07:53 +0100 | [diff] [blame] | 95 | if ((scd->chr->be_open && connected) || |
| 96 | (!scd->chr->be_open && !connected)) { |
Hans de Goede | f76e4c7 | 2011-11-19 10:22:44 +0100 | [diff] [blame] | 97 | return; |
| 98 | } |
| 99 | |
| 100 | qemu_chr_be_event(scd->chr, |
| 101 | connected ? CHR_EVENT_OPENED : CHR_EVENT_CLOSED); |
| 102 | } |
| 103 | |
Alon Levy | cbcc633 | 2011-01-19 10:49:50 +0200 | [diff] [blame] | 104 | static SpiceCharDeviceInterface vmc_interface = { |
| 105 | .base.type = SPICE_INTERFACE_CHAR_DEVICE, |
| 106 | .base.description = "spice virtual channel char device", |
| 107 | .base.major_version = SPICE_INTERFACE_CHAR_DEVICE_MAJOR, |
| 108 | .base.minor_version = SPICE_INTERFACE_CHAR_DEVICE_MINOR, |
Hans de Goede | f76e4c7 | 2011-11-19 10:22:44 +0100 | [diff] [blame] | 109 | .state = vmc_state, |
Alon Levy | cbcc633 | 2011-01-19 10:49:50 +0200 | [diff] [blame] | 110 | .write = vmc_write, |
| 111 | .read = vmc_read, |
Marc-André Lureau | 5a49d3e | 2012-12-05 16:15:34 +0100 | [diff] [blame] | 112 | #if SPICE_SERVER_VERSION >= 0x000c02 |
| 113 | .event = vmc_event, |
| 114 | #endif |
Alon Levy | cbcc633 | 2011-01-19 10:49:50 +0200 | [diff] [blame] | 115 | }; |
| 116 | |
| 117 | |
| 118 | static void vmc_register_interface(SpiceCharDriver *scd) |
| 119 | { |
| 120 | if (scd->active) { |
| 121 | return; |
| 122 | } |
Alon Levy | cbcc633 | 2011-01-19 10:49:50 +0200 | [diff] [blame] | 123 | scd->sin.base.sif = &vmc_interface.base; |
| 124 | qemu_spice_add_interface(&scd->sin.base); |
| 125 | scd->active = true; |
| 126 | trace_spice_vmc_register_interface(scd); |
| 127 | } |
| 128 | |
| 129 | static void vmc_unregister_interface(SpiceCharDriver *scd) |
| 130 | { |
| 131 | if (!scd->active) { |
| 132 | return; |
| 133 | } |
Alon Levy | cbcc633 | 2011-01-19 10:49:50 +0200 | [diff] [blame] | 134 | spice_server_remove_interface(&scd->sin.base); |
| 135 | scd->active = false; |
| 136 | trace_spice_vmc_unregister_interface(scd); |
| 137 | } |
| 138 | |
Hans de Goede | ae893e5 | 2013-04-05 11:30:22 +0200 | [diff] [blame] | 139 | static gboolean spice_char_source_prepare(GSource *source, gint *timeout) |
| 140 | { |
| 141 | SpiceCharSource *src = (SpiceCharSource *)source; |
| 142 | |
| 143 | *timeout = -1; |
| 144 | |
| 145 | return !src->scd->blocked; |
| 146 | } |
| 147 | |
| 148 | static gboolean spice_char_source_check(GSource *source) |
| 149 | { |
| 150 | SpiceCharSource *src = (SpiceCharSource *)source; |
| 151 | |
| 152 | return !src->scd->blocked; |
| 153 | } |
| 154 | |
| 155 | static gboolean spice_char_source_dispatch(GSource *source, |
| 156 | GSourceFunc callback, gpointer user_data) |
| 157 | { |
| 158 | GIOFunc func = (GIOFunc)callback; |
| 159 | |
| 160 | return func(NULL, G_IO_OUT, user_data); |
| 161 | } |
| 162 | |
| 163 | GSourceFuncs SpiceCharSourceFuncs = { |
| 164 | .prepare = spice_char_source_prepare, |
| 165 | .check = spice_char_source_check, |
| 166 | .dispatch = spice_char_source_dispatch, |
| 167 | }; |
| 168 | |
| 169 | static GSource *spice_chr_add_watch(CharDriverState *chr, GIOCondition cond) |
| 170 | { |
| 171 | SpiceCharDriver *scd = chr->opaque; |
| 172 | SpiceCharSource *src; |
| 173 | |
| 174 | assert(cond == G_IO_OUT); |
| 175 | |
| 176 | src = (SpiceCharSource *)g_source_new(&SpiceCharSourceFuncs, |
| 177 | sizeof(SpiceCharSource)); |
| 178 | src->scd = scd; |
| 179 | |
| 180 | return (GSource *)src; |
| 181 | } |
Alon Levy | cbcc633 | 2011-01-19 10:49:50 +0200 | [diff] [blame] | 182 | |
| 183 | static int spice_chr_write(CharDriverState *chr, const uint8_t *buf, int len) |
| 184 | { |
| 185 | SpiceCharDriver *s = chr->opaque; |
Hans de Goede | ae893e5 | 2013-04-05 11:30:22 +0200 | [diff] [blame] | 186 | int read_bytes; |
Alon Levy | cbcc633 | 2011-01-19 10:49:50 +0200 | [diff] [blame] | 187 | |
Alon Levy | cbcc633 | 2011-01-19 10:49:50 +0200 | [diff] [blame] | 188 | assert(s->datalen == 0); |
Alon Levy | b010cec | 2013-04-05 11:30:23 +0200 | [diff] [blame] | 189 | s->datapos = buf; |
Alon Levy | cbcc633 | 2011-01-19 10:49:50 +0200 | [diff] [blame] | 190 | s->datalen = len; |
| 191 | spice_server_char_device_wakeup(&s->sin); |
Hans de Goede | ae893e5 | 2013-04-05 11:30:22 +0200 | [diff] [blame] | 192 | read_bytes = len - s->datalen; |
| 193 | if (read_bytes != len) { |
| 194 | /* We'll get passed in the unconsumed data with the next call */ |
| 195 | s->datalen = 0; |
| 196 | s->datapos = NULL; |
| 197 | s->blocked = true; |
| 198 | } |
| 199 | return read_bytes; |
Alon Levy | cbcc633 | 2011-01-19 10:49:50 +0200 | [diff] [blame] | 200 | } |
| 201 | |
| 202 | static void spice_chr_close(struct CharDriverState *chr) |
| 203 | { |
| 204 | SpiceCharDriver *s = chr->opaque; |
| 205 | |
Alon Levy | cbcc633 | 2011-01-19 10:49:50 +0200 | [diff] [blame] | 206 | vmc_unregister_interface(s); |
Marc-André Lureau | 7a5448c | 2012-12-05 16:15:35 +0100 | [diff] [blame] | 207 | QLIST_REMOVE(s, next); |
Hans de Goede | 5e9b473 | 2013-03-13 10:41:31 +0100 | [diff] [blame] | 208 | |
| 209 | g_free((char *)s->sin.subtype); |
| 210 | #if SPICE_SERVER_VERSION >= 0x000c02 |
| 211 | g_free((char *)s->sin.portname); |
| 212 | #endif |
Anthony Liguori | 7267c09 | 2011-08-20 22:09:37 -0500 | [diff] [blame] | 213 | g_free(s); |
Alon Levy | cbcc633 | 2011-01-19 10:49:50 +0200 | [diff] [blame] | 214 | } |
| 215 | |
Hans de Goede | 574b711 | 2013-03-26 11:07:58 +0100 | [diff] [blame] | 216 | static void spice_chr_set_fe_open(struct CharDriverState *chr, int fe_open) |
Hans de Goede | cd8f7df | 2011-03-24 11:12:04 +0100 | [diff] [blame] | 217 | { |
| 218 | SpiceCharDriver *s = chr->opaque; |
Hans de Goede | 574b711 | 2013-03-26 11:07:58 +0100 | [diff] [blame] | 219 | if (fe_open) { |
| 220 | vmc_register_interface(s); |
| 221 | } else { |
| 222 | vmc_unregister_interface(s); |
| 223 | } |
Hans de Goede | cd8f7df | 2011-03-24 11:12:04 +0100 | [diff] [blame] | 224 | } |
| 225 | |
Alon Levy | cbcc633 | 2011-01-19 10:49:50 +0200 | [diff] [blame] | 226 | static void print_allowed_subtypes(void) |
| 227 | { |
| 228 | const char** psubtype; |
| 229 | int i; |
| 230 | |
| 231 | fprintf(stderr, "allowed names: "); |
| 232 | for(i=0, psubtype = spice_server_char_device_recognized_subtypes(); |
| 233 | *psubtype != NULL; ++psubtype, ++i) { |
| 234 | if (i == 0) { |
| 235 | fprintf(stderr, "%s", *psubtype); |
| 236 | } else { |
| 237 | fprintf(stderr, ", %s", *psubtype); |
| 238 | } |
| 239 | } |
| 240 | fprintf(stderr, "\n"); |
| 241 | } |
| 242 | |
Gerd Hoffmann | cd153e2 | 2013-02-25 12:39:06 +0100 | [diff] [blame] | 243 | static CharDriverState *chr_open(const char *subtype) |
Alon Levy | cbcc633 | 2011-01-19 10:49:50 +0200 | [diff] [blame] | 244 | { |
| 245 | CharDriverState *chr; |
| 246 | SpiceCharDriver *s; |
Marc-André Lureau | 71b423f | 2012-12-05 16:15:33 +0100 | [diff] [blame] | 247 | |
| 248 | chr = g_malloc0(sizeof(CharDriverState)); |
| 249 | s = g_malloc0(sizeof(SpiceCharDriver)); |
| 250 | s->chr = chr; |
Marc-André Lureau | 71b423f | 2012-12-05 16:15:33 +0100 | [diff] [blame] | 251 | s->active = false; |
Hans de Goede | 5e9b473 | 2013-03-13 10:41:31 +0100 | [diff] [blame] | 252 | s->sin.subtype = g_strdup(subtype); |
Marc-André Lureau | 71b423f | 2012-12-05 16:15:33 +0100 | [diff] [blame] | 253 | chr->opaque = s; |
| 254 | chr->chr_write = spice_chr_write; |
Hans de Goede | ae893e5 | 2013-04-05 11:30:22 +0200 | [diff] [blame] | 255 | chr->chr_add_watch = spice_chr_add_watch; |
Marc-André Lureau | 71b423f | 2012-12-05 16:15:33 +0100 | [diff] [blame] | 256 | chr->chr_close = spice_chr_close; |
Hans de Goede | 574b711 | 2013-03-26 11:07:58 +0100 | [diff] [blame] | 257 | chr->chr_set_fe_open = spice_chr_set_fe_open; |
Michael Roth | bd5c51e | 2013-06-07 15:19:53 -0500 | [diff] [blame] | 258 | chr->explicit_be_open = true; |
Marc-André Lureau | 71b423f | 2012-12-05 16:15:33 +0100 | [diff] [blame] | 259 | |
Marc-André Lureau | 7a5448c | 2012-12-05 16:15:35 +0100 | [diff] [blame] | 260 | QLIST_INSERT_HEAD(&spice_chars, s, next); |
| 261 | |
Marc-André Lureau | 71b423f | 2012-12-05 16:15:33 +0100 | [diff] [blame] | 262 | return chr; |
| 263 | } |
| 264 | |
Gerd Hoffmann | cd153e2 | 2013-02-25 12:39:06 +0100 | [diff] [blame] | 265 | CharDriverState *qemu_chr_open_spice_vmc(const char *type) |
Marc-André Lureau | 71b423f | 2012-12-05 16:15:33 +0100 | [diff] [blame] | 266 | { |
Marc-André Lureau | 71b423f | 2012-12-05 16:15:33 +0100 | [diff] [blame] | 267 | const char **psubtype = spice_server_char_device_recognized_subtypes(); |
Alon Levy | cbcc633 | 2011-01-19 10:49:50 +0200 | [diff] [blame] | 268 | |
Gerd Hoffmann | cd153e2 | 2013-02-25 12:39:06 +0100 | [diff] [blame] | 269 | if (type == NULL) { |
Alon Levy | cbcc633 | 2011-01-19 10:49:50 +0200 | [diff] [blame] | 270 | fprintf(stderr, "spice-qemu-char: missing name parameter\n"); |
| 271 | print_allowed_subtypes(); |
Markus Armbruster | 1f51470 | 2012-02-07 15:09:08 +0100 | [diff] [blame] | 272 | return NULL; |
Alon Levy | cbcc633 | 2011-01-19 10:49:50 +0200 | [diff] [blame] | 273 | } |
Gerd Hoffmann | cd153e2 | 2013-02-25 12:39:06 +0100 | [diff] [blame] | 274 | for (; *psubtype != NULL; ++psubtype) { |
| 275 | if (strcmp(type, *psubtype) == 0) { |
Alon Levy | cbcc633 | 2011-01-19 10:49:50 +0200 | [diff] [blame] | 276 | break; |
| 277 | } |
| 278 | } |
Gerd Hoffmann | cd153e2 | 2013-02-25 12:39:06 +0100 | [diff] [blame] | 279 | if (*psubtype == NULL) { |
| 280 | fprintf(stderr, "spice-qemu-char: unsupported type: %s\n", type); |
Alon Levy | cbcc633 | 2011-01-19 10:49:50 +0200 | [diff] [blame] | 281 | print_allowed_subtypes(); |
Markus Armbruster | 1f51470 | 2012-02-07 15:09:08 +0100 | [diff] [blame] | 282 | return NULL; |
Alon Levy | cbcc633 | 2011-01-19 10:49:50 +0200 | [diff] [blame] | 283 | } |
| 284 | |
Hans de Goede | 52fe0e7 | 2013-04-05 11:30:21 +0200 | [diff] [blame] | 285 | return chr_open(type); |
Alon Levy | cbcc633 | 2011-01-19 10:49:50 +0200 | [diff] [blame] | 286 | } |
Marc-André Lureau | 5a49d3e | 2012-12-05 16:15:34 +0100 | [diff] [blame] | 287 | |
| 288 | #if SPICE_SERVER_VERSION >= 0x000c02 |
Gerd Hoffmann | cd153e2 | 2013-02-25 12:39:06 +0100 | [diff] [blame] | 289 | CharDriverState *qemu_chr_open_spice_port(const char *name) |
Marc-André Lureau | 5a49d3e | 2012-12-05 16:15:34 +0100 | [diff] [blame] | 290 | { |
| 291 | CharDriverState *chr; |
| 292 | SpiceCharDriver *s; |
Marc-André Lureau | 5a49d3e | 2012-12-05 16:15:34 +0100 | [diff] [blame] | 293 | |
| 294 | if (name == NULL) { |
| 295 | fprintf(stderr, "spice-qemu-char: missing name parameter\n"); |
| 296 | return NULL; |
| 297 | } |
| 298 | |
Gerd Hoffmann | cd153e2 | 2013-02-25 12:39:06 +0100 | [diff] [blame] | 299 | chr = chr_open("port"); |
Marc-André Lureau | 5a49d3e | 2012-12-05 16:15:34 +0100 | [diff] [blame] | 300 | s = chr->opaque; |
Hans de Goede | 5e9b473 | 2013-03-13 10:41:31 +0100 | [diff] [blame] | 301 | s->sin.portname = g_strdup(name); |
Marc-André Lureau | 5a49d3e | 2012-12-05 16:15:34 +0100 | [diff] [blame] | 302 | |
| 303 | return chr; |
| 304 | } |
Marc-André Lureau | afd0b40 | 2012-12-05 16:15:36 +0100 | [diff] [blame] | 305 | |
| 306 | void qemu_spice_register_ports(void) |
| 307 | { |
| 308 | SpiceCharDriver *s; |
| 309 | |
| 310 | QLIST_FOREACH(s, &spice_chars, next) { |
| 311 | if (s->sin.portname == NULL) { |
| 312 | continue; |
| 313 | } |
| 314 | vmc_register_interface(s); |
| 315 | } |
| 316 | } |
Marc-André Lureau | 5a49d3e | 2012-12-05 16:15:34 +0100 | [diff] [blame] | 317 | #endif |
Anthony Liguori | 26c6061 | 2013-03-05 23:21:29 +0530 | [diff] [blame] | 318 | |
Gerd Hoffmann | cd153e2 | 2013-02-25 12:39:06 +0100 | [diff] [blame] | 319 | static void qemu_chr_parse_spice_vmc(QemuOpts *opts, ChardevBackend *backend, |
| 320 | Error **errp) |
| 321 | { |
| 322 | const char *name = qemu_opt_get(opts, "name"); |
| 323 | |
| 324 | if (name == NULL) { |
| 325 | error_setg(errp, "chardev: spice channel: no name given"); |
| 326 | return; |
| 327 | } |
| 328 | backend->spicevmc = g_new0(ChardevSpiceChannel, 1); |
| 329 | backend->spicevmc->type = g_strdup(name); |
| 330 | } |
| 331 | |
| 332 | static void qemu_chr_parse_spice_port(QemuOpts *opts, ChardevBackend *backend, |
| 333 | Error **errp) |
| 334 | { |
| 335 | const char *name = qemu_opt_get(opts, "name"); |
| 336 | |
| 337 | if (name == NULL) { |
| 338 | error_setg(errp, "chardev: spice port: no name given"); |
| 339 | return; |
| 340 | } |
| 341 | backend->spiceport = g_new0(ChardevSpicePort, 1); |
| 342 | backend->spiceport->fqdn = g_strdup(name); |
| 343 | } |
| 344 | |
Anthony Liguori | 26c6061 | 2013-03-05 23:21:29 +0530 | [diff] [blame] | 345 | static void register_types(void) |
| 346 | { |
Gerd Hoffmann | cd153e2 | 2013-02-25 12:39:06 +0100 | [diff] [blame] | 347 | register_char_driver_qapi("spicevmc", CHARDEV_BACKEND_KIND_SPICEVMC, |
| 348 | qemu_chr_parse_spice_vmc); |
| 349 | register_char_driver_qapi("spiceport", CHARDEV_BACKEND_KIND_SPICEPORT, |
| 350 | qemu_chr_parse_spice_port); |
Anthony Liguori | 26c6061 | 2013-03-05 23:21:29 +0530 | [diff] [blame] | 351 | } |
| 352 | |
| 353 | type_init(register_types); |