Skip to contentSkip to conversation

Fix xm create command for wrong scheduler parameters

PATCH RESEND In review Masaki Kanno 2 participants 2 messages Feb 26, 2007

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 Fix xm create command for wrong scheduler parameters

Hi,

I resend the patch to solve the issue that I reported as follows.

http://lists.xensource.com/archives/html/xen-devel/2007-02/msg00180.html

The behavior of the xm create command isn't the specification, is it? If it is specification, I withdraw the patch. Could you possibly comment or apply the patch?

Best regards,
Kan

tools/python/xen/xend/XendDomain.py +1 -13
diff -r 2c3a13993b0d 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, 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
@@ -874,10 +874,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()
@@ -894,10 +890,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()
@@ -951,10 +943,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()
tools/python/xen/xend/XendDomainInfo.py +8 -1
diff -r 2c3a13993b0d tools/python/xen/xend/XendDomainInfo.py
@@ -396,11 +396,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-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw

On Mon, Feb 26, 2007 at 07:07:40PM +0900, Masaki Kanno wrote:

Content-Description: Mail message body

Quoted 4 lines

Hi,

I resend the patch to solve the issue that I reported as follows.

Quoted 8 lines

http://lists.xensource.com/archives/html/xen-devel/2007-02/msg00180.html

The behavior of the xm create command isn't the specification, is it? If it is specification, I withdraw the patch. Could you possibly comment or apply the patch?

Sorry, I thought I'd applied this one already, but clearly not. It's applied now.

Ewan.