Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 133157 Details for
Bug 157987
KVM user space (new ebuild)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
updated kvm (python wrapper) patch for kvm 46
kvm-46-kvm.patch (text/plain), 3.36 KB, created by
Carlo Marcelo Arenas Belon
on 2007-10-11 16:34:35 UTC
(
hide
)
Description:
updated kvm (python wrapper) patch for kvm 46
Filename:
MIME Type:
Creator:
Carlo Marcelo Arenas Belon
Created:
2007-10-11 16:34:35 UTC
Size:
3.36 KB
patch
obsolete
>--- kvm-46/kvm 2007-10-09 11:43:12.000000000 -0700 >+++ kvm-46/kvm 2007-10-11 05:56:37.000000000 -0700 >@@ -15,9 +15,11 @@ > self.readfp(file, filename) > > config = ShellConfigParser() >-config.read('config.mak') >+config.read('/etc/kvm/config.mak') > > external_module = config.get('shell', 'want_module') >+prefix = config.get('shell', 'prefix') >+kerneldir = config.get('shell', 'kerneldir').replace('build', 'misc') > privileged = os.getuid() == 0 > > optparser = optparse.OptionParser() >@@ -55,6 +57,12 @@ > default = not privileged, > ) > >+optparser.add_option('--bridge', >+ help = 'use this device to build the bridge', >+ dest = 'bridge', >+ default = None, >+ ) >+ > optparser.add_option('--mac', > help = 'use this specific mac addr', > dest = 'mac', >@@ -119,7 +127,7 @@ > action = 'store_false', > default = True, > dest = 'irqchip', >- help = 'avoid using in-kernel irqchip', >+ help = 'disable KVM kernel mode PIC/IOAPIC/LAPIC', > ) > > optparser.add_option('-n', '--dry-run', >@@ -148,7 +156,7 @@ > > def insert_module(module): > if os.spawnl(os.P_WAIT, '/sbin/insmod', 'insmod', >- 'kernel/%s.ko' % (module,)) != 0: >+ kerneldir + '/%s.ko' % (module,)) != 0: > raise Exception('failed to load kvm module') > > def probe_module(module): >@@ -183,7 +191,7 @@ > disk = options.image > if options.install: > (status, output) = commands.getstatusoutput( >- 'qemu/qemu-img create -f qcow2 "%s" 30G' % disk) >+ 'qemu-img create -f qcow2 "%s" 30G' % disk) > if status: > raise Exception, output > >@@ -191,14 +199,15 @@ > if options.install: > bootdisk = 'd' > >+# kvm always compiles for the x86_64 target > arch = 'x86_64' > > if arch == 'x86_64': >- cmd = 'qemu-system-' + arch >+ cmd = 'kvm-system-' + arch > else: >- cmd = 'qemu' >+ cmd = 'kvm-system-i386' > >-local_cmd = 'qemu/' + arch + '-softmmu/' + cmd >+local_cmd = prefix + '/bin/' + cmd > if os.access(local_cmd, os.F_OK): > cmd = local_cmd > else: >@@ -226,15 +235,31 @@ > if not options.irqchip: > qemu_args += ('-no-kvm-irqchip',) > >+def getmac(interface): >+ if os.access('/sbin/ip', os.F_OK): >+ for line in commands.getoutput('/sbin/ip link show ' + interface).splitlines(): >+ m = re.match(r'.*link/ether (..:..:..:..:..:..).*', line) >+ if m: >+ mac = m.group(1) >+ return mac >+ else: >+ for line in commands.getoutput('/sbin/ifconfig ' + interface).splitlines(): >+ m = re.match(r'.*HWaddr (..:..:..:..:..:..)', line) >+ if m: >+ mac = m.group(1) >+ return mac >+ return False >+ > if not options.notap: >+ bridge = options.bridge >+ if not bridge: >+ bridge = 'eth0' >+ > mac = options.mac > if not mac: >- for line in commands.getoutput('/sbin/ip link show eth0').splitlines(): >- m = re.match(r'.*link/ether (..:..:..:..:..:..).*', line) >- if m: >- mac = m.group(1) >+ mac = getmac(bridge) > if not mac: >- raise Exception, 'Unable to determine eth0 mac address' >+ raise Exception, 'Unable to determine ' + bridge + ' mac address' > mac_components = mac.split(':') > mac_components[0] = 'a0' > mac = ':'.join(mac_components)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 157987
:
108867
|
109180
|
109596
|
109612
|
109613
|
109614
|
109615
|
109929
|
110542
|
110544
|
111591
|
111593
|
111594
|
111721
|
111722
|
111725
|
111726
|
111727
|
111730
|
111731
|
111732
|
117585
|
117587
|
117589
|
117590
|
117592
|
117594
|
117595
|
117596
|
117597
|
119450
|
119452
|
119454
|
120155
|
120283
|
120488
|
121167
|
121170
|
121172
|
121174
|
121176
|
121177
|
121179
|
121181
|
121183
|
124934
|
124936
|
124937
|
124939
|
125905
|
125989
|
125991
|
125993
|
125994
|
125996
|
126072
|
130577
|
131298
|
132381
|
132382
|
132422
|
132486
|
132866
|
132899
| 133157 |
133510
|
133515
|
133859
|
137185
|
137723
|
137946
|
139324
|
139488
|
140913