<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<div class="moz-cite-prefix">On 27/01/2015 11:25, Paulo Ricardo Paz
Vital wrote:<br>
</div>
<blockquote
cite="mid:CAFe=of5n91xjOhs9Df2ky_+Wh_WVx78U2q796qvt3pebtNJTMw@mail.gmail.com"
type="cite">Aline, the point is not the kdb_bus used to configure
the keyboard, but the type.</blockquote>
<br>
You are right.<br>
<br>
<blockquote
cite="mid:CAFe=of5n91xjOhs9Df2ky_+Wh_WVx78U2q796qvt3pebtNJTMw@mail.gmail.com"
type="cite">
<div><br>
<div>Ramon, I guess you can update, on osinfo.py file, the
common_spec dictionary to add the kdb_type value - this will
be common to all cases. Then, you can add a new key into power
specs specific to ppc64le that have this different value.
Anyway, a little modification on vmtemplate.py will be
necessary to use the new variable/key.</div>
</div>
</blockquote>
<br>
+1<br>
<br>
<blockquote
cite="mid:CAFe=of5n91xjOhs9Df2ky_+Wh_WVx78U2q796qvt3pebtNJTMw@mail.gmail.com"
type="cite"><br>
<div class="gmail_quote">On Tue Jan 27 2015 at 2:14:15 PM Aline
Manera <<a moz-do-not-send="true"
href="mailto:alinefm@linux.vnet.ibm.com">alinefm@linux.vnet.ibm.com</a>>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
On 27/01/2015 10:38, Ramon Medeiros wrote:<br>
> Changes<br>
><br>
> v2:<br>
><br>
> Improve coding by removing duplicated actions<br>
> Fix typo<br>
><br>
> On LE systems, some changes on libvirt xml is needed. The
input device<br>
> for keyboard is not kbd anymore, the architecture is
still ppc64 and the<br>
> qemu binary is not qemu-kvm as in the other archs.<br>
><br>
> Signed-off-by: Ramon Medeiros <<a
moz-do-not-send="true"
href="mailto:ramonn@linux.vnet.ibm.com" target="_blank">ramonn@linux.vnet.ibm.com</a>><br>
> ---<br>
> src/kimchi/<a moz-do-not-send="true"
href="http://config.py.in" target="_blank">config.py.in</a>
| 11 +++++++++--<br>
> src/kimchi/osinfo.py | 6 +++++-<br>
> src/kimchi/vmtemplate.py | 11 +++++++++--<br>
> 3 files changed, 23 insertions(+), 5 deletions(-)<br>
><br>
> diff --git a/src/kimchi/<a moz-do-not-send="true"
href="http://config.py.in" target="_blank">config.py.in</a>
b/src/kimchi/<a moz-do-not-send="true"
href="http://config.py.in" target="_blank">config.py.in</a><br>
> index 83a5dd0..d5e0f6c 100644<br>
> --- a/src/kimchi/<a moz-do-not-send="true"
href="http://config.py.in" target="_blank">config.py.in</a><br>
> +++ b/src/kimchi/<a moz-do-not-send="true"
href="http://config.py.in" target="_blank">config.py.in</a><br>
> @@ -68,12 +68,19 @@ def find_qemu_binary(find_emulator=False):<br>
> raise Exception("Unable to get qemu binary
location: %s" % e)<br>
> try:<br>
> xml = connect.getCapabilities()<br>
> +<br>
> + # On Little Endian system, the qemu binary is<br>
> + # qemu-system-ppc64, not qemu-system-ppc64le as
expected<br>
> + arch = platform.machine()<br>
> + if arch == "ppc64le":<br>
> + arch = "ppc64"<br>
> +<br>
> if find_emulator:<br>
> expr = "/capabilities/guest/arch[@name='%s']\<br>
> - /emulator" % platform.machine()<br>
> + /emulator" % arch<br>
> else:<br>
> expr = "/capabilities/guest/arch[@name='%s']\<br>
> - /domain[@type='kvm']/emulator" %
platform.machine()<br>
> + /domain[@type='kvm']/emulator" %
arch<br>
> res = xpath_get_text(xml, expr)<br>
> location = res[0]<br>
> except Exception, e:<br>
> diff --git a/src/kimchi/osinfo.py b/src/kimchi/osinfo.py<br>
> index 0e16b50..9bfd148 100644<br>
> --- a/src/kimchi/osinfo.py<br>
> +++ b/src/kimchi/osinfo.py<br>
> @@ -29,7 +29,7 @@ from kimchi.config import paths<br>
><br>
><br>
> SUPPORTED_ARCHS = {'x86': ('i386', 'i686', 'x86_64'),<br>
> - 'power': ('ppc', 'ppc64')}<br>
> + 'power': ('ppc', 'ppc64', 'ppc64le')}<br>
<br>
In osinfo.py we have a dict for each supported arch.<br>
<br>
template_specs = {'x86': {'old': dict(common_spec,
disk_bus='ide',<br>
nic_model='e1000',<br>
sound_model='ich6'),<br>
'modern': dict(common_spec,
disk_bus='virtio',<br>
nic_model='virtio',<br>
sound_model='ich6')},<br>
'power': {'old': dict(common_spec,
disk_bus='scsi',<br>
nic_model='spapr-vlan',<br>
cdrom_bus='scsi',<br>
kbd_bus='usb',
mouse_bus='usb',<br>
tablet_bus='usb',
memory=1280),<br>
'modern': dict(common_spec,
disk_bus='virtio',<br>
nic_model='virtio',<br>
cdrom_bus='scsi', kbd_bus='usb',<br>
mouse_bus='usb',<br>
tablet_bus='usb',<br>
memory=1280)}}<br>
<br>
You should add the new ppc64le there with the right bus
values.<br>
So for ppc64el we should point the kbd_bus="keyboard"<br>
<br>
And vmtemplate.py will not change.<br>
<br>
><br>
><br>
> common_spec = {'cpus': 1, 'memory': 1024, 'disks':
[{'index': 0, 'size': 10}],<br>
> @@ -94,6 +94,10 @@ def lookup(distro, version):<br>
> params['os_version'] = version<br>
> arch = _get_arch()<br>
><br>
> + # set up arch to ppc64 instead of ppc64le due to
libvirt compatibility<br>
> + if params["arch"] == "ppc64le":<br>
> + params["arch"] = "ppc64"<br>
> +<br>
> if distro in modern_version_bases[arch]:<br>
> if LooseVersion(version) >= LooseVersion(<br>
> modern_version_bases[arch][distro]):<br>
> diff --git a/src/kimchi/vmtemplate.py
b/src/kimchi/vmtemplate.py<br>
> index e41a959..bcfbab6 100644<br>
> --- a/src/kimchi/vmtemplate.py<br>
> +++ b/src/kimchi/vmtemplate.py<br>
> @@ -245,9 +245,16 @@ class VMTemplate(object):<br>
> mouse = """<br>
> <input type='mouse'
bus='%(mouse_bus)s'/><br>
> """<br>
> +<br>
> + # PPC64EL does not uses kbd<br>
> + <a moz-do-not-send="true"
href="http://self.info" target="_blank">self.info</a>["kbd_type"]
= "kbd"<br>
> + if os.uname()[4] == "ppc64le":<br>
> + <a moz-do-not-send="true"
href="http://self.info" target="_blank">self.info</a>["kbd_type"]
= "keyboard"<br>
> +<br>
> keyboard = """<br>
> - <input type='kbd' bus='%(kbd_bus)s'>
</input><br>
> - """<br>
> + <input type='%(kbd_type)s'
bus='%(kbd_bus)s'> </input><br>
> + """<br>
> +<br>
> tablet = """<br>
> <input type='tablet'
bus='%(kbd_bus)s'> </input><br>
> """<br>
<br>
_______________________________________________<br>
Kimchi-devel mailing list<br>
<a moz-do-not-send="true" href="mailto:Kimchi-devel@ovirt.org"
target="_blank">Kimchi-devel@ovirt.org</a><br>
<a moz-do-not-send="true"
href="http://lists.ovirt.org/mailman/listinfo/kimchi-devel"
target="_blank">http://lists.ovirt.org/mailman/listinfo/kimchi-devel</a><br>
</blockquote>
</div>
</blockquote>
<br>
</body>
</html>