提交 4be541a6 编写于 作者: P Paolo Bonzini 提交者: Jiri Denemark

qemu: detect arch correctly for KVM

When running under KVM, the arch is usually set to i686 because
the name of the emulator is not qemu-system-x86_64.  Use the host
arch instead.
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 ef00a05e
...@@ -7003,8 +7003,10 @@ virDomainDefPtr qemuParseCommandLine(virCapsPtr caps, ...@@ -7003,8 +7003,10 @@ virDomainDefPtr qemuParseCommandLine(virCapsPtr caps,
path = def->emulator; path = def->emulator;
else else
path = strstr(def->emulator, "qemu"); path = strstr(def->emulator, "qemu");
if (path && if (def->virtType == VIR_DOMAIN_VIRT_KVM)
STRPREFIX(path, "qemu-system-")) def->os.arch = strdup(caps->host.cpu->arch);
else if (path &&
STRPREFIX(path, "qemu-system-"))
def->os.arch = strdup(path + strlen("qemu-system-")); def->os.arch = strdup(path + strlen("qemu-system-"));
else else
def->os.arch = strdup("i686"); def->os.arch = strdup("i686");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册