Skip to contentSkip to conversation

Fix xm create/start with sedf scheduler

PATCH New Masaki Kanno 1 participant 1 message Jan 29, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix xm create/start with sedf scheduler

Hi,

When I tested the Xen with the sedf scheduler, I was not able to create a VM. Error messages and xend.log are as follows.

xm create command:

 # xm create /xen/vm1.conf 
 Using config file "/xen/vm1.conf".
 Error: (22, 'Invalid argument')

[2007-01-29 17:01:22 5129] ERROR (XendDomain:1363) (22, 'Invalid argument') Traceback (most recent call last):
File "//usr/lib/python/xen/xend/XendDomain.py", line 1361, in domain_sched_credit_set
return xc.sched_credit_domain_set(dominfo.getDomid(), weight, cap)
Error: (22, 'Invalid argument')

xm start command:

 # xm new /xen/vm1.conf 
 Using config file "/xen/vm1.conf".
 # xm list
 Name                                      ID   Mem VCPUs      State   Time(s)
 Domain-0                                   0   747     2     r-----     75.0
 vm1                                            256     2                 0.0
 # xm start vm1
 Error: (22, 'Invalid argument')
 Usage: xm start <DomainName>

Start a Xend managed domain
-p, --paused Do not unpause domain after starting it

[2007-01-29 17:04:49 5129] ERROR (XendDomain:1363) (22, 'Invalid argument') Traceback (most recent call last):
File "//usr/lib/python/xen/xend/XendDomain.py", line 1361, in domain_sched_credit_set
return xc.sched_credit_domain_set(dominfo.getDomid(), weight, cap)
Error: (22, 'Invalid argument')

I fixed the issues. 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()

Best regards,
Kan

tools/python/xen/xend/XendDomain.py +13 -10
diff -r f8ddcb758117 tools/python/xen/xend/XendDomain.py
@@ -32,7 +32,7 @@ import xen.lowlevel.xc
 import xen.lowlevel.xc
 
 
-from xen.xend import XendOptions, XendCheckpoint, XendDomainInfo
+from xen.xend import XendOptions, XendCheckpoint, XendDomainInfo, XendNode
 from xen.xend.PrettyPrint import prettyprint
 from xen.xend.XendConfig import XendConfig
 from xen.xend.XendError import XendError, XendInvalidDomain, VmError
@@ -868,9 +868,10 @@ class XendDomain:
             self._refresh()
 
             dominfo = XendDomainInfo.create(config)
-            self.domain_sched_credit_set(dominfo.getDomid(),
-                                         dominfo.getWeight(),
-                                         dominfo.getCap())
+            if XendNode.instance().xenschedinfo() == 'credit':
+                self.domain_sched_credit_set(dominfo.getDomid(),
+                                             dominfo.getWeight(),
+                                             dominfo.getCap())
             return dominfo
         finally:
             self.domains_lock.release()
@@ -887,9 +888,10 @@ class XendDomain:
             self._refresh()
 
             dominfo = XendDomainInfo.create_from_dict(config_dict)
-            self.domain_sched_credit_set(dominfo.getDomid(),
-                                         dominfo.getWeight(),
-                                         dominfo.getCap())
+            if XendNode.instance().xenschedinfo() == 'credit':
+                self.domain_sched_credit_set(dominfo.getDomid(),
+                                             dominfo.getWeight(),
+                                             dominfo.getCap())
             return dominfo
         finally:
             self.domains_lock.release()
@@ -943,9 +945,10 @@ class XendDomain:
                                  POWER_STATE_NAMES[dominfo.state])
             
             dominfo.start(is_managed = True)
-            self.domain_sched_credit_set(dominfo.getDomid(),
-                                         dominfo.getWeight(),
-                                         dominfo.getCap())
+            if XendNode.instance().xenschedinfo() == 'credit':
+                self.domain_sched_credit_set(dominfo.getDomid(),
+                                             dominfo.getWeight(),
+                                             dominfo.getCap())
         finally:
             self.domains_lock.release()
         dominfo.waitForDevices()

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel