[Kimchi-devel] [PATCH][Kimchi] Change PPC memory slots to 256
Lucio Correia
luciojhc at linux.vnet.ibm.com
Tue Jun 14 13:43:34 UTC 2016
Reviewed-By: Lucio Correia <luciojhc at linux.vnet.ibm.com>
On 13-06-2016 16:26, Rodrigo Trujillo wrote:
> PowerPC architecture now supports up to 256 memory devices for memory
> hotplug operations.
> ---
> model/vms.py | 7 ++++---
> osinfo.py | 6 +++---
> 2 files changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/model/vms.py b/model/vms.py
> index 58ff28d..795a251 100644
> --- a/model/vms.py
> +++ b/model/vms.py
> @@ -58,7 +58,7 @@ from wok.plugins.kimchi.model.utils import get_ascii_nonascii_name, get_vm_name
> from wok.plugins.kimchi.model.utils import get_metadata_node
> from wok.plugins.kimchi.model.utils import remove_metadata_node
> from wok.plugins.kimchi.model.utils import set_metadata_node
> -from wok.plugins.kimchi.osinfo import defaults
> +from wok.plugins.kimchi.osinfo import defaults, MEM_DEV_SLOTS
> from wok.plugins.kimchi.screenshot import VMScreenshot
> from wok.plugins.kimchi.utils import get_next_clone_name
> from wok.plugins.kimchi.utils import template_name_from_uri
> @@ -994,8 +994,9 @@ class VMModel(object):
> {'param': "Memory",
> 'mem': str(new_mem),
> 'alignment': str(PPC_MEM_ALIGN)})
> - # PPC suports only 32 memory slots
> - if len(xpath_get_text(xml, './devices/memory')) == 32:
> + # Check number of slots supported
> + if len(xpath_get_text(xml, './devices/memory')) == \
> + MEM_DEV_SLOTS[os.uname()[4]]:
> raise InvalidOperation('KCHVM0045E')
>
> if memory == 0:
> diff --git a/osinfo.py b/osinfo.py
> index d3909ad..4b89aac 100644
> --- a/osinfo.py
> +++ b/osinfo.py
> @@ -35,8 +35,8 @@ SUPPORTED_ARCHS = {'x86': ('i386', 'i686', 'x86_64'),
>
>
> # Memory devices slot limits by architecture
> -MEM_DEV_SLOTS = {'ppc64': 32,
> - 'ppc64le': 32,
> +MEM_DEV_SLOTS = {'ppc64': 256,
> + 'ppc64le': 256,
> 'x86_64': 256,
> 'i686': 256,
> 'i386': 256}
> @@ -184,7 +184,7 @@ def _get_tmpl_defaults():
> defaults['graphics'] = default_config.pop('graphics')
>
> # Setting default memory device slots
> - defaults['mem_dev_slots'] = MEM_DEV_SLOTS.get(os.uname()[4], 32)
> + defaults['mem_dev_slots'] = MEM_DEV_SLOTS.get(os.uname()[4], 256)
>
> return defaults
>
--
Lucio Correia
Software Engineer
IBM LTC Brazil
More information about the Kimchi-devel
mailing list