[PATCH] [Kimchi 0/4] adding 'console' parameter for s390x arch

From: Suresh Babu Angadi <sureshab@in.ibm.com> For s390x, console can be either sclp/virtio. This patch set enables, listing and update of 'console' parameter for templates and vms when running on s390x Suresh Babu Angadi (4): for s390x, console can be either virtio/sclp this patch adds additional parameter 'console' to templates for s390x architecture. this patch adds additional parameter 'console' to vms, for s390x architecture. added error codes and json attribute for update of 'console' API.json | 24 ++++++++++++++--- control/templates.py | 1 + i18n.py | 2 ++ model/templates.py | 6 +++++ model/vms.py | 75 +++++++++++++++++++++++++++++++++++----------------- osinfo.py | 4 +++ xmlutils/serial.py | 6 ++++- 7 files changed, 90 insertions(+), 28 deletions(-) -- 2.1.0

From: Suresh Babu Angadi <sureshab@in.ibm.com> for s390x, console can be either virtio/sclp this patch sets virtio as default console for s390x Signed-off-by: Suresh Babu Angadi <sureshab@in.ibm.com> --- osinfo.py | 4 ++++ xmlutils/serial.py | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/osinfo.py b/osinfo.py index 3e56d97..6069c46 100644 --- a/osinfo.py +++ b/osinfo.py @@ -163,6 +163,10 @@ def _get_tmpl_defaults(): tmpl_defaults['processor']['maxvcpus'] = 1 tmpl_defaults['graphics'] = {'type': 'vnc', 'listen': '127.0.0.1'} + # for s390x architecture, set default console as sclp + if host_arch in ['s390x', 's390']: + tmpl_defaults['console'] = 'virtio' + default_config = ConfigObj(tmpl_defaults) # Load template configuration file diff --git a/xmlutils/serial.py b/xmlutils/serial.py index c823ee6..a25bf23 100644 --- a/xmlutils/serial.py +++ b/xmlutils/serial.py @@ -38,6 +38,7 @@ def get_serial_xml(params): </console> For s390x + target type can be sclp/virtio <console type='pty'> <target type='sclp' port='0'/> </console> @@ -50,8 +51,11 @@ def get_serial_xml(params): return ET.tostring(console, encoding='utf-8', pretty_print=True) # for s390x elif params["arch"] in ["s390x"]: + # if params doesn't have console parameter, use virtio as default + console_type = params.get('console') \ + if params.get('console') else 'virtio' console = E.console(type="pty") - console.append(E.target(type="sclp", port='0')) + console.append(E.target(type=console_type, port='0')) return ET.tostring(console, encoding='utf-8', pretty_print=True) # for x else: -- 2.1.0

On 09/08/2016 07:33 AM, sureshab@linux.vnet.ibm.com wrote:
From: Suresh Babu Angadi <sureshab@in.ibm.com>
for s390x, console can be either virtio/sclp this patch sets virtio as default console for s390x
Signed-off-by: Suresh Babu Angadi <sureshab@in.ibm.com> --- osinfo.py | 4 ++++ xmlutils/serial.py | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/osinfo.py b/osinfo.py index 3e56d97..6069c46 100644 --- a/osinfo.py +++ b/osinfo.py @@ -163,6 +163,10 @@ def _get_tmpl_defaults(): tmpl_defaults['processor']['maxvcpus'] = 1 tmpl_defaults['graphics'] = {'type': 'vnc', 'listen': '127.0.0.1'}
+ # for s390x architecture, set default console as sclp + if host_arch in ['s390x', 's390']: + tmpl_defaults['console'] = 'virtio' +
This should be added to the modern/old dicts.
default_config = ConfigObj(tmpl_defaults)
# Load template configuration file diff --git a/xmlutils/serial.py b/xmlutils/serial.py index c823ee6..a25bf23 100644 --- a/xmlutils/serial.py +++ b/xmlutils/serial.py @@ -38,6 +38,7 @@ def get_serial_xml(params): </console>
For s390x + target type can be sclp/virtio <console type='pty'> <target type='sclp' port='0'/> </console> @@ -50,8 +51,11 @@ def get_serial_xml(params): return ET.tostring(console, encoding='utf-8', pretty_print=True) # for s390x elif params["arch"] in ["s390x"]:
+ # if params doesn't have console parameter, use virtio as default + console_type = params.get('console') \ + if params.get('console') else 'virtio'
The default type, from previous code, is sclp. So you only need to do: console_type = params.get('console', 'sclp')
console = E.console(type="pty") - console.append(E.target(type="sclp", port='0')) + console.append(E.target(type=console_type, port='0')) return ET.tostring(console, encoding='utf-8', pretty_print=True) # for x else:

