static int configure_accelerator(MachineClass *mc)

{

    const char *p;

    char buf[10];

    int i, ret;

    bool accel_initialised = false;

    bool init_failed = false;



    p = qemu_opt_get(qemu_get_machine_opts(), "accel");

    if (p == NULL) {

        /* Use the default "accelerator", tcg */

        p = "tcg";

    }



    while (!accel_initialised && *p != '\0') {

        if (*p == ':') {

            p++;

        }

        p = get_opt_name(buf, sizeof (buf), p, ':');

        for (i = 0; i < ARRAY_SIZE(accel_list); i++) {

            if (strcmp(accel_list[i].opt_name, buf) == 0) {

                if (!accel_list[i].available()) {

                    printf("%s not supported for this target\n",

                           accel_list[i].name);

                    break;

                }

                *(accel_list[i].allowed) = true;

                ret = accel_list[i].init(mc);

                if (ret < 0) {

                    init_failed = true;

                    fprintf(stderr, "failed to initialize %s: %s\n",

                            accel_list[i].name,

                            strerror(-ret));

                    *(accel_list[i].allowed) = false;

                } else {

                    accel_initialised = true;

                }

                break;

            }

        }

        if (i == ARRAY_SIZE(accel_list)) {

            fprintf(stderr, "\"%s\" accelerator does not exist.\n", buf);

        }

    }



    if (!accel_initialised) {

        if (!init_failed) {

            fprintf(stderr, "No accelerator found!\n");

        }

        exit(1);

    }



    if (init_failed) {

        fprintf(stderr, "Back to %s accelerator.\n", accel_list[i].name);

    }



    return !accel_initialised;

}

static int configure_accelerator(MachineClass *mc)

{

    const char *p;

    char buf[10];

    int i, ret;

    bool accel_initialised = false;

    bool init_failed = false;



    p = qemu_opt_get(qemu_get_machine_opts(), "accel");

    if (p == NULL) {

        

        p = "tcg";

    }



    while (!accel_initialised && *p != '\0') {

        if (*p == ':') {

            p++;

        }

        p = get_opt_name(buf, sizeof (buf), p, ':');

        for (i = 0; i < ARRAY_SIZE(accel_list); i++) {

            if (strcmp(accel_list[i].opt_name, buf) == 0) {

                if (!accel_list[i].available()) {

                    printf("%s not supported for this target\n",

                           accel_list[i].name);

                    break;

                }

                *(accel_list[i].allowed) = true;

                ret = accel_list[i].init(mc);

                if (ret < 0) {

                    init_failed = true;

                    fprintf(stderr, "failed to initialize %s: %s\n",

                            accel_list[i].name,

                            strerror(-ret));

                    *(accel_list[i].allowed) = false;

                } else {

                    accel_initialised = true;

                }

                break;

            }

        }

        if (i == ARRAY_SIZE(accel_list)) {

            fprintf(stderr, "\"%s\" accelerator does not exist.\n", buf);

        }

    }



    if (!accel_initialised) {

        if (!init_failed) {

            fprintf(stderr, "No accelerator found!\n");

        }

        exit(1);

    }



    if (init_failed) {

        fprintf(stderr, "Back to %s accelerator.\n", accel_list[i].name);

    }



    return !accel_initialised;

}

static int FUNC_0(MachineClass *VAR_0)

{

    const char *VAR_1;

    char VAR_2[10];

    int VAR_3, VAR_4;

    bool accel_initialised = false;

    bool init_failed = false;



    VAR_1 = qemu_opt_get(qemu_get_machine_opts(), "accel");

    if (VAR_1 == NULL) {

        

        VAR_1 = "tcg";

    }



    while (!accel_initialised && *VAR_1 != '\0') {

        if (*VAR_1 == ':') {

            VAR_1++;

        }

        VAR_1 = get_opt_name(VAR_2, sizeof (VAR_2), VAR_1, ':');

        for (VAR_3 = 0; VAR_3 < ARRAY_SIZE(accel_list); VAR_3++) {

            if (strcmp(accel_list[VAR_3].opt_name, VAR_2) == 0) {

                if (!accel_list[VAR_3].available()) {

                    printf("%s not supported for this target\n",

                           accel_list[VAR_3].name);

                    break;

                }

                *(accel_list[VAR_3].allowed) = true;

                VAR_4 = accel_list[VAR_3].init(VAR_0);

                if (VAR_4 < 0) {

                    init_failed = true;

                    fprintf(stderr, "failed to initialize %s: %s\n",

                            accel_list[VAR_3].name,

                            strerror(-VAR_4));

                    *(accel_list[VAR_3].allowed) = false;

                } else {

                    accel_initialised = true;

                }

                break;

            }

        }

        if (VAR_3 == ARRAY_SIZE(accel_list)) {

            fprintf(stderr, "\"%s\" accelerator does not exist.\n", VAR_2);

        }

    }



    if (!accel_initialised) {

        if (!init_failed) {

            fprintf(stderr, "No accelerator found!\n");

        }

        exit(1);

    }



    if (init_failed) {

        fprintf(stderr, "Back to %s accelerator.\n", accel_list[VAR_3].name);

    }



    return !accel_initialised;

}

static int FUNC_0(MachineClass *VAR_0)
{ const char *VAR_1; char VAR_2[10]; int VAR_3, VAR_4; bool accel_initialised = false; bool init_failed = false; VAR_1 = qemu_opt_get(qemu_get_machine_opts(), "accel"); if (VAR_1 == NULL) { VAR_1 = "tcg"; } while (!accel_initialised && *VAR_1 != '\0') { if (*VAR_1 == ':') { VAR_1++; } VAR_1 = get_opt_name(VAR_2, sizeof (VAR_2), VAR_1, ':'); for (VAR_3 = 0; VAR_3 < ARRAY_SIZE(accel_list); VAR_3++) { if (strcmp(accel_list[VAR_3].opt_name, VAR_2) == 0) { if (!accel_list[VAR_3].available()) { printf("%s not supported for this target\n",
accel_list[VAR_3].name); break; } *(accel_list[VAR_3].allowed) = true; VAR_4 = accel_list[VAR_3].init(VAR_0); if (VAR_4 < 0) { init_failed = true; fprintf(stderr, "failed to initialize %s: %s\n",
accel_list[VAR_3].name,
strerror(-VAR_4)); *(accel_list[VAR_3].allowed) = false; } else { accel_initialised = true; } break; } } if (VAR_3 == ARRAY_SIZE(accel_list)) { fprintf(stderr, "\"%s\" accelerator does not exist.\n", VAR_2); } } if (!accel_initialised) { if (!init_failed) { fprintf(stderr, "No accelerator found!\n"); } exit(1); } if (init_failed) { fprintf(stderr, "Back to %s accelerator.\n", accel_list[VAR_3].name); } return !accel_initialised; }