mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
From reading xend code related to changing number of vcpus it appears setting the number of vcpus to a value greater than VCPUs_max is not allowed on a running domain. This restriction is not honored by setVCpuCount() in XendDomainInfo.py. Attached patch makes setVCpuCount() fail if vcpus > VCPUs_max and domain is running. Also, I think the changes should be reflected in managed config of running domain if in fact the domain is managed - so unconditionally call managed_config_save(). BTW, the original code is rather confusing. Essentially the same actions are taken regardless if self.info['VCPUs_max'] > vcpus, just the order of invocation is changed. But this doesn't seem to matter since self.info['VCPUs_live'] is not subsequently used. Signed-off-by: Jim Fehlig <jfehlig@novell.com>
The file test.py here is from the Zope project, and is Copyright (c) 2001, 2002 Zope Corporation and Contributors. This file is released under the Zope Public License, version 2.0, a copy of which is in the file ZPL-2.0.