Revision 6e1db57b spice-qemu-char.c

b/spice-qemu-char.c
159 159
    fprintf(stderr, "\n");
160 160
}
161 161

  
162
CharDriverState *qemu_chr_open_spice(QemuOpts *opts)
162
int qemu_chr_open_spice(QemuOpts *opts, CharDriverState **_chr)
163 163
{
164 164
    CharDriverState *chr;
165 165
    SpiceCharDriver *s;
......
171 171
    if (name == NULL) {
172 172
        fprintf(stderr, "spice-qemu-char: missing name parameter\n");
173 173
        print_allowed_subtypes();
174
        return NULL;
174
        return -EINVAL;
175 175
    }
176 176
    for(;*psubtype != NULL; ++psubtype) {
177 177
        if (strcmp(name, *psubtype) == 0) {
......
182 182
    if (subtype == NULL) {
183 183
        fprintf(stderr, "spice-qemu-char: unsupported name\n");
184 184
        print_allowed_subtypes();
185
        return NULL;
185
        return -EINVAL;
186 186
    }
187 187

  
188 188
    chr = qemu_mallocz(sizeof(CharDriverState));
......
199 199

  
200 200
    qemu_chr_generic_open(chr);
201 201

  
202
    return chr;
202
    *_chr = chr;
203
    return 0;
203 204
}

Also available in: Unified diff