On 09/13/2016 02:16 AM, Aline Manera wrote:
On 09/08/2016 07:33 AM, sureshab@linux.vnet.ibm.com wrote:
From: Suresh Babu Angadi <sureshab@in.ibm.com>
for s390x, console can be either virtio/sclp this patch sets virtio as default console for s390x
Signed-off-by: Suresh Babu Angadi <sureshab@in.ibm.com> --- osinfo.py | 4 ++++ xmlutils/serial.py | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/osinfo.py b/osinfo.py index 3e56d97..6069c46 100644 --- a/osinfo.py +++ b/osinfo.py @@ -163,6 +163,10 @@ def _get_tmpl_defaults(): tmpl_defaults['processor']['maxvcpus'] = 1 tmpl_defaults['graphics'] = {'type': 'vnc', 'listen': '127.0.0.1'}
+ # for s390x architecture, set default console as sclp + if host_arch in ['s390x', 's390']: + tmpl_defaults['console'] = 'virtio' +
This should be added to the modern/old dicts.
this is configurable parameter, adding in tmpl_defaults makes more sense. old/modren dict contains constants such as type of disk bus, interface model etc.
default_config = ConfigObj(tmpl_defaults)
# Load template configuration file diff --git a/xmlutils/serial.py b/xmlutils/serial.py index c823ee6..a25bf23 100644 --- a/xmlutils/serial.py +++ b/xmlutils/serial.py @@ -38,6 +38,7 @@ def get_serial_xml(params): </console>
For s390x + target type can be sclp/virtio <console type='pty'> <target type='sclp' port='0'/> </console> @@ -50,8 +51,11 @@ def get_serial_xml(params): return ET.tostring(console, encoding='utf-8', pretty_print=True) # for s390x elif params["arch"] in ["s390x"]:
+ # if params doesn't have console parameter, use virtio as default + console_type = params.get('console') \ + if params.get('console') else 'virtio'
The default type, from previous code, is sclp.
So you only need to do:
console_type = params.get('console', 'sclp')
the hypervisor default value for console is 'virtio', hence will make it console_type = params.get('console', 'virtio')
console = E.console(type="pty") - console.append(E.target(type="sclp", port='0')) + console.append(E.target(type=console_type, port='0')) return ET.tostring(console, encoding='utf-8', pretty_print=True) # for x else:
-- Regards, Suresh Babu Angadi

