diff options
author | Julia Suvorova <jusual@mail.ru> | 2018-10-19 01:35:00 +0300 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2018-11-01 12:12:58 +0400 |
commit | 981b06e7444781981cb86a8f1cce8567e63e83ac (patch) | |
tree | adf19f19ed9a2070f5ca5986feaa4ce04060b3b1 /chardev/char.c | |
parent | 4493b6a54cbf85797a462978a7f1126de8c9c7b8 (diff) |
chardev: Add websocket support
New option "websocket" added to allow using WebSocket protocol for
chardev socket backend.
Example:
-chardev socket,websocket,server,id=...
Signed-off-by: Julia Suvorova <jusual@mail.ru>
Message-Id: <20181018223501.21683-3-jusual@mail.ru>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Diffstat (limited to 'chardev/char.c')
-rw-r--r-- | chardev/char.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/chardev/char.c b/chardev/char.c index 7f07a1bfbd..79b05fb7b7 100644 --- a/chardev/char.c +++ b/chardev/char.c @@ -409,7 +409,8 @@ QemuOpts *qemu_chr_parse_compat(const char *label, const char *filename, } if (strstart(filename, "tcp:", &p) || strstart(filename, "telnet:", &p) || - strstart(filename, "tn3270:", &p)) { + strstart(filename, "tn3270:", &p) || + strstart(filename, "websocket:", &p)) { if (sscanf(p, "%64[^:]:%32[^,]%n", host, port, &pos) < 2) { host[0] = 0; if (sscanf(p, ":%32[^,]%n", port, &pos) < 1) @@ -429,6 +430,8 @@ QemuOpts *qemu_chr_parse_compat(const char *label, const char *filename, qemu_opt_set(opts, "telnet", "on", &error_abort); } else if (strstart(filename, "tn3270:", &p)) { qemu_opt_set(opts, "tn3270", "on", &error_abort); + } else if (strstart(filename, "websocket:", &p)) { + qemu_opt_set(opts, "websocket", "on", &error_abort); } return opts; } @@ -861,6 +864,9 @@ QemuOptsList qemu_chardev_opts = { .name = "tls-creds", .type = QEMU_OPT_STRING, },{ + .name = "websocket", + .type = QEMU_OPT_BOOL, + },{ .name = "width", .type = QEMU_OPT_NUMBER, },{ |