bitkeeper revision 1.1041.1.3 (40e2d6d53DAWaWA94SRVDG4lVOnpEA)

Merge xenbk@gandalf:/var/bk/xeno-unstable.bk
into wray-m-3.hpl.hp.com:/home/mjw/repos-bk/xeno-unstable.bk
This commit is contained in:
mjw@wray-m-3.hpl.hp.com committed 2004-06-30 15:05:57 +00:00
commit 43aae28d4e
23 files changed
+13 -5723

No files matched your search

+1
View File
@@ -1,3 +1,4 @@
import types
import sxp
class ArgError(StandardError):
+12 -11
View File
@@ -9,6 +9,7 @@ Author: Mike Wray <mike.wray@hpl.hp.com>
"""
import string
import types
import re
import sys
import os
@@ -283,7 +284,7 @@ def vm_restore(src, progress=0):
d = restorefn(state_file=src, progress=progress)
dom = int(d['dom'])
if dom < 0:
raise VMError('restore failed')
raise VmError('restore failed')
vmconfig = sxp.from_string(d['vmconfig'])
vm.config = sxp.child_value(vmconfig, 'config')
deferred = vm.dom_configure(dom)
@@ -611,7 +612,7 @@ class XendDomainInfo:
if not os.path.isfile(kernel):
raise VmError('Kernel image does not exist: %s' % kernel)
if ramdisk and not os.path.isfile(ramdisk):
raise VMError('Kernel ramdisk does not exist: %s' % ramdisk)
raise VmError('Kernel ramdisk does not exist: %s' % ramdisk)
print 'create-domain> init_domain...'
self.init_domain()
print 'create_domain>', 'dom=', self.dom
@@ -691,7 +692,7 @@ class XendDomainInfo:
"""
d = dom_get(dom)
if not d:
raise VMError("Domain not found: %d" % dom)
raise VmError("Domain not found: %d" % dom)
try:
self.setdom(dom)
self.name = d['name']
@@ -807,10 +808,10 @@ def vm_dev_vbd(vm, val, index):
vdev = index
uname = sxp.child_value(val, 'uname')
if not uname:
raise VMError('vbd: Missing uname')
raise VmError('vbd: Missing uname')
dev = sxp.child_value(val, 'dev')
if not dev:
raise VMError('vbd: Missing dev')
raise VmError('vbd: Missing dev')
mode = sxp.child_value(val, 'mode', 'r')
defer = make_disk(vm.dom, uname, dev, mode, vm.recreate)
def fn(vbd):
@@ -821,7 +822,7 @@ def vm_dev_vbd(vm, val, index):
return defer
def parse_pci(val):
if isinstance(val, StringType):
if isinstance(val, types.StringType):
radix = 10
if val.startswith('0x') or val.startswith('0X'):
radix = 16
@@ -833,24 +834,24 @@ def parse_pci(val):
def vm_dev_pci(vm, val, index):
bus = sxp.child_value(val, 'bus')
if not bus:
raise VMError('pci: Missing bus')
raise VmError('pci: Missing bus')
dev = sxp.child_value(val, 'dev')
if not dev:
raise VMError('pci: Missing dev')
raise VmError('pci: Missing dev')
func = sxp.child_value(val, 'func')
if not func:
raise VMError('pci: Missing func')
raise VmError('pci: Missing func')
try:
bus = parse_pci(bus)
dev = parse_pci(dev)
func = parse_pci(func)
except:
raise VMError('pci: invalid parameter')
raise VmError('pci: invalid parameter')
rc = xc.physdev_pci_access_modify(dom=vm.dom, bus=bus, dev=dev,
func=func, enable=1)
if rc < 0:
#todo non-fatal
raise VMError('pci: Failed to configure device: bus=%s dev=%s func=%s' %
raise VmError('pci: Failed to configure device: bus=%s dev=%s func=%s' %
(bus, dev, func))
return rc
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.