Skip to contentSkip to conversation

Detect arch dynamically from uname instead of using hardcoded x86_64 value

PATCH In review Carlo Marcelo Arenas Belon 2 participants 2 messages Sep 16, 2007 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Detect arch dynamically from uname instead of using hardcoded x86_64 value

The following patch is part of a series of fixes used to allow for the use of the kvm python wrapper in Gentoo Linux.

In this case the value for the architecture used is retrieved from uname and used to identify the right qemu system binary name.

Carlo

---
 kvm |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
kvm +2 -1
index 0b509f6..d349efe 100755
@@ -184,7 +184,8 @@ bootdisk = 'c'
 if options.install:
     bootdisk = 'd'
 
-arch = 'x86_64'
+uname = os.uname()
+arch = uname[4]
 
 if arch == 'x86_64':
     cmd = 'qemu-system-' + arch
Signature · 7 lines
1.5.1.6


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
#1 lore raw
Quoted 18 lines · Carlo Marcelo Arenas Belon

The following patch is part of a series of fixes used to allow for the use of the kvm python wrapper in Gentoo Linux.

In this case the value for the architecture used is retrieved from uname and used to identify the right qemu system binary name.

Carlo

---
 kvm |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
kvm +0 -0
index 0b509f6..d349efe 100755

kvm bootdisk = 'c' · line 189

Quoted 7 lines
kvm +2 -1
@@ -184,7 +184,8 @@ bootdisk = 'c'
 if options.install:
     bootdisk = 'd'
 
-arch = 'x86_64'
+uname = os.uname()
+arch = uname[4]
 

We always compile kvm for the x86_64 target. So this will select a nonexisting binary.

Signature · 7 lines
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/