static CharDriverState *qemu_chr_open_spice_vmc(const char *id,

                                                ChardevBackend *backend,

                                                ChardevReturn *ret,

                                                Error **errp)

{

    const char *type = backend->u.spicevmc->type;

    const char **psubtype = spice_server_char_device_recognized_subtypes();



    for (; *psubtype != NULL; ++psubtype) {

        if (strcmp(type, *psubtype) == 0) {

            break;

        }

    }

    if (*psubtype == NULL) {

        fprintf(stderr, "spice-qemu-char: unsupported type: %s\n", type);

        print_allowed_subtypes();

        return NULL;

    }



    return chr_open(type, spice_vmc_set_fe_open);

}

static CharDriverState *qemu_chr_open_spice_vmc(const char *id,

                                                ChardevBackend *backend,

                                                ChardevReturn *ret,

                                                Error **errp)

{

    const char *type = backend->u.spicevmc->type;

    const char **psubtype = spice_server_char_device_recognized_subtypes();



    for (; *psubtype != NULL; ++psubtype) {

        if (strcmp(type, *psubtype) == 0) {

            break;

        }

    }

    if (*psubtype == NULL) {

        fprintf(stderr, "spice-qemu-char: unsupported type: %s\n", type);

        print_allowed_subtypes();

        return NULL;

    }



    return chr_open(type, spice_vmc_set_fe_open);

}

static CharDriverState *FUNC_0(const char *id,

                                                ChardevBackend *backend,

                                                ChardevReturn *ret,

                                                Error **errp)

{

    const char *VAR_0 = backend->u.spicevmc->VAR_0;

    const char **VAR_1 = spice_server_char_device_recognized_subtypes();



    for (; *VAR_1 != NULL; ++VAR_1) {

        if (strcmp(VAR_0, *VAR_1) == 0) {

            break;

        }

    }

    if (*VAR_1 == NULL) {

        fprintf(stderr, "spice-qemu-char: unsupported VAR_0: %s\n", VAR_0);

        print_allowed_subtypes();

        return NULL;

    }



    return chr_open(VAR_0, spice_vmc_set_fe_open);

}

static CharDriverState *FUNC_0(const char *id,
ChardevBackend *backend,
ChardevReturn *ret,
Error **errp)
{ const char *VAR_0 = backend->u.spicevmc->VAR_0; const char **VAR_1 = spice_server_char_device_recognized_subtypes(); for (; *VAR_1 != NULL; ++VAR_1) { if (strcmp(VAR_0, *VAR_1) == 0) { break; } } if (*VAR_1 == NULL) { fprintf(stderr, "spice-qemu-char: unsupported VAR_0: %s\n", VAR_0); print_allowed_subtypes(); return NULL; } return chr_open(VAR_0, spice_vmc_set_fe_open); }