On 09/13/2016 03:45 AM, Suresh Babu Angadi wrote:
On 09/13/2016 02:16 AM, Aline Manera wrote:
On 09/08/2016 07:33 AM, sureshab@linux.vnet.ibm.com wrote:
From: Suresh Babu Angadi <sureshab@in.ibm.com>
for s390x, console can be either virtio/sclp this patch sets virtio as default console for s390x
Signed-off-by: Suresh Babu Angadi <sureshab@in.ibm.com> --- osinfo.py | 4 ++++ xmlutils/serial.py | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/osinfo.py b/osinfo.py index 3e56d97..6069c46 100644 --- a/osinfo.py +++ b/osinfo.py @@ -163,6 +163,10 @@ def _get_tmpl_defaults(): tmpl_defaults['processor']['maxvcpus'] = 1 tmpl_defaults['graphics'] = {'type': 'vnc', 'listen': '127.0.0.1'}
+ # for s390x architecture, set default console as sclp + if host_arch in ['s390x', 's390']: + tmpl_defaults['console'] = 'virtio' +
This should be added to the modern/old dicts.
this is configurable parameter, adding in tmpl_defaults makes more sense. old/modren dict contains constants such as type of disk bus, interface model etc.
default_config = ConfigObj(tmpl_defaults)
# Load template configuration file diff --git a/xmlutils/serial.py b/xmlutils/serial.py index c823ee6..a25bf23 100644 --- a/xmlutils/serial.py +++ b/xmlutils/serial.py @@ -38,6 +38,7 @@ def get_serial_xml(params): </console>
For s390x + target type can be sclp/virtio <console type='pty'> <target type='sclp' port='0'/> </console> @@ -50,8 +51,11 @@ def get_serial_xml(params): return ET.tostring(console, encoding='utf-8', pretty_print=True) # for s390x elif params["arch"] in ["s390x"]:
+ # if params doesn't have console parameter, use virtio as default + console_type = params.get('console') \ + if params.get('console') else 'virtio'
The default type, from previous code, is sclp.
So you only need to do:
console_type = params.get('console', 'sclp')
the hypervisor default value for console is 'virtio', hence will make it console_type = params.get('console', 'virtio')
By the current upstream code, the default is sclp. As it is the value used when generating the XML. If you change the default for virtio, make sure to test on x86 and Power.
console = E.console(type="pty") - console.append(E.target(type="sclp", port='0')) + console.append(E.target(type=console_type, port='0')) return ET.tostring(console, encoding='utf-8', pretty_print=True) # for x else:

On 09/13/2016 06:52 PM, Aline Manera wrote:
On 09/13/2016 03:45 AM, Suresh Babu Angadi wrote:
On 09/13/2016 02:16 AM, Aline Manera wrote:
On 09/08/2016 07:33 AM, sureshab@linux.vnet.ibm.com wrote:
From: Suresh Babu Angadi <sureshab@in.ibm.com>
for s390x, console can be either virtio/sclp this patch sets virtio as default console for s390x
Signed-off-by: Suresh Babu Angadi <sureshab@in.ibm.com> --- osinfo.py | 4 ++++ xmlutils/serial.py | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/osinfo.py b/osinfo.py index 3e56d97..6069c46 100644 --- a/osinfo.py +++ b/osinfo.py @@ -163,6 +163,10 @@ def _get_tmpl_defaults(): tmpl_defaults['processor']['maxvcpus'] = 1 tmpl_defaults['graphics'] = {'type': 'vnc', 'listen': '127.0.0.1'}
+ # for s390x architecture, set default console as sclp + if host_arch in ['s390x', 's390']: + tmpl_defaults['console'] = 'virtio' +
This should be added to the modern/old dicts.
this is configurable parameter, adding in tmpl_defaults makes more sense. old/modren dict contains constants such as type of disk bus, interface model etc.
default_config = ConfigObj(tmpl_defaults)
# Load template configuration file diff --git a/xmlutils/serial.py b/xmlutils/serial.py index c823ee6..a25bf23 100644 --- a/xmlutils/serial.py +++ b/xmlutils/serial.py @@ -38,6 +38,7 @@ def get_serial_xml(params): </console>
For s390x + target type can be sclp/virtio <console type='pty'> <target type='sclp' port='0'/> </console> @@ -50,8 +51,11 @@ def get_serial_xml(params): return ET.tostring(console, encoding='utf-8', pretty_print=True) # for s390x elif params["arch"] in ["s390x"]:
+ # if params doesn't have console parameter, use virtio as default + console_type = params.get('console') \ + if params.get('console') else 'virtio'
The default type, from previous code, is sclp.
So you only need to do:
console_type = params.get('console', 'sclp')
the hypervisor default value for console is 'virtio', hence will make it console_type = params.get('console', 'virtio')
By the current upstream code, the default is sclp. As it is the value used when generating the XML. If you change the default for virtio, make sure to test on x86 and Power.
Hi Aline, current upstream code for x86 and power is not affected. Only in case of s390x - default console is set to 'virtio' (earlier, for s390x arch - 'sclp' was used as default). I have tested on x86, current behavior is not affected. I have sent v2, please review.
console = E.console(type="pty") - console.append(E.target(type="sclp", port='0')) + console.append(E.target(type=console_type, port='0')) return ET.tostring(console, encoding='utf-8', pretty_print=True) # for x else:
-- Regards, Suresh Babu Angadi

