From: Paolo Bonzini Date: Fri, 27 Jan 2012 13:49:48 +0000 (+0100) Subject: qemu: detect arch correctly for KVM X-Git-Tag: v0.9.10-rc1~97 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4be541a6d92348b2bdf8bc29ade9685f1ab24692;p=thirdparty%2Flibvirt.git 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: Paolo Bonzini --- diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 1e3e8efc8a..0cc9f42fdd 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7003,8 +7003,10 @@ virDomainDefPtr qemuParseCommandLine(virCapsPtr caps, path = def->emulator; else path = strstr(def->emulator, "qemu"); - if (path && - STRPREFIX(path, "qemu-system-")) + if (def->virtType == VIR_DOMAIN_VIRT_KVM) + def->os.arch = strdup(caps->host.cpu->arch); + else if (path && + STRPREFIX(path, "qemu-system-")) def->os.arch = strdup(path + strlen("qemu-system-")); else def->os.arch = strdup("i686");