# HG changeset patch
# User Ewan Mellor <ewan@xxxxxxxxxxxxx>
# Date 1172504374 0
# Node ID 0b5da89e2b3dfb2c5c2e975cefbf24e6604edc19
# Parent ca1dd348054021b42d47af5a7f5ad808272d3233
Move credit scheduler configuration into XendDomainInfo, so that the domain
will be cleaned up correctly if the scheduler parameters are wrong.
Signed-off-by: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>
---
tools/python/xen/xend/XendDomain.py | 14 +-------------
tools/python/xen/xend/XendDomainInfo.py | 9 ++++++++-
2 files changed, 9 insertions(+), 14 deletions(-)
diff -r ca1dd3480540 -r 0b5da89e2b3d tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py Mon Feb 26 14:48:46 2007 +0000
+++ b/tools/python/xen/xend/XendDomain.py Mon Feb 26 15:39:34 2007 +0000
@@ -32,7 +32,7 @@ import xen.lowlevel.xc
import xen.lowlevel.xc
-from xen.xend import XendOptions, XendCheckpoint, XendDomainInfo, XendNode
+from xen.xend import XendOptions, XendCheckpoint, XendDomainInfo
from xen.xend.PrettyPrint import prettyprint
from xen.xend.XendConfig import XendConfig
from xen.xend.XendError import XendError, XendInvalidDomain, VmError
@@ -875,10 +875,6 @@ class XendDomain:
self._refresh()
dominfo = XendDomainInfo.create(config)
- if XendNode.instance().xenschedinfo() == 'credit':
- self.domain_sched_credit_set(dominfo.getDomid(),
- dominfo.getWeight(),
- dominfo.getCap())
return dominfo
finally:
self.domains_lock.release()
@@ -895,10 +891,6 @@ class XendDomain:
self._refresh()
dominfo = XendDomainInfo.create_from_dict(config_dict)
- if XendNode.instance().xenschedinfo() == 'credit':
- self.domain_sched_credit_set(dominfo.getDomid(),
- dominfo.getWeight(),
- dominfo.getCap())
return dominfo
finally:
self.domains_lock.release()
@@ -952,10 +944,6 @@ class XendDomain:
POWER_STATE_NAMES[dominfo.state])
dominfo.start(is_managed = True)
- if XendNode.instance().xenschedinfo() == 'credit':
- self.domain_sched_credit_set(dominfo.getDomid(),
- dominfo.getWeight(),
- dominfo.getCap())
finally:
self.domains_lock.release()
dominfo.waitForDevices()
diff -r ca1dd3480540 -r 0b5da89e2b3d tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py Mon Feb 26 14:48:46 2007 +0000
+++ b/tools/python/xen/xend/XendDomainInfo.py Mon Feb 26 15:39:34 2007 +0000
@@ -398,11 +398,18 @@ class XendDomainInfo:
XendTask.log_progress(81, 90, self._registerWatches)
XendTask.log_progress(91, 100, self.refreshShutdown)
+ xendomains = XendDomain.instance()
+ xennode = XendNode.instance()
+
# save running configuration if XendDomains believe domain is
# persistent
if is_managed:
- xendomains = XendDomain.instance()
xendomains.managed_config_save(self)
+
+ if xennode.xenschedinfo() == 'credit':
+ xendomains.domain_sched_credit_set(self.getDomid(),
+ self.getWeight(),
+ self.getCap())
except:
log.exception('VM start failed')
self.destroy()
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|