Lines Matching +full:copy +full:- +full:item

14  * You should have received a copy of the GNU General Public License
23 #include "ui/qemu-spice.h"
24 #include "qemu/error-report.h"
25 #include "qemu/main-loop.h"
30 #include "qemu-x509.h"
33 #include "qapi/qapi-commands-ui.h"
34 #include "qapi/qapi-events-ui.h"
40 #include "ui/spice-display.h"
64 timer->timer = timer_new_ms(QEMU_CLOCK_REALTIME, func, opaque); in timer_add()
70 timer_mod(timer->timer, qemu_clock_get_ms(QEMU_CLOCK_REALTIME) + ms); in timer_start()
75 timer_del(timer->timer); in timer_cancel()
80 timer_free(timer->timer); in timer_remove()
93 int fd = watch->fd; in watch_read()
98 watch->func(fd, SPICE_WATCH_EVENT_READ, watch->opaque); in watch_read()
104 int fd = watch->fd; in watch_write()
109 watch->func(fd, SPICE_WATCH_EVENT_WRITE, watch->opaque); in watch_write()
123 qemu_set_fd_handler(watch->fd, on_read, on_write, watch); in watch_update_mask()
139 watch->fd = fd; in watch_add()
140 watch->func = func; in watch_add()
141 watch->opaque = opaque; in watch_add()
149 qemu_set_fd_handler(watch->fd, NULL, NULL, NULL); in watch_remove()
152 qemu_close_socket_osfhandle(watch->fd); in watch_remove()
166 ChannelList *item; in channel_list_add() local
168 item = g_malloc0(sizeof(*item)); in channel_list_add()
169 item->info = info; in channel_list_add()
170 QTAILQ_INSERT_TAIL(&channel_list, item, link); in channel_list_add()
175 ChannelList *item; in channel_list_del() local
177 QTAILQ_FOREACH(item, &channel_list, link) { in channel_list_del()
178 if (item->info != info) { in channel_list_del()
181 QTAILQ_REMOVE(&channel_list, item, link); in channel_list_del()
182 g_free(item); in channel_list_del()
194 info->host = g_strdup(host); in add_addr_info()
195 info->port = g_strdup(port); in add_addr_info()
196 info->family = inet_netfamily(addr->sa_family); in add_addr_info()
201 int tls = info->flags & SPICE_CHANNEL_EVENT_FLAG_TLS; in add_channel_info()
203 sc->connection_id = info->connection_id; in add_channel_info()
204 sc->channel_type = info->type; in add_channel_info()
205 sc->channel_id = info->id; in add_channel_info()
206 sc->tls = !!tls; in add_channel_info()
228 if (info->flags & SPICE_CHANNEL_EVENT_FLAG_ADDR_EXT) { in channel_event()
230 (struct sockaddr *)&info->paddr_ext, in channel_event()
231 info->plen_ext); in channel_event()
233 (struct sockaddr *)&info->laddr_ext, in channel_event()
234 info->llen_ext); in channel_event()
247 server->auth = g_strdup(auth); in channel_event()
304 /* nothing, but libspice-server expects this cb being present. */ in migrate_connect_complete_cb()
330 return -1; in name2enum()
338 if (value != -1) { in parse_name()
380 ChannelList *item; in qmp_query_spice_channels() local
382 QTAILQ_FOREACH(item, &channel_list, link) { in qmp_query_spice_channels()
388 assert(item->info->flags & SPICE_CHANNEL_EVENT_FLAG_ADDR_EXT); in qmp_query_spice_channels()
392 paddr = (struct sockaddr *)&item->info->paddr_ext; in qmp_query_spice_channels()
393 plen = item->info->plen_ext; in qmp_query_spice_channels()
397 chan->host = g_strdup(host); in qmp_query_spice_channels()
398 chan->port = g_strdup(port); in qmp_query_spice_channels()
399 chan->family = inet_netfamily(paddr->sa_family); in qmp_query_spice_channels()
401 chan->connection_id = item->info->connection_id; in qmp_query_spice_channels()
402 chan->channel_type = item->info->type; in qmp_query_spice_channels()
403 chan->channel_id = item->info->id; in qmp_query_spice_channels()
404 chan->tls = item->info->flags & SPICE_CHANNEL_EVENT_FLAG_TLS; in qmp_query_spice_channels()
421 .name = "tls-port",
438 .name = "password-secret",
441 .name = "disable-ticketing",
444 .name = "disable-copy-paste",
447 .name = "disable-agent-file-xfer",
453 .name = "x509-dir",
456 .name = "x509-key-file",
459 .name = "x509-key-password",
462 .name = "x509-cert-file",
465 .name = "x509-cacert-file",
468 .name = "x509-dh-key-file",
471 .name = "tls-ciphers",
474 .name = "tls-channel",
477 .name = "plaintext-channel",
480 .name = "image-compression",
483 .name = "jpeg-wan-compression",
486 .name = "zlib-glz-wan-compression",
489 .name = "streaming-video",
492 .name = "agent-mouse",
495 .name = "playback-compression",
498 .name = "seamless-migration",
532 info->enabled = false; in qmp_query_spice_real()
536 info->enabled = true; in qmp_query_spice_real()
537 info->migrated = spice_migration_completed; in qmp_query_spice_real()
541 tls_port = qemu_opt_get_number(opts, "tls-port", 0); in qmp_query_spice_real()
543 info->auth = g_strdup(auth); in qmp_query_spice_real()
544 info->host = g_strdup(addr ? addr : "*"); in qmp_query_spice_real()
549 info->compiled_version = g_strdup_printf("%d.%d.%d", major, minor, micro); in qmp_query_spice_real()
552 info->has_port = true; in qmp_query_spice_real()
553 info->port = port; in qmp_query_spice_real()
556 info->has_tls_port = true; in qmp_query_spice_real()
557 info->tls_port = tls_port; in qmp_query_spice_real()
560 info->mouse_mode = spice_server_is_server_mouse(spice_server) ? in qmp_query_spice_real()
565 info->has_channels = true; in qmp_query_spice_real()
566 info->channels = qmp_query_spice_channels(); in qmp_query_spice_real()
578 if (e->type == MIG_EVENT_PRECOPY_SETUP) { in migration_state_notifier()
580 } else if (e->type == MIG_EVENT_PRECOPY_DONE) { in migration_state_notifier()
583 } else if (e->type == MIG_EVENT_PRECOPY_FAILED) { in migration_state_notifier()
607 if (strcmp(name, "tls-channel") == 0) { in add_channel()
610 error_setg(errp, "spice: tried to setup tls-channel" in add_channel()
612 return -1; in add_channel()
616 if (strcmp(name, "plaintext-channel") == 0) { in add_channel()
630 return -1; in add_channel()
676 tls_port = qemu_opt_get_number(opts, "tls-port", 0); in qemu_spice_init()
682 error_report("spice tls-port is out of range"); in qemu_spice_init()
685 passwordSecret = qemu_opt_get(opts, "password-secret"); in qemu_spice_init()
692 x509_dir = qemu_opt_get(opts, "x509-dir"); in qemu_spice_init()
697 str = qemu_opt_get(opts, "x509-key-file"); in qemu_spice_init()
705 str = qemu_opt_get(opts, "x509-cert-file"); in qemu_spice_init()
713 str = qemu_opt_get(opts, "x509-cacert-file"); in qemu_spice_init()
721 x509_key_password = qemu_opt_get(opts, "x509-key-password"); in qemu_spice_init()
722 x509_dh_file = qemu_opt_get(opts, "x509-dh-key-file"); in qemu_spice_init()
723 tls_ciphers = qemu_opt_get(opts, "tls-ciphers"); in qemu_spice_init()
756 if (spice_server_set_sasl(spice_server, 1) == -1) { in qemu_spice_init()
762 if (qemu_opt_get_bool(opts, "disable-ticketing", 0)) { in qemu_spice_init()
767 if (qemu_opt_get_bool(opts, "disable-copy-paste", 0)) { in qemu_spice_init()
771 if (qemu_opt_get_bool(opts, "disable-agent-file-xfer", 0)) { in qemu_spice_init()
776 str = qemu_opt_get(opts, "image-compression"); in qemu_spice_init()
783 str = qemu_opt_get(opts, "jpeg-wan-compression"); in qemu_spice_init()
790 str = qemu_opt_get(opts, "zlib-glz-wan-compression"); in qemu_spice_init()
796 str = qemu_opt_get(opts, "streaming-video"); in qemu_spice_init()
805 (spice_server, qemu_opt_get_bool(opts, "agent-mouse", 1)); in qemu_spice_init()
807 (spice_server, qemu_opt_get_bool(opts, "playback-compression", 1)); in qemu_spice_init()
814 seamless_migration = qemu_opt_get_bool(opts, "seamless-migration", 0); in qemu_spice_init()
839 error_report("SPICE GL support is local-only for now and " in qemu_spice_init()
840 "incompatible with -spice port/tls-port"); in qemu_spice_init()
861 * With a command line like '-vnc :0 -vga qxl' you'll end up here. in qemu_spice_add_interface()
885 return -1; in qemu_spice_add_display_interface()
887 qxlin->id = qemu_console_get_index(con); in qemu_spice_add_display_interface()
889 return qemu_spice_add_interface(&qxlin->base); in qemu_spice_add_display_interface()
899 lifetime = (auth_expires - now); in qemu_spice_set_ticket()
915 return -1; in qemu_spice_set_passwd()
986 module_dep("ui-opengl");