[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 5/7] i386: Wrap QMP code in !CONFIG_USER_ONLY
From: |
Eduardo Habkost |
Subject: |
[PATCH v2 5/7] i386: Wrap QMP code in !CONFIG_USER_ONLY |
Date: |
Tue, 13 Oct 2020 19:04:55 -0400 |
The QMP code was never called by *-user, and we will add
machine-type-specific code there, so add #ifdefs to make it safe.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
target/i386/cpu.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index c78b2abfb8..bf4b4a4812 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -4171,6 +4171,7 @@ static X86CPUVersion x86_cpu_model_resolve_version(const
X86CPUModel *model,
return v;
}
+#ifndef CONFIG_USER_ONLY
/* Resolve CPU model alias to actual CPU model name */
static char *x86_cpu_model_resolve_alias(const X86CPUModel *model,
X86CPUVersion default_version)
@@ -4186,6 +4187,7 @@ static char *x86_cpu_model_resolve_alias(const
X86CPUModel *model,
}
return x86_cpu_versioned_model_name(model->cpudef, version);
}
+#endif
void x86_cpu_change_kvm_default(const char *prop, const char *value)
{
@@ -4838,6 +4840,7 @@ static void x86_cpu_get_unavailable_features(Object *obj,
Visitor *v,
visit_type_strList(v, "unavailable-features", &result, errp);
}
+#ifndef CONFIG_USER_ONLY
/* Check for missing features that may prevent the CPU class from
* running using the current machine and accelerator.
*/
@@ -4876,6 +4879,7 @@ static void
x86_cpu_class_check_missing_features(X86CPUClass *xcc,
object_unref(OBJECT(xc));
}
+#endif
/* Print all cpuid feature names in featureset
*/
@@ -4985,6 +4989,7 @@ void x86_cpu_list(void)
g_list_free(names);
}
+#ifndef CONFIG_USER_ONLY
static void x86_cpu_definition_entry(gpointer data, gpointer user_data)
{
ObjectClass *oc = data;
@@ -5025,6 +5030,7 @@ CpuDefinitionInfoList *qmp_query_cpu_definitions(Error
**errp)
g_slist_free(list);
return cpu_list;
}
+#endif
static uint64_t x86_cpu_get_supported_feature_word(FeatureWord w,
bool migratable_only)
--
2.28.0
- [PATCH v2 0/7] i386: Add `machine` parameter to query-cpu-definitions, Eduardo Habkost, 2020/10/13
- [PATCH v2 1/7] machine: machine_find_class() function, Eduardo Habkost, 2020/10/13
- [PATCH v2 2/7] i386: Add X86CPUModel.alias_of field, Eduardo Habkost, 2020/10/13
- [PATCH v2 4/7] i386: Add default_version parameter to CPU version functions, Eduardo Habkost, 2020/10/13
- [PATCH v2 3/7] i386: Replace x86_cpu_class_get_alias_of() with x86_cpu_model_resolve_alias(), Eduardo Habkost, 2020/10/13
- [PATCH v2 5/7] i386: Wrap QMP code in !CONFIG_USER_ONLY,
Eduardo Habkost <=
- [PATCH v2 6/7] i386: Don't use default_cpu_version inside x86_cpu_definition_entry(), Eduardo Habkost, 2020/10/13
- [PATCH v2 7/7] cpu: Add `machine` parameter to query-cpu-definitions, Eduardo Habkost, 2020/10/13