cpu->env.tsc_khz = value / 1000;
}
+/* Convert all '_' in a feature string option name to '-', to make feature
+ * name conform to QOM property naming rule, which uses '-' instead of '_'.
+ */
+static inline void feat2prop(char *s)
+{
+ while ((s = strchr(s, '_'))) {
+ *s = '-';
+ }
+}
+
static int cpu_x86_find_by_name(x86_def_t *x86_cpu_def, const char *cpu_model)
{
unsigned int i;
&minus_svm_features, &minus_7_0_ebx_features);
} else if ((val = strchr(featurestr, '='))) {
*val = 0; val++;
+ feat2prop(featurestr);
if (!strcmp(featurestr, "family")) {
char *err;
numvalue = strtoul(val, &err, 0);
x86_cpu_def->vendor3 |= ((uint8_t)val[i + 8]) << (8 * i);
}
x86_cpu_def->vendor_override = 1;
- } else if (!strcmp(featurestr, "model_id")) {
+ } else if (!strcmp(featurestr, "model-id")) {
pstrcpy(x86_cpu_def->model_id, sizeof(x86_cpu_def->model_id),
val);
- } else if (!strcmp(featurestr, "tsc_freq")) {
+ } else if (!strcmp(featurestr, "tsc-freq")) {
int64_t tsc_freq;
char *err;
goto error;
}
x86_cpu_def->tsc_khz = tsc_freq / 1000;
- } else if (!strcmp(featurestr, "hv_spinlocks")) {
+ } else if (!strcmp(featurestr, "hv-spinlocks")) {
char *err;
numvalue = strtoul(val, &err, 0);
if (!*val || *err) {