Revision 71b423f4

b/spice-qemu-char.c
186 186
    fprintf(stderr, "\n");
187 187
}
188 188

  
189
CharDriverState *qemu_chr_open_spice(QemuOpts *opts)
189
static CharDriverState *chr_open(QemuOpts *opts, const char *subtype)
190 190
{
191 191
    CharDriverState *chr;
192 192
    SpiceCharDriver *s;
193
    const char* name = qemu_opt_get(opts, "name");
194 193
    uint32_t debug = qemu_opt_get_number(opts, "debug", 0);
195
    const char** psubtype = spice_server_char_device_recognized_subtypes();
194

  
195
    chr = g_malloc0(sizeof(CharDriverState));
196
    s = g_malloc0(sizeof(SpiceCharDriver));
197
    s->chr = chr;
198
    s->debug = debug;
199
    s->active = false;
200
    s->sin.subtype = subtype;
201
    chr->opaque = s;
202
    chr->chr_write = spice_chr_write;
203
    chr->chr_close = spice_chr_close;
204
    chr->chr_guest_open = spice_chr_guest_open;
205
    chr->chr_guest_close = spice_chr_guest_close;
206

  
207
    return chr;
208
}
209

  
210
CharDriverState *qemu_chr_open_spice(QemuOpts *opts)
211
{
212
    CharDriverState *chr;
213
    const char *name = qemu_opt_get(opts, "name");
214
    const char **psubtype = spice_server_char_device_recognized_subtypes();
196 215
    const char *subtype = NULL;
197 216

  
198 217
    if (name == NULL) {
......
212 231
        return NULL;
213 232
    }
214 233

  
215
    chr = g_malloc0(sizeof(CharDriverState));
216
    s = g_malloc0(sizeof(SpiceCharDriver));
217
    s->chr = chr;
218
    s->debug = debug;
219
    s->active = false;
220
    s->sin.subtype = subtype;
221
    chr->opaque = s;
222
    chr->chr_write = spice_chr_write;
223
    chr->chr_close = spice_chr_close;
224
    chr->chr_guest_open = spice_chr_guest_open;
225
    chr->chr_guest_close = spice_chr_guest_close;
234
    chr = chr_open(opts, subtype);
226 235

  
227 236
#if SPICE_SERVER_VERSION < 0x000901
228 237
    /* See comment in vmc_state() */

Also available in: Unified diff