提交 7b0ce42c 编写于 作者: L Li Zhang 提交者: Daniel P. Berrange

qemu: avoid users specifying CPU features for non-x86 plaftorm.

Currently, only X86 provides users CPU features with CPUID instruction.
If users specify the features for non-x86, it should tell users to
remove them.

This patch is to report one error if features are specified by
users for non-x86 platform.
Signed-off-by: NLi Zhang <zhlcindy@linux.vnet.ibm.com>
上级 46c9bce4
...@@ -10645,6 +10645,14 @@ qemuParseCommandLineCPU(virDomainDefPtr dom, ...@@ -10645,6 +10645,14 @@ qemuParseCommandLineCPU(virDomainDefPtr dom,
if (*feature == '\0') if (*feature == '\0')
goto syntax; goto syntax;
if (dom->os.arch != VIR_ARCH_X86_64 &&
dom->os.arch != VIR_ARCH_I686) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("%s platform doesn't support CPU features'"),
virArchToString(dom->os.arch));
goto cleanup;
}
if (STREQ(feature, "kvmclock")) { if (STREQ(feature, "kvmclock")) {
bool present = (policy == VIR_CPU_FEATURE_REQUIRE); bool present = (policy == VIR_CPU_FEATURE_REQUIRE);
size_t j; size_t j;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册