[PATCH v2 3/7] qemu: detect arch correctly for KVM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 src/qemu/qemu_command.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 1e3e8ef..fc337f7 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");
-- 
1.7.7.6


--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]