diff options
author | malc | 2011-08-05 08:07:10 +0200 |
---|---|---|
committer | malc | 2011-08-05 08:07:10 +0200 |
commit | a67a47d2b559a7733c3f89aeb2d81b19d2c027e4 (patch) | |
tree | 146a7b6eebbee1367453fde501d4462ac6d9f8b4 /monitor.c | |
parent | Merge branch 'master' of git://git.qemu.org/qemu (diff) | |
parent | Merge remote-tracking branch 'mst/for_anthony' into staging (diff) | |
download | qemu-a67a47d2b559a7733c3f89aeb2d81b19d2c027e4.tar.gz qemu-a67a47d2b559a7733c3f89aeb2d81b19d2c027e4.tar.xz qemu-a67a47d2b559a7733c3f89aeb2d81b19d2c027e4.zip |
Merge branch 'master' of git://git.qemu.org/qemu
Diffstat (limited to 'monitor.c')
-rw-r--r-- | monitor.c | 34 |
1 files changed, 34 insertions, 0 deletions
@@ -1185,6 +1185,40 @@ static int expire_password(Monitor *mon, const QDict *qdict, QObject **ret_data) return -1; } +static int add_graphics_client(Monitor *mon, const QDict *qdict, QObject **ret_data) +{ + const char *protocol = qdict_get_str(qdict, "protocol"); + const char *fdname = qdict_get_str(qdict, "fdname"); + int skipauth = qdict_get_try_bool(qdict, "skipauth", 0); + CharDriverState *s; + + if (strcmp(protocol, "spice") == 0) { + if (!using_spice) { + /* correct one? spice isn't a device ,,, */ + qerror_report(QERR_DEVICE_NOT_ACTIVE, "spice"); + return -1; + } + qerror_report(QERR_ADD_CLIENT_FAILED); + return -1; +#ifdef CONFIG_VNC + } else if (strcmp(protocol, "vnc") == 0) { + int fd = monitor_get_fd(mon, fdname); + vnc_display_add_client(NULL, fd, skipauth); + return 0; +#endif + } else if ((s = qemu_chr_find(protocol)) != NULL) { + int fd = monitor_get_fd(mon, fdname); + if (qemu_chr_add_client(s, fd) < 0) { + qerror_report(QERR_ADD_CLIENT_FAILED); + return -1; + } + return 0; + } + + qerror_report(QERR_INVALID_PARAMETER, "protocol"); + return -1; +} + static int client_migrate_info(Monitor *mon, const QDict *qdict, QObject **ret_data) { const char *protocol = qdict_get_str(qdict, "protocol"); |