From: Suresh Babu Angadi <sureshab@in.ibm.com> this patch adds additional parameter 'console' to templates for s390x architecture. for s390x only, allow update of console to either sclp/virtio Signed-off-by: Suresh Babu Angadi <sureshab@in.ibm.com> --- control/templates.py | 1 + model/templates.py | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/control/templates.py b/control/templates.py index 0406c6b..ca36be3 100644 --- a/control/templates.py +++ b/control/templates.py @@ -76,5 +76,6 @@ class Template(Resource): } if os.uname()[4] in ['s390x', 's390']: info['interfaces'] = self.info.get('interfaces', []) + info['console'] = self.info.get('console', '') return info diff --git a/model/templates.py b/model/templates.py index 04e6626..faf1fd5 100644 --- a/model/templates.py +++ b/model/templates.py @@ -65,6 +65,9 @@ class TemplatesModel(object): interfaces = params.get('interfaces', []) validate_interfaces(interfaces) + if os.uname()[4] not in ['s390x', 's390'] and 'console' in params: + raise InvalidParameter("KCHTMPL0040E") + # get source_media source_media = params.pop("source_media") @@ -229,6 +232,9 @@ class TemplateModel(object): interfaces = params.get('interfaces', []) validate_interfaces(interfaces) + if os.uname()[4] not in ['s390x', 's390'] and 'console' in params: + raise InvalidParameter("KCHTMPL0040E") + # Merge graphics settings graph_args = params.get('graphics') if graph_args: -- 2.1.0

On 09/08/2016 07:34 AM, sureshab@linux.vnet.ibm.com wrote:
From: Suresh Babu Angadi <sureshab@in.ibm.com>
this patch adds additional parameter 'console' to templates for s390x architecture.
for s390x only, allow update of console to either sclp/virtio
Signed-off-by: Suresh Babu Angadi <sureshab@in.ibm.com> --- control/templates.py | 1 + model/templates.py | 6 ++++++ 2 files changed, 7 insertions(+)
diff --git a/control/templates.py b/control/templates.py index 0406c6b..ca36be3 100644 --- a/control/templates.py +++ b/control/templates.py @@ -76,5 +76,6 @@ class Template(Resource): } if os.uname()[4] in ['s390x', 's390']: info['interfaces'] = self.info.get('interfaces', [])
+ info['console'] = self.info.get('console', '')
Why do you need to expose that info to the API? Any plans to allow user to change that or should that info be displayed on UI?
return info diff --git a/model/templates.py b/model/templates.py index 04e6626..faf1fd5 100644 --- a/model/templates.py +++ b/model/templates.py @@ -65,6 +65,9 @@ class TemplatesModel(object): interfaces = params.get('interfaces', []) validate_interfaces(interfaces)
+ if os.uname()[4] not in ['s390x', 's390'] and 'console' in params: + raise InvalidParameter("KCHTMPL0040E") + # get source_media source_media = params.pop("source_media")
@@ -229,6 +232,9 @@ class TemplateModel(object): interfaces = params.get('interfaces', []) validate_interfaces(interfaces)
+ if os.uname()[4] not in ['s390x', 's390'] and 'console' in params: + raise InvalidParameter("KCHTMPL0040E") + # Merge graphics settings graph_args = params.get('graphics') if graph_args:

