void spapr_cpu_parse_features(sPAPRMachineState *spapr)

{

    /*

     * Backwards compatibility hack:

     *

     *   CPUs had a "compat=" property which didn't make sense for

     *   anything except pseries.  It was replaced by "max-cpu-compat"

     *   machine option.  This supports old command lines like

     *       -cpu POWER8,compat=power7

     *   By stripping the compat option and applying it to the machine

     *   before passing it on to the cpu level parser.

     */

    gchar **inpieces;

    gchar *newprops;

    int i, j;

    gchar *compat_str = NULL;



    inpieces = g_strsplit(MACHINE(spapr)->cpu_model, ",", 0);



    /* inpieces[0] is the actual model string */

    i = 1;

    j = 1;

    while (inpieces[i]) {

        if (g_str_has_prefix(inpieces[i], "compat=")) {

            /* in case of multiple compat= options */

            g_free(compat_str);

            compat_str = inpieces[i];

        } else {

            j++;

        }



        i++;

        /* Excise compat options from list */

        inpieces[j] = inpieces[i];

    }



    if (compat_str) {

        char *val = compat_str + strlen("compat=");



        object_property_set_str(OBJECT(spapr), val, "max-cpu-compat",

                                &error_fatal);



    }



    newprops = g_strjoinv(",", inpieces);

    cpu_parse_cpu_model(TYPE_POWERPC_CPU, newprops);

    g_free(newprops);

    g_strfreev(inpieces);

}

void spapr_cpu_parse_features(sPAPRMachineState *spapr)

{

    



















    gchar **inpieces;

    gchar *newprops;

    int i, j;

    gchar *compat_str = NULL;



    inpieces = g_strsplit(MACHINE(spapr)->cpu_model, ",", 0);



    

    i = 1;

    j = 1;

    while (inpieces[i]) {

        if (g_str_has_prefix(inpieces[i], "compat=")) {

            

            g_free(compat_str);

            compat_str = inpieces[i];

        } else {

            j++;

        }



        i++;

        

        inpieces[j] = inpieces[i];

    }



    if (compat_str) {

        char *val = compat_str + strlen("compat=");



        object_property_set_str(OBJECT(spapr), val, "max-cpu-compat",

                                &error_fatal);



    }



    newprops = g_strjoinv(",", inpieces);

    cpu_parse_cpu_model(TYPE_POWERPC_CPU, newprops);

    g_free(newprops);

    g_strfreev(inpieces);

}

void FUNC_0(sPAPRMachineState *VAR_0)

{

    



















    gchar **inpieces;

    gchar *newprops;

    int VAR_1, VAR_2;

    gchar *compat_str = NULL;



    inpieces = g_strsplit(MACHINE(VAR_0)->cpu_model, ",", 0);



    

    VAR_1 = 1;

    VAR_2 = 1;

    while (inpieces[VAR_1]) {

        if (g_str_has_prefix(inpieces[VAR_1], "compat=")) {

            

            g_free(compat_str);

            compat_str = inpieces[VAR_1];

        } else {

            VAR_2++;

        }



        VAR_1++;

        

        inpieces[VAR_2] = inpieces[VAR_1];

    }



    if (compat_str) {

        char *VAR_3 = compat_str + strlen("compat=");



        object_property_set_str(OBJECT(VAR_0), VAR_3, "max-cpu-compat",

                                &error_fatal);



    }



    newprops = g_strjoinv(",", inpieces);

    cpu_parse_cpu_model(TYPE_POWERPC_CPU, newprops);

    g_free(newprops);

    g_strfreev(inpieces);

}

void FUNC_0(sPAPRMachineState *VAR_0)
{ gchar **inpieces; gchar *newprops; int VAR_1, VAR_2; gchar *compat_str = NULL; inpieces = g_strsplit(MACHINE(VAR_0)->cpu_model, ",", 0); VAR_1 = 1; VAR_2 = 1; while (inpieces[VAR_1]) { if (g_str_has_prefix(inpieces[VAR_1], "compat=")) { g_free(compat_str); compat_str = inpieces[VAR_1]; } else { VAR_2++; } VAR_1++; inpieces[VAR_2] = inpieces[VAR_1]; } if (compat_str) { char *VAR_3 = compat_str + strlen("compat="); object_property_set_str(OBJECT(VAR_0), VAR_3, "max-cpu-compat",
&error_fatal); } newprops = g_strjoinv(",", inpieces); cpu_parse_cpu_model(TYPE_POWERPC_CPU, newprops); g_free(newprops); g_strfreev(inpieces); }