Revision 17b6dea0 ui/spice-core.c

b/ui/spice-core.c
192 192

  
193 193
/* functions for the rest of qemu */
194 194

  
195
static int add_channel(const char *name, const char *value, void *opaque)
196
{
197
    int security = 0;
198
    int rc;
199

  
200
    if (strcmp(name, "tls-channel") == 0) {
201
        security = SPICE_CHANNEL_SECURITY_SSL;
202
    }
203
    if (strcmp(name, "plaintext-channel") == 0) {
204
        security = SPICE_CHANNEL_SECURITY_NONE;
205
    }
206
    if (security == 0) {
207
        return 0;
208
    }
209
    if (strcmp(value, "default") == 0) {
210
        rc = spice_server_set_channel_security(spice_server, NULL, security);
211
    } else {
212
        rc = spice_server_set_channel_security(spice_server, value, security);
213
    }
214
    if (rc != 0) {
215
        fprintf(stderr, "spice: failed to set channel security for %s\n", value);
216
        exit(1);
217
    }
218
    return 0;
219
}
220

  
195 221
void qemu_spice_init(void)
196 222
{
197 223
    QemuOpts *opts = QTAILQ_FIRST(&qemu_spice_opts.head);
......
293 319
    }
294 320
    spice_server_set_zlib_glz_compression(spice_server, wan_compr);
295 321

  
322
    qemu_opt_foreach(opts, add_channel, NULL, 0);
323

  
296 324
    spice_server_init(spice_server, &core_interface);
297 325
    using_spice = 1;
298 326

  

Also available in: Unified diff