1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# Copyright (C) 2004 Mike Wray <mike.wray@hp.com>
from xen.xend import XendRoot
xroot = XendRoot.instance()
from SrvDir import SrvDir
class SrvRoot(SrvDir):
"""The root of the xend server.
"""
"""Server sub-components. Each entry is (name, class), where
'name' is the entry name and 'class' is the name of its class.
"""
#todo Get this list from the XendRoot config.
subdirs = [
('node', 'SrvNode' ),
('domain', 'SrvDomainDir' ),
('console', 'SrvConsoleDir' ),
('event', 'SrvEventDir' ),
('device', 'SrvDeviceDir' ),
('vnet', 'SrvVnetDir' ),
]
def __init__(self):
SrvDir.__init__(self)
for (name, klass) in self.subdirs:
self.add(name, klass)
for (name, klass) in self.subdirs:
self.get(name)
xroot.start()
|