ia64/xen-unstable

changeset 13686:5d9b72e640e0

Fix 'xm create' and 'xm start' when SEDF scheduler is used.

If the Xen is running with the sedf scheduler, the following functions
do not call the domain_sched_credit_set().
- domain_create()
- domain_create_from_dict()
- domain_start()

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
author kfraser@localhost.localdomain
date Mon Jan 29 10:55:20 2007 +0000 (2007-01-29)
parents b2c1eeee2dcf
children 1b32e279ddef
files tools/python/xen/xend/XendDomain.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomain.py	Mon Jan 29 10:52:17 2007 +0000
     1.2 +++ b/tools/python/xen/xend/XendDomain.py	Mon Jan 29 10:55:20 2007 +0000
     1.3 @@ -32,7 +32,7 @@ import threading
     1.4  import xen.lowlevel.xc
     1.5  
     1.6  
     1.7 -from xen.xend import XendOptions, XendCheckpoint, XendDomainInfo
     1.8 +from xen.xend import XendOptions, XendCheckpoint, XendDomainInfo, XendNode
     1.9  from xen.xend.PrettyPrint import prettyprint
    1.10  from xen.xend.XendConfig import XendConfig
    1.11  from xen.xend.XendError import XendError, XendInvalidDomain, VmError
    1.12 @@ -868,9 +868,10 @@ class XendDomain:
    1.13              self._refresh()
    1.14  
    1.15              dominfo = XendDomainInfo.create(config)
    1.16 -            self.domain_sched_credit_set(dominfo.getDomid(),
    1.17 -                                         dominfo.getWeight(),
    1.18 -                                         dominfo.getCap())
    1.19 +            if XendNode.instance().xenschedinfo() == 'credit':
    1.20 +                self.domain_sched_credit_set(dominfo.getDomid(),
    1.21 +                                             dominfo.getWeight(),
    1.22 +                                             dominfo.getCap())
    1.23              return dominfo
    1.24          finally:
    1.25              self.domains_lock.release()
    1.26 @@ -887,9 +888,10 @@ class XendDomain:
    1.27              self._refresh()
    1.28  
    1.29              dominfo = XendDomainInfo.create_from_dict(config_dict)
    1.30 -            self.domain_sched_credit_set(dominfo.getDomid(),
    1.31 -                                         dominfo.getWeight(),
    1.32 -                                         dominfo.getCap())
    1.33 +            if XendNode.instance().xenschedinfo() == 'credit':
    1.34 +                self.domain_sched_credit_set(dominfo.getDomid(),
    1.35 +                                             dominfo.getWeight(),
    1.36 +                                             dominfo.getCap())
    1.37              return dominfo
    1.38          finally:
    1.39              self.domains_lock.release()
    1.40 @@ -943,9 +945,10 @@ class XendDomain:
    1.41                                   POWER_STATE_NAMES[dominfo.state])
    1.42              
    1.43              dominfo.start(is_managed = True)
    1.44 -            self.domain_sched_credit_set(dominfo.getDomid(),
    1.45 -                                         dominfo.getWeight(),
    1.46 -                                         dominfo.getCap())
    1.47 +            if XendNode.instance().xenschedinfo() == 'credit':
    1.48 +                self.domain_sched_credit_set(dominfo.getDomid(),
    1.49 +                                             dominfo.getWeight(),
    1.50 +                                             dominfo.getCap())
    1.51          finally:
    1.52              self.domains_lock.release()
    1.53          dominfo.waitForDevices()