# HG changeset patch
# User emellor@ewan
# Node ID a8ed2f186c23282c4acbe9f9268633fb936549b5
# Parent 63f06da6c5b0f2114bb4c854292898ecbc369254
Remove DBMap etc from XendDomainInfo, moving the handling of the domain root
and VM root totally into XendDomainInfo. The DBMap stuff was all cruft,
following the move to xstransact. Removing it may also help those suffering
from poor start-up times caused by a large store.
Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>
diff -r 63f06da6c5b0 -r a8ed2f186c23 tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py Tue Sep 27 13:36:58 2005
+++ b/tools/python/xen/xend/XendDomain.py Tue Sep 27 13:49:31 2005
@@ -34,7 +34,6 @@
from xen.xend.XendLogging import log
from xen.xend import scheduler
from xen.xend.server import relocate
-from xen.xend.xenstore import XenNode, DBMap
from xen.xend.xenstore.xstransact import xstransact
@@ -68,8 +67,6 @@
# So we stuff the XendDomain instance (self) into xroot's components.
xroot.add_component("xen.xend.XendDomain", self)
self.domains = XendDomainDict()
- self.vmroot = "/domain"
- self.dbmap = DBMap(db=XenNode(self.vmroot))
self.watchReleaseDomain()
self.refresh()
self.dom0_setup()
@@ -174,17 +171,6 @@
if notify:
eserver.inject('xend.domain.died', [info.getName(),
info.getDomid()])
- # XXX this should not be needed
- for domdb in self.dbmap.values():
- if not domdb.has_key("xend"):
- continue
- db = domdb.addChild("xend")
- try:
- domid = int(domdb["domid"].getData())
- except:
- domid = None
- if (domid is None) or (domid == id):
- domdb.delete()
def refresh(self):
@@ -230,7 +216,7 @@
@param config: configuration
@return: domain
"""
- dominfo = XendDomainInfo.create(self.dbmap.getPath(), config)
+ dominfo = XendDomainInfo.create(config)
self._add_domain(dominfo)
return dominfo
@@ -247,7 +233,7 @@
nested = sxp.child_value(config, 'config')
if nested:
config = nested
- return XendDomainInfo.restore(self.dbmap.getPath(), config)
+ return XendDomainInfo.restore(config)
def domain_restore(self, src, progress=False):
"""Restore a domain from file.
diff -r 63f06da6c5b0 -r a8ed2f186c23 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py Tue Sep 27 13:36:58 2005
+++ b/tools/python/xen/xend/XendDomainInfo.py Tue Sep 27 13:49:31 2005
@@ -154,17 +154,16 @@
MINIMUM_RESTART_TIME = 20
- def create(cls, dompath, config):
+ def create(cls, config):
"""Create a VM from a configuration.
- @param dompath: The path to all domain information
@param config configuration
@raise: VmError for invalid configuration
"""
- log.debug("XendDomainInfo.create(%s, ...)", dompath)
+ log.debug("XendDomainInfo.create(...)")
- vm = cls(getUuid(), dompath, cls.parseConfig(config))
+ vm = cls(getUuid(), cls.parseConfig(config))
vm.construct()
vm.refreshShutdown()
return vm
@@ -192,30 +191,27 @@
raise XendError(
'No vm/uuid path in store for existing domain %d' % domid)
- dompath = "/".join(dompath.split("/")[0:-1])
except Exception, exn:
log.warn(str(exn))
- dompath = DOMROOT
uuid = getUuid()
log.info("Recreating domain %d, uuid %s", domid, uuid)
- vm = cls(uuid, dompath, xeninfo, domid, True)
+ vm = cls(uuid, xeninfo, domid, True)
vm.refreshShutdown(xeninfo)
return vm
recreate = classmethod(recreate)
- def restore(cls, dompath, config, uuid = None):
+ def restore(cls, config, uuid = None):
"""Create a domain and a VM object to do a restore.
- @param dompath: The path to all domain information
@param config: domain configuration
@param uuid: uuid to use
"""
- log.debug("XendDomainInfo.restore(%s, %s, %s)", dompath, config, uuid)
+ log.debug("XendDomainInfo.restore(%s, %s)", config, uuid)
if not uuid:
uuid = getUuid()
@@ -225,7 +221,7 @@
except TypeError, exn:
raise VmError('Invalid ssidref in config: %s' % exn)
- vm = cls(uuid, dompath, cls.parseConfig(config),
+ vm = cls(uuid, cls.parseConfig(config),
xc.domain_create(ssidref = ssidref))
vm.create_channel()
vm.configure()
@@ -293,12 +289,12 @@
parseConfig = classmethod(parseConfig)
- def __init__(self, uuid, parentpath, info, domid = None, augment = False):
+ def __init__(self, uuid, info, domid = None, augment = False):
self.uuid = uuid
self.info = info
- self.path = parentpath + "/" + uuid
+ self.path = DOMROOT + "/" + uuid
if domid:
self.domid = domid
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|