static void x86_cpu_parse_featurestr(const char *typename, char *features,

                                     Error **errp)

{

    char *featurestr; /* Single 'key=value" string being parsed */

    static bool cpu_globals_initialized;

    bool ambiguous = false;



    if (cpu_globals_initialized) {

        return;

    }

    cpu_globals_initialized = true;



    if (!features) {

        return;

    }



    for (featurestr = strtok(features, ",");

         featurestr;

         featurestr = strtok(NULL, ",")) {

        const char *name;

        const char *val = NULL;

        char *eq = NULL;

        char num[32];

        GlobalProperty *prop;



        /* Compatibility syntax: */

        if (featurestr[0] == '+') {

            plus_features = g_list_append(plus_features,

                                          g_strdup(featurestr + 1));

            continue;

        } else if (featurestr[0] == '-') {

            minus_features = g_list_append(minus_features,

                                           g_strdup(featurestr + 1));

            continue;

        }



        eq = strchr(featurestr, '=');

        if (eq) {

            *eq++ = 0;

            val = eq;

        } else {

            val = "on";

        }



        feat2prop(featurestr);

        name = featurestr;



        if (g_list_find_custom(plus_features, name, compare_string)) {

            error_report("warning: Ambiguous CPU model string. "

                         "Don't mix both \"+%s\" and \"%s=%s\"",

                         name, name, val);

            ambiguous = true;

        }

        if (g_list_find_custom(minus_features, name, compare_string)) {

            error_report("warning: Ambiguous CPU model string. "

                         "Don't mix both \"-%s\" and \"%s=%s\"",

                         name, name, val);

            ambiguous = true;

        }



        /* Special case: */

        if (!strcmp(name, "tsc-freq")) {

            int64_t tsc_freq;



            tsc_freq = qemu_strtosz_metric(val, NULL);

            if (tsc_freq < 0) {

                error_setg(errp, "bad numerical value %s", val);

                return;

            }

            snprintf(num, sizeof(num), "%" PRId64, tsc_freq);

            val = num;

            name = "tsc-frequency";

        }



        prop = g_new0(typeof(*prop), 1);

        prop->driver = typename;

        prop->property = g_strdup(name);

        prop->value = g_strdup(val);

        prop->errp = &error_fatal;

        qdev_prop_register_global(prop);

    }



    if (ambiguous) {

        error_report("warning: Compatibility of ambiguous CPU model "

                     "strings won't be kept on future QEMU versions");

    }

}

static void x86_cpu_parse_featurestr(const char *typename, char *features,

                                     Error **errp)

{

    char *featurestr; 

    static bool cpu_globals_initialized;

    bool ambiguous = false;



    if (cpu_globals_initialized) {

        return;

    }

    cpu_globals_initialized = true;



    if (!features) {

        return;

    }



    for (featurestr = strtok(features, ",");

         featurestr;

         featurestr = strtok(NULL, ",")) {

        const char *name;

        const char *val = NULL;

        char *eq = NULL;

        char num[32];

        GlobalProperty *prop;



        

        if (featurestr[0] == '+') {

            plus_features = g_list_append(plus_features,

                                          g_strdup(featurestr + 1));

            continue;

        } else if (featurestr[0] == '-') {

            minus_features = g_list_append(minus_features,

                                           g_strdup(featurestr + 1));

            continue;

        }



        eq = strchr(featurestr, '=');

        if (eq) {

            *eq++ = 0;

            val = eq;

        } else {

            val = "on";

        }



        feat2prop(featurestr);

        name = featurestr;



        if (g_list_find_custom(plus_features, name, compare_string)) {

            error_report("warning: Ambiguous CPU model string. "

                         "Don't mix both \"+%s\" and \"%s=%s\"",

                         name, name, val);

            ambiguous = true;

        }

        if (g_list_find_custom(minus_features, name, compare_string)) {

            error_report("warning: Ambiguous CPU model string. "

                         "Don't mix both \"-%s\" and \"%s=%s\"",

                         name, name, val);

            ambiguous = true;

        }



        

        if (!strcmp(name, "tsc-freq")) {

            int64_t tsc_freq;



            tsc_freq = qemu_strtosz_metric(val, NULL);

            if (tsc_freq < 0) {

                error_setg(errp, "bad numerical value %s", val);

                return;

            }

            snprintf(num, sizeof(num), "%" PRId64, tsc_freq);

            val = num;

            name = "tsc-frequency";

        }



        prop = g_new0(typeof(*prop), 1);

        prop->driver = typename;

        prop->property = g_strdup(name);

        prop->value = g_strdup(val);

        prop->errp = &error_fatal;

        qdev_prop_register_global(prop);

    }



    if (ambiguous) {

        error_report("warning: Compatibility of ambiguous CPU model "

                     "strings won't be kept on future QEMU versions");

    }

}

static void FUNC_0(const char *VAR_0, char *VAR_1,

                                     Error **VAR_2)

