Revision 17b6dea0

b/qemu-config.c
392 392
            .name = "tls-ciphers",
393 393
            .type = QEMU_OPT_STRING,
394 394
        },{
395
            .name = "tls-channel",
396
            .type = QEMU_OPT_STRING,
397
        },{
398
            .name = "plaintext-channel",
399
            .type = QEMU_OPT_STRING,
400
        },{
395 401
            .name = "image-compression",
396 402
            .type = QEMU_OPT_STRING,
397 403
        },{
b/qemu-options.hx
704 704
@item tls-ciphers=<list>
705 705
Specify which ciphers to use.
706 706

  
707
@item tls-channel=[main|display|inputs|record|playback|tunnel]
708
@item plaintext-channel=[main|display|inputs|record|playback|tunnel]
709
Force specific channel to be used with or without TLS encryption.  The
710
options can be specified multiple times to configure multiple
711
channels.  The special name "default" can be used to set the default
712
mode.  For channels which are not explicitly forced into one mode the
713
spice client is allowed to pick tls/plaintext as he pleases.
714

  
707 715
@item image-compression=[auto_glz|auto_lz|quic|glz|lz|off]
708 716
Configure image compression (lossless).
709 717
Default is auto_glz.
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