mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 07:05:28 +00:00
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 <pbonzini@redhat.com>
This commit is contained in:
parent
ef00a05e51
commit
4be541a6d9
@ -7003,7 +7003,9 @@ 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)
|
||||||
|
def->os.arch = strdup(caps->host.cpu->arch);
|
||||||
|
else if (path &&
|
||||||
STRPREFIX(path, "qemu-system-"))
|
STRPREFIX(path, "qemu-system-"))
|
||||||
def->os.arch = strdup(path + strlen("qemu-system-"));
|
def->os.arch = strdup(path + strlen("qemu-system-"));
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user