On 09/12/2016 05:52 PM, Aline Manera wrote:
On 09/08/2016 07:34 AM, sureshab@linux.vnet.ibm.com wrote:
From: Suresh Babu Angadi <sureshab@in.ibm.com>
this patch adds additional parameter 'console' to templates for s390x architecture.
for s390x only, allow update of console to either sclp/virtio
Signed-off-by: Suresh Babu Angadi <sureshab@in.ibm.com> --- control/templates.py | 1 + model/templates.py | 6 ++++++ 2 files changed, 7 insertions(+)
diff --git a/control/templates.py b/control/templates.py index 0406c6b..ca36be3 100644 --- a/control/templates.py +++ b/control/templates.py @@ -76,5 +76,6 @@ class Template(Resource): } if os.uname()[4] in ['s390x', 's390']: info['interfaces'] = self.info.get('interfaces', [])
+ info['console'] = self.info.get('console', '')
Why do you need to expose that info to the API? Any plans to allow user to change that or should that info be displayed on UI?
I've juts gotten the answers in the subsequent patches. Please, join this patch with the 3 and 4 as they are related to the same thing. Also add meaningful commit message and description, so who is reviewing the patch can easily understand the proposal of it.
return info diff --git a/model/templates.py b/model/templates.py index 04e6626..faf1fd5 100644 --- a/model/templates.py +++ b/model/templates.py @@ -65,6 +65,9 @@ class TemplatesModel(object): interfaces = params.get('interfaces', []) validate_interfaces(interfaces)
+ if os.uname()[4] not in ['s390x', 's390'] and 'console' in params: + raise InvalidParameter("KCHTMPL0040E") + # get source_media source_media = params.pop("source_media")
@@ -229,6 +232,9 @@ class TemplateModel(object): interfaces = params.get('interfaces', []) validate_interfaces(interfaces)
+ if os.uname()[4] not in ['s390x', 's390'] and 'console' in params: + raise InvalidParameter("KCHTMPL0040E") + # Merge graphics settings graph_args = params.get('graphics') if graph_args:
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel

From: Suresh Babu Angadi <sureshab@in.ibm.com> this patch adds additional parameter 'console' to vms, for s390x architecture. for s390x only, allow update of console to either sclp/virtio Signed-off-by: Suresh Babu Angadi <sureshab@in.ibm.com> --- model/vms.py | 75 +++++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 51 insertions(+), 24 deletions(-) diff --git a/model/vms.py b/model/vms.py index b889166..fcb8190 100644 --- a/model/vms.py +++ b/model/vms.py @@ -85,7 +85,7 @@ VM_ONLINE_UPDATE_PARAMS = ['graphics', 'groups', 'memory', 'users'] # update parameters which are updatable when the VM is offline VM_OFFLINE_UPDATE_PARAMS = ['cpu_info', 'graphics', 'groups', 'memory', 'name', 'users', 'bootorder', 'bootmenu', - 'description', 'title'] + 'description', 'title', 'console'] XPATH_DOMAIN_DISK = "/domain/devices/disk[@device='disk']/source/@file" XPATH_DOMAIN_DISK_BY_FILE = "./devices/disk[@device='disk']/source[@file='%s']" @@ -96,6 +96,7 @@ XPATH_DOMAIN_MEMORY = '/domain/memory' XPATH_DOMAIN_MEMORY_UNIT = '/domain/memory/@unit' XPATH_DOMAIN_UUID = '/domain/uuid' XPATH_DOMAIN_DEV_CPU_ID = '/domain/devices/spapr-cpu-socket/@id' +XPATH_DOMAIN_CONSOLE_TARGET = "/domain/devices/console/target/@type" XPATH_BOOT = 'os/boot/@dev' XPATH_BOOTMENU = 'os/bootmenu/@enable' @@ -109,6 +110,7 @@ XPATH_TITLE = './title' XPATH_TOPOLOGY = './cpu/topology' XPATH_VCPU = './vcpu' XPATH_MAX_MEMORY = './maxMemory' +XPATH_CONSOLE_TARGET = "./devices/console/target" # key: VM name; value: lock object vm_locks = {} @@ -263,6 +265,9 @@ class VMModel(object): return sockets and cores and threads def update(self, name, params): + if platform.machine() not in ['s390x', 's390'] and\ + 'console' in params: + raise InvalidParameter('KCHTMPL0040E') lock = vm_locks.get(name) if lock is None: lock = threading.Lock() @@ -793,6 +798,19 @@ class VMModel(object): # update <os> return ET.tostring(et) + def _update_s390x_console(self, xml, params): + if xpath_get_text(xml, XPATH_DOMAIN_CONSOLE_TARGET): + # if console is defined, update console + return xml_item_update(xml, XPATH_CONSOLE_TARGET, + params.get('console'), 'type') + # if console is not defined earlier, add console + console = E.console(type="pty") + console.append(E.target(type=params.get('console'), port='0')) + et = ET.fromstring(xml) + devices = et.find('devices') + devices.append(console) + return ET.tostring(et) + def _static_vm_update(self, vm_name, dom, params): old_xml = new_xml = dom.XMLDesc(libvirt.VIR_DOMAIN_XML_SECURE) params = copy.deepcopy(params) @@ -861,6 +879,9 @@ class VMModel(object): if "bootorder" or "bootmenu" in params: new_xml = self._update_bootorder(new_xml, params) + if platform.machine() in ['s390', 's390x'] and params.get('console'): + new_xml = self._update_s390x_console(new_xml, params) + snapshots_info = [] conn = self.conn.get() try: @@ -1303,29 +1324,35 @@ class VMModel(object): bootmenu = "yes" if "yes" in xpath_get_text(xml, XPATH_BOOTMENU) \ else "no" - return {'name': name, - 'title': "".join(xpath_get_text(xml, XPATH_TITLE)), - 'description': "".join(xpath_get_text(xml, XPATH_DESCRIPTION)), - 'state': state, - 'stats': res, - 'uuid': dom.UUIDString(), - 'memory': {'current': memory, 'maxmemory': maxmemory}, - 'cpu_info': cpu_info, - 'screenshot': screenshot, - 'icon': icon, - # (type, listen, port, passwd, passwdValidTo) - 'graphics': {"type": graphics[0], - "listen": graphics[1], - "port": graphics_port, - "passwd": graphics[3], - "passwdValidTo": graphics[4]}, - 'users': users, - 'groups': groups, - 'access': 'full', - 'persistent': True if dom.isPersistent() else False, - 'bootorder': boot, - 'bootmenu': bootmenu - } + vm_info = {'name': name, + 'title': "".join(xpath_get_text(xml, XPATH_TITLE)), + 'description': + "".join(xpath_get_text(xml, XPATH_DESCRIPTION)), + 'state': state, + 'stats': res, + 'uuid': dom.UUIDString(), + 'memory': {'current': memory, 'maxmemory': maxmemory}, + 'cpu_info': cpu_info, + 'screenshot': screenshot, + 'icon': icon, + # (type, listen, port, passwd, passwdValidTo) + 'graphics': {"type": graphics[0], + "listen": graphics[1], + "port": graphics_port, + "passwd": graphics[3], + "passwdValidTo": graphics[4]}, + 'users': users, + 'groups': groups, + 'access': 'full', + 'persistent': True if dom.isPersistent() else False, + 'bootorder': boot, + 'bootmenu': bootmenu + } + if platform.machine() in ['s390', 's390x']: + vm_console = xpath_get_text(xml, XPATH_DOMAIN_CONSOLE_TARGET) + vm_info['console'] = vm_console[0] if vm_console else '' + + return vm_info def _vm_get_disk_paths(self, dom): xml = dom.XMLDesc(0) -- 2.1.0

