<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 &lt;<a moz-do-not-send="true"
          href="mailto:alinefm@linux.vnet.ibm.com">alinefm@linux.vnet.ibm.com</a>&gt;
        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>
          &gt; Changes<br>
          &gt;<br>
          &gt; v2:<br>
          &gt;<br>
          &gt; Improve coding by removing duplicated actions<br>
          &gt; Fix typo<br>
          &gt;<br>
          &gt; On LE systems, some changes on libvirt xml is needed. The
          input device<br>
          &gt; for keyboard is not kbd anymore, the architecture is
          still ppc64 and the<br>
          &gt; qemu binary is not qemu-kvm as in the other archs.<br>
          &gt;<br>
          &gt; Signed-off-by: Ramon Medeiros &lt;<a
            moz-do-not-send="true"
            href="mailto:ramonn@linux.vnet.ibm.com" target="_blank">ramonn@linux.vnet.ibm.com</a>&gt;<br>
          &gt; ---<br>
          &gt;   src/kimchi/<a moz-do-not-send="true"
            href="http://config.py.in" target="_blank">config.py.in</a> 
          | 11 +++++++++--<br>
          &gt;   src/kimchi/osinfo.py     |  6 +++++-<br>
          &gt;   src/kimchi/vmtemplate.py | 11 +++++++++--<br>
          &gt;   3 files changed, 23 insertions(+), 5 deletions(-)<br>
          &gt;<br>
          &gt; 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>
          &gt; index 83a5dd0..d5e0f6c 100644<br>
          &gt; --- a/src/kimchi/<a moz-do-not-send="true"
            href="http://config.py.in" target="_blank">config.py.in</a><br>
          &gt; +++ b/src/kimchi/<a moz-do-not-send="true"
            href="http://config.py.in" target="_blank">config.py.in</a><br>
          &gt; @@ -68,12 +68,19 @@ def find_qemu_binary(find_emulator=False):<br>
          &gt;           raise Exception("Unable to get qemu binary
          location: %s" % e)<br>
          &gt;       try:<br>
          &gt;           xml = connect.getCapabilities()<br>
          &gt; +<br>
          &gt; +        # On Little Endian system, the qemu binary is<br>
          &gt; +        # qemu-system-ppc64, not qemu-system-ppc64le as
          expected<br>
          &gt; +        arch = platform.machine()<br>
          &gt; +        if arch == "ppc64le":<br>
          &gt; +            arch = "ppc64"<br>
          &gt; +<br>
          &gt;           if find_emulator:<br>
          &gt;               expr = "/capabilities/guest/arch[@name='%s']\<br>
          &gt; -                    /emulator" % platform.machine()<br>
          &gt; +                    /emulator" % arch<br>
          &gt;           else:<br>
          &gt;               expr = "/capabilities/guest/arch[@name='%s']\<br>
          &gt; -                    /domain[@type='kvm']/emulator" %
          platform.machine()<br>
          &gt; +                    /domain[@type='kvm']/emulator" %
          arch<br>
          &gt;           res = xpath_get_text(xml, expr)<br>
          &gt;           location = res[0]<br>
          &gt;       except Exception, e:<br>
          &gt; diff --git a/src/kimchi/osinfo.py b/src/kimchi/osinfo.py<br>
          &gt; index 0e16b50..9bfd148 100644<br>
          &gt; --- a/src/kimchi/osinfo.py<br>
          &gt; +++ b/src/kimchi/osinfo.py<br>
          &gt; @@ -29,7 +29,7 @@ from kimchi.config import paths<br>
          &gt;<br>
          &gt;<br>
          &gt;   SUPPORTED_ARCHS = {'x86': ('i386', 'i686', 'x86_64'),<br>
          &gt; -                   'power': ('ppc', 'ppc64')}<br>
          &gt; +                   '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>
          &gt;<br>
          &gt;<br>
          &gt;   common_spec = {'cpus': 1, 'memory': 1024, 'disks':
          [{'index': 0, 'size': 10}],<br>
          &gt; @@ -94,6 +94,10 @@ def lookup(distro, version):<br>
          &gt;       params['os_version'] = version<br>
          &gt;       arch = _get_arch()<br>
          &gt;<br>
          &gt; +    # set up arch to ppc64 instead of ppc64le due to
          libvirt compatibility<br>
          &gt; +    if params["arch"] == "ppc64le":<br>
          &gt; +        params["arch"] = "ppc64"<br>
          &gt; +<br>
          &gt;       if distro in modern_version_bases[arch]:<br>
          &gt;           if LooseVersion(version) &gt;= LooseVersion(<br>
          &gt;                   modern_version_bases[arch][distro]):<br>
          &gt; diff --git a/src/kimchi/vmtemplate.py
          b/src/kimchi/vmtemplate.py<br>
          &gt; index e41a959..bcfbab6 100644<br>
          &gt; --- a/src/kimchi/vmtemplate.py<br>
          &gt; +++ b/src/kimchi/vmtemplate.py<br>
          &gt; @@ -245,9 +245,16 @@ class VMTemplate(object):<br>
          &gt;           mouse = """<br>
          &gt;               &lt;input type='mouse'
          bus='%(mouse_bus)s'/&gt;<br>
          &gt;           """<br>
          &gt; +<br>
          &gt; +        # PPC64EL does not uses kbd<br>
          &gt; +        <a moz-do-not-send="true"
            href="http://self.info" target="_blank">self.info</a>["kbd_type"]
          = "kbd"<br>
          &gt; +        if os.uname()[4] == "ppc64le":<br>
          &gt; +           <a moz-do-not-send="true"
            href="http://self.info" target="_blank">self.info</a>["kbd_type"]
          = "keyboard"<br>
          &gt; +<br>
          &gt;           keyboard = """<br>
          &gt; -            &lt;input type='kbd' bus='%(kbd_bus)s'&gt;
          &lt;/input&gt;<br>
          &gt; -        """<br>
          &gt; +            &lt;input type='%(kbd_type)s'
          bus='%(kbd_bus)s'&gt; &lt;/input&gt;<br>
          &gt; +        """<br>
          &gt; +<br>
          &gt;           tablet = """<br>
          &gt;               &lt;input type='tablet'
          bus='%(kbd_bus)s'&gt; &lt;/input&gt;<br>
          &gt;           """<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>