{

    char *VAR_3; 

    static bool VAR_4;

    bool ambiguous = false;



    if (VAR_4) {

        return;

    }

    VAR_4 = true;



    if (!VAR_1) {

        return;

    }



    for (VAR_3 = strtok(VAR_1, ",");

         VAR_3;

         VAR_3 = strtok(NULL, ",")) {

        const char *VAR_5;

        const char *VAR_6 = NULL;

        char *VAR_7 = NULL;

        char VAR_8[32];

        GlobalProperty *prop;



        

        if (VAR_3[0] == '+') {

            plus_features = g_list_append(plus_features,

                                          g_strdup(VAR_3 + 1));

            continue;

        } else if (VAR_3[0] == '-') {

            minus_features = g_list_append(minus_features,

                                           g_strdup(VAR_3 + 1));

            continue;

        }



        VAR_7 = strchr(VAR_3, '=');

        if (VAR_7) {

            *VAR_7++ = 0;

            VAR_6 = VAR_7;

        } else {

            VAR_6 = "on";

        }



        feat2prop(VAR_3);

        VAR_5 = VAR_3;



        if (g_list_find_custom(plus_features, VAR_5, compare_string)) {

            error_report("warning: Ambiguous CPU model string. "

                         "Don't mix both \"+%s\" and \"%s=%s\"",

                         VAR_5, VAR_5, VAR_6);

            ambiguous = true;

        }

        if (g_list_find_custom(minus_features, VAR_5, compare_string)) {

            error_report("warning: Ambiguous CPU model string. "

                         "Don't mix both \"-%s\" and \"%s=%s\"",

                         VAR_5, VAR_5, VAR_6);

            ambiguous = true;

        }



        

        if (!strcmp(VAR_5, "tsc-freq")) {

            int64_t tsc_freq;



            tsc_freq = qemu_strtosz_metric(VAR_6, NULL);

            if (tsc_freq < 0) {

                error_setg(VAR_2, "bad numerical value %s", VAR_6);

                return;

            }

            snprintf(VAR_8, sizeof(VAR_8), "%" PRId64, tsc_freq);

            VAR_6 = VAR_8;

            VAR_5 = "tsc-frequency";

        }



        prop = g_new0(typeof(*prop), 1);

        prop->driver = VAR_0;

        prop->property = g_strdup(VAR_5);

        prop->value = g_strdup(VAR_6);

        prop->VAR_2 = &error_fatal;

        qdev_prop_register_global(prop);

    }



    if (ambiguous) {

        error_report("warning: Compatibility of ambiguous CPU model "

                     "strings won't be kept on future QEMU versions");

    }

}

static void FUNC_0(const char *VAR_0, char *VAR_1,
Error **VAR_2)
{ char *VAR_3; static bool VAR_4; bool ambiguous = false; if (VAR_4) { return; } VAR_4 = true; if (!VAR_1) { return; } for (VAR_3 = strtok(VAR_1, ","); VAR_3; VAR_3 = strtok(NULL, ",")) { const char *VAR_5; const char *VAR_6 = NULL; char *VAR_7 = NULL; char VAR_8[32]; GlobalProperty *prop; if (VAR_3[0] == '+') { plus_features = g_list_append(plus_features,
g_strdup(VAR_3 + 1)); continue; } else if (VAR_3[0] == '-') { minus_features = g_list_append(minus_features,
g_strdup(VAR_3 + 1)); continue; } VAR_7 = strchr(VAR_3, '='); if (VAR_7) { *VAR_7++ = 0; VAR_6 = VAR_7; } else { VAR_6 = "on"; } feat2prop(VAR_3); VAR_5 = VAR_3; if (g_list_find_custom(plus_features, VAR_5, compare_string)) { error_report("warning: Ambiguous CPU model string. "
"Don't mix both \"+%s\" and \"%s=%s\"",
VAR_5, VAR_5, VAR_6); ambiguous = true; } if (g_list_find_custom(minus_features, VAR_5, compare_string)) { error_report("warning: Ambiguous CPU model string. "
"Don't mix both \"-%s\" and \"%s=%s\"",
VAR_5, VAR_5, VAR_6); ambiguous = true; } if (!strcmp(VAR_5, "tsc-freq")) { int64_t tsc_freq; tsc_freq = qemu_strtosz_metric(VAR_6, NULL); if (tsc_freq < 0) { error_setg(VAR_2, "bad numerical value %s", VAR_6); return; } snprintf(VAR_8, sizeof(VAR_8), "%" PRId64, tsc_freq); VAR_6 = VAR_8; VAR_5 = "tsc-frequency"; } prop = g_new0(typeof(*prop), 1); prop->driver = VAR_0; prop->property = g_strdup(VAR_5); prop->value = g_strdup(VAR_6); prop->VAR_2 = &error_fatal; qdev_prop_register_global(prop); } if (ambiguous) { error_report("warning: Compatibility of ambiguous CPU model "
"strings won't be kept on future QEMU versions"); } }