From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Yang, Sheng" Subject: [PATCH] kvm: Fix kvm startup script Date: Wed, 13 Aug 2008 15:43:59 +0800 Message-ID: <200808131543.59763.sheng.yang@intel.com> Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_/CpoI9ktPB1Iktk" Cc: kvm@vger.kernel.org, kvm-ia64@vger.kernel.org To: Avi Kivity Return-path: Received: from mga11.intel.com ([192.55.52.93]:49857 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752178AbYHMHlD (ORCPT ); Wed, 13 Aug 2008 03:41:03 -0400 Sender: kvm-owner@vger.kernel.org List-ID: --Boundary-00=_/CpoI9ktPB1Iktk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline =46rom 4993375c0d67fd5eb47891dee48300880aceff1e Mon Sep 17 00:00:00 2001 =46rom: Sheng Yang Date: Wed, 13 Aug 2008 15:39:29 +0800 Subject: [PATCH] kvm: Fix kvm startup script Signed-off-by: Sheng Yang =2D-- kvm | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-) diff --git a/kvm b/kvm index 2a7dc85..cb9ecf8 100755 =2D-- a/kvm +++ b/kvm @@ -18,6 +18,14 @@ config =3D ShellConfigParser() config.read('config.mak') external_module =3D config.get('shell', 'want_module') + +arch =3D config.get('shell', 'arch') +p =3D re.compile("^i\d86$") +if len(p.findall(arch)): + arch =3D 'x86_64' +if arch !=3D 'x86_64' and arch !=3D 'ia64': + raise Exception('unsupported architecture %s' % arch) + privileged =3D os.getuid() =3D=3D 0 optparser =3D optparse.OptionParser() @@ -153,8 +161,12 @@ def remove_module(module): raise Exception('failed to remove %s module' %=20 (module,)) def insert_module(module): + if arch =3D=3D 'x86_64': + archdir =3D 'x86' + elif arch =3D=3D 'ia64': + archdir =3D 'ia64' if os.spawnl(os.P_WAIT, '/sbin/insmod', 'insmod', =2D 'kernel/%s.ko' % (module,)) !=3D 0: + 'kernel/' + archdir + '/%s.ko' % (module,)) !=3D 0: raise Exception('failed to load kvm module') def probe_module(module): @@ -197,8 +209,6 @@ bootdisk =3D 'c' if options.install: bootdisk =3D 'd' =2Darch =3D 'x86_64' =2D if arch =3D=3D 'x86_64': cmd =3D 'qemu-system-' + arch else: =2D- 1.5.6 --Boundary-00=_/CpoI9ktPB1Iktk Content-Type: text/x-diff; charset="utf-8"; name="0001-kvm-Fix-kvm-startup-script.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0001-kvm-Fix-kvm-startup-script.patch" =46rom 4993375c0d67fd5eb47891dee48300880aceff1e Mon Sep 17 00:00:00 2001 =46rom: Sheng Yang Date: Wed, 13 Aug 2008 15:39:29 +0800 Subject: [PATCH] kvm: Fix kvm startup script Signed-off-by: Sheng Yang =2D-- kvm | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-) diff --git a/kvm b/kvm index 2a7dc85..cb9ecf8 100755 =2D-- a/kvm +++ b/kvm @@ -18,6 +18,14 @@ config =3D ShellConfigParser() config.read('config.mak') =20 external_module =3D config.get('shell', 'want_module') + +arch =3D config.get('shell', 'arch') +p =3D re.compile("^i\d86$") +if len(p.findall(arch)): + arch =3D 'x86_64' +if arch !=3D 'x86_64' and arch !=3D 'ia64': + raise Exception('unsupported architecture %s' % arch) + privileged =3D os.getuid() =3D=3D 0 =20 optparser =3D optparse.OptionParser() @@ -153,8 +161,12 @@ def remove_module(module): raise Exception('failed to remove %s module' % (module,)) =20 def insert_module(module): + if arch =3D=3D 'x86_64': + archdir =3D 'x86' + elif arch =3D=3D 'ia64': + archdir =3D 'ia64' if os.spawnl(os.P_WAIT, '/sbin/insmod', 'insmod', =2D 'kernel/%s.ko' % (module,)) !=3D 0: + 'kernel/' + archdir + '/%s.ko' % (module,)) !=3D 0: raise Exception('failed to load kvm module') =20 def probe_module(module): @@ -197,8 +209,6 @@ bootdisk =3D 'c' if options.install: bootdisk =3D 'd' =20 =2Darch =3D 'x86_64' =2D if arch =3D=3D 'x86_64': cmd =3D 'qemu-system-' + arch else: =2D-=20 1.5.6 --Boundary-00=_/CpoI9ktPB1Iktk--