public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Yang, Sheng" <sheng.yang@intel.com>
To: Avi Kivity <avi@qumranet.com>
Cc: kvm@vger.kernel.org, kvm-ia64@vger.kernel.org
Subject: [PATCH] kvm: Fix kvm startup script
Date: Wed, 13 Aug 2008 15:43:59 +0800	[thread overview]
Message-ID: <200808131543.59763.sheng.yang@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1540 bytes --]

From 4993375c0d67fd5eb47891dee48300880aceff1e Mon Sep 17 00:00:00 2001
From: Sheng Yang <sheng.yang@intel.com>
Date: Wed, 13 Aug 2008 15:39:29 +0800
Subject: [PATCH] kvm: Fix kvm startup script


Signed-off-by: Sheng Yang <sheng.yang@intel.com>
---
 kvm |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/kvm b/kvm
index 2a7dc85..cb9ecf8 100755
--- a/kvm
+++ b/kvm
@@ -18,6 +18,14 @@ config = ShellConfigParser()
 config.read('config.mak')

 external_module = config.get('shell', 'want_module')
+
+arch = config.get('shell', 'arch')
+p = re.compile("^i\d86$")
+if len(p.findall(arch)):
+    arch = 'x86_64'
+if arch != 'x86_64' and arch != 'ia64':
+    raise Exception('unsupported architecture %s' % arch)
+
 privileged = os.getuid() == 0

 optparser = optparse.OptionParser()
@@ -153,8 +161,12 @@ def remove_module(module):
                 raise Exception('failed to remove %s module' % 
(module,))

 def insert_module(module):
+    if arch == 'x86_64':
+	archdir = 'x86'
+    elif arch == 'ia64':
+	archdir = 'ia64'
     if os.spawnl(os.P_WAIT, '/sbin/insmod', 'insmod',
-                 'kernel/%s.ko' % (module,)) != 0:
+                 'kernel/' + archdir + '/%s.ko' % (module,)) != 0:
         raise Exception('failed to load kvm module')

 def probe_module(module):
@@ -197,8 +209,6 @@ bootdisk = 'c'
 if options.install:
     bootdisk = 'd'

-arch = 'x86_64'
-
 if arch == 'x86_64':
     cmd = 'qemu-system-' + arch
 else:
--
1.5.6


[-- Attachment #2: 0001-kvm-Fix-kvm-startup-script.patch --]
[-- Type: text/x-diff, Size: 1544 bytes --]

From 4993375c0d67fd5eb47891dee48300880aceff1e Mon Sep 17 00:00:00 2001
From: Sheng Yang <sheng.yang@intel.com>
Date: Wed, 13 Aug 2008 15:39:29 +0800
Subject: [PATCH] kvm: Fix kvm startup script


Signed-off-by: Sheng Yang <sheng.yang@intel.com>
---
 kvm |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/kvm b/kvm
index 2a7dc85..cb9ecf8 100755
--- a/kvm
+++ b/kvm
@@ -18,6 +18,14 @@ config = ShellConfigParser()
 config.read('config.mak')
 
 external_module = config.get('shell', 'want_module')
+
+arch = config.get('shell', 'arch')
+p = re.compile("^i\d86$")
+if len(p.findall(arch)):
+    arch = 'x86_64'
+if arch != 'x86_64' and arch != 'ia64':
+    raise Exception('unsupported architecture %s' % arch)
+
 privileged = os.getuid() == 0
 
 optparser = optparse.OptionParser()
@@ -153,8 +161,12 @@ def remove_module(module):
                 raise Exception('failed to remove %s module' % (module,))
 
 def insert_module(module):
+    if arch == 'x86_64':
+	archdir = 'x86'
+    elif arch == 'ia64':
+	archdir = 'ia64'
     if os.spawnl(os.P_WAIT, '/sbin/insmod', 'insmod',
-                 'kernel/%s.ko' % (module,)) != 0:
+                 'kernel/' + archdir + '/%s.ko' % (module,)) != 0:
         raise Exception('failed to load kvm module')
 
 def probe_module(module):
@@ -197,8 +209,6 @@ bootdisk = 'c'
 if options.install:
     bootdisk = 'd'
 
-arch = 'x86_64'
-
 if arch == 'x86_64':
     cmd = 'qemu-system-' + arch
 else:
-- 
1.5.6


             reply	other threads:[~2008-08-13  7:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-13  7:43 Yang, Sheng [this message]
2008-08-13  8:08 ` [PATCH] kvm: Fix kvm startup script Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200808131543.59763.sheng.yang@intel.com \
    --to=sheng.yang@intel.com \
    --cc=avi@qumranet.com \
    --cc=kvm-ia64@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox