From: Andrew Jones Subject: Re: [PATCH v2][xend] save/restore cpu_weight and cpu_cap Date: Fri, 31 Jul 2009 14:37:01 +0200 Message-ID: <1249043821.3750.20.camel@turtle.usersys.redhat.com> References: <1249040776.3750.13.camel@turtle.usersys.redhat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-AB8wQhlEA1Mgl2ifl47i" Return-path: In-Reply-To: <1249040776.3750.13.camel@turtle.usersys.redhat.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --=-AB8wQhlEA1Mgl2ifl47i Content-Type: text/plain Content-Transfer-Encoding: 7bit Argh... I shouldn't cut+paste patches into email editors. Sending again without allowing evil auto-wrap to mess with it. Andrew --=-AB8wQhlEA1Mgl2ifl47i Content-Disposition: attachment; filename="vcpus-params-save-restore.patch" Content-Type: text/x-patch; name="vcpus-params-save-restore.patch"; charset="UTF-8" Content-Transfer-Encoding: 7bit # HG changeset patch # User Andrew Jones # Date 1249039326 -7200 # Node ID 5e4fdbc78430d50d9f66f2f199dfbb1368663613 # Parent 41b2c4e4f6746c638192b88ea37d3d25196850ad save/restore cpu_weight and cpu_cap This patch allows vcpus_params cpu_weight and cpu_cap to be saved and restored. Most the code to support this already existed, but the save path needed to be updated to explicitly save these params, and the restore path needed to be updated to resend the params down to the kernel. diff --git a/tools/python/xen/xend/XendConfig.py b/tools/python/xen/xend/XendConfig.py --- a/tools/python/xen/xend/XendConfig.py +++ b/tools/python/xen/xend/XendConfig.py @@ -1088,6 +1088,10 @@ if self.has_key(legacy) and self[legacy] not in (None, []): sxpr.append([legacy, self[legacy]]) + if self.has_key('vcpus_params'): + sxpr.append(['cpu_weight', int(self['vcpus_params'].get('weight', 256))]) + sxpr.append(['cpu_cap', int(self['vcpus_params'].get('cap', 0))]) + if self.has_key('security_label'): sxpr.append(['security_label', self['security_label']]) diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -2448,6 +2448,8 @@ raise VmError("Cpu cap out of range, valid range is from 0 to %s for specified number of vcpus" % (self.getVCpuCount() * 100)) + xc.sched_credit_domain_set(self.domid, weight, cap) + # Test whether the devices can be assigned with VT-d self.info.update_platform_pci() pci = self.info["platform"].get("pci") --=-AB8wQhlEA1Mgl2ifl47i Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=-AB8wQhlEA1Mgl2ifl47i--