From: Suresh Babu Angadi <sureshab@in.ibm.com> added error codes and json attribute for update of 'console' Signed-off-by: Suresh Babu Angadi <sureshab@in.ibm.com> --- API.json | 24 +++++++++++++++++++++--- i18n.py | 2 ++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/API.json b/API.json index 9ad60a2..15a348c 100644 --- a/API.json +++ b/API.json @@ -414,7 +414,13 @@ } }, "cpu_info": { "$ref": "#/kimchitype/cpu_info" }, - "memory": { "$ref": "#/kimchitype/memory" } + "memory": { "$ref": "#/kimchitype/memory" }, + "console": { + "description": "type of the console attached to the guest in s390x architecture", + "type": "string", + "pattern": "^sclp|virtio$", + "error": "KCHTMPL0041E" + } }, "additionalProperties": false }, @@ -671,7 +677,13 @@ "items": { "type": "string" } }, "graphics": { "$ref": "#/kimchitype/graphics" }, - "cpu_info": { "$ref": "#/kimchitype/cpu_info" } + "cpu_info": { "$ref": "#/kimchitype/cpu_info" }, + "console": { + "description": "type of the console attached to the guest in s390x architecture", + "type": "string", + "pattern": "^sclp|virtio$", + "error": "KCHTMPL0041E" + } }, "additionalProperties": false, "error": "KCHAPI0001E" @@ -844,7 +856,13 @@ "items": { "type": "string" } }, "graphics": { "$ref": "#/kimchitype/graphics" }, - "cpu_info": { "$ref": "#/kimchitype/cpu_info" } + "cpu_info": { "$ref": "#/kimchitype/cpu_info" }, + "console": { + "description": "type of the console attached to the guest in s390x architecture", + "type": "string", + "pattern": "^sclp|virtio$", + "error": "KCHTMPL0041E" + } }, "additionalProperties": false, "error": "KCHAPI0001E" diff --git a/i18n.py b/i18n.py index 47c829e..1684dc4 100644 --- a/i18n.py +++ b/i18n.py @@ -203,6 +203,8 @@ messages = { "KCHTMPL0037E": _("Interfaces should be list of interfaces. Each interface should have name, type and mode(optional, only applicable for interfcae type 'macvtap'."), "KCHTMPL0038E": _("Interface expects an object with parameters: 'name', 'type' and 'mode'. Name should be name of host network interface (Ethernet, Bond, VLAN) for type 'macvtap' or the name of host openvswitch bridge interface for type 'ovs'. Mode (optional) is only applicable for interface type 'macvtap' to indicates whether packets will be delivered directly to target device (bridge) or to the external bridge (vepa-capable bridge)."), "KCHTMPL0039E": _("Interfaces parameter only supported on s390x or s390 architecture."), + "KCHTMPL0040E": _("console parameter is only supported for s390x/s390 architecture."), + "KCHTMPL0041E": _("invalid console type, supported types are sclp/virtio."), "KCHPOOL0001E": _("Storage pool %(name)s already exists"), "KCHPOOL0002E": _("Storage pool %(name)s does not exist"), -- 2.1.0

Hi Suresh, Please, add a meaningful commit message for each patch. Every patch named as "adding console parameter for s390x arch" does seem right to me. If so, why do you need 4 patch instead of one? Regards, Aline Manera On 09/08/2016 07:33 AM, sureshab@linux.vnet.ibm.com wrote:
From: Suresh Babu Angadi <sureshab@in.ibm.com>
For s390x, console can be either sclp/virtio. This patch set enables, listing and update of 'console' parameter for templates and vms when running on s390x
Suresh Babu Angadi (4): for s390x, console can be either virtio/sclp this patch adds additional parameter 'console' to templates for s390x architecture. this patch adds additional parameter 'console' to vms, for s390x architecture. added error codes and json attribute for update of 'console'
API.json | 24 ++++++++++++++--- control/templates.py | 1 + i18n.py | 2 ++ model/templates.py | 6 +++++ model/vms.py | 75 +++++++++++++++++++++++++++++++++++----------------- osinfo.py | 4 +++ xmlutils/serial.py | 6 ++++- 7 files changed, 90 insertions(+), 28 deletions(-)

Hi Suresh,
Please, add a meaningful commit message for each patch. Every patch named as "adding console parameter for s390x arch" does seem right to me. If so, why do you need 4 patch instead of one?
On 09/13/2016 02:12 AM, Aline Manera wrote: this patch adds console option for templates and vms api. I will prepare two patches and send it with appropriate commit message
Regards, Aline Manera
On 09/08/2016 07:33 AM, sureshab@linux.vnet.ibm.com wrote:
From: Suresh Babu Angadi <sureshab@in.ibm.com>
For s390x, console can be either sclp/virtio. This patch set enables, listing and update of 'console' parameter for templates and vms when running on s390x
Suresh Babu Angadi (4): for s390x, console can be either virtio/sclp this patch adds additional parameter 'console' to templates for s390x architecture. this patch adds additional parameter 'console' to vms, for s390x architecture. added error codes and json attribute for update of 'console'
API.json | 24 ++++++++++++++--- control/templates.py | 1 + i18n.py | 2 ++ model/templates.py | 6 +++++ model/vms.py | 75 +++++++++++++++++++++++++++++++++++----------------- osinfo.py | 4 +++ xmlutils/serial.py | 6 ++++- 7 files changed, 90 insertions(+), 28 deletions(-)
-- Regards, Suresh Babu Angadi
participants (3)
-
Aline Manera
-
Suresh Babu Angadi
-
sureshab@linux.vnet.ibm.com