diff mbox series

[2/3] tests/acceptance: Handle ppc64le host arch correctly

Message ID 20190613060728.26955-3-david@gibson.dropbear.id.au (mailing list archive)
State New, archived
Headers show
Series Some fixes for make check-acceptance on a POWER host | expand

Commit Message

David Gibson June 13, 2019, 6:07 a.m. UTC
ppc64 and ppc64le are different archs from the host kernel point of view
and are advertised as such in uname.  But these cover the same set of CPUs,
just in different endianness modes.  qemu-system-ppc64 handles both modes,
so make sure we select the correct binary when running on ppc64le host
architecture.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 tests/acceptance/avocado_qemu/__init__.py | 2 ++
 1 file changed, 2 insertions(+)

Comments

Philippe Mathieu-Daudé June 13, 2019, 9:01 a.m. UTC | #1
On 6/13/19 8:07 AM, David Gibson wrote:
> ppc64 and ppc64le are different archs from the host kernel point of view
> and are advertised as such in uname.  But these cover the same set of CPUs,
> just in different endianness modes.  qemu-system-ppc64 handles both modes,
> so make sure we select the correct binary when running on ppc64le host
> architecture.
> 
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
> ---
>  tests/acceptance/avocado_qemu/__init__.py | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py
> index 2b236a1cf0..0ba9c536f4 100644
> --- a/tests/acceptance/avocado_qemu/__init__.py
> +++ b/tests/acceptance/avocado_qemu/__init__.py
> @@ -39,6 +39,8 @@ def pick_default_qemu_bin(arch=None):
>      """
>      if arch is None:
>          arch = os.uname()[4]
> +        if arch == 'ppc64le':
> +            arch = 'ppc64'

I prefer the generic patch from Cleber:
https://lists.gnu.org/archive/html/qemu-devel/2018-10/msg03418.html
(I guess remember another version with a json file)

>      qemu_bin_relative_path = os.path.join("%s-softmmu" % arch,
>                                            "qemu-system-%s" % arch)
>      if is_readable_executable_file(qemu_bin_relative_path):
>
David Gibson June 14, 2019, 1:40 a.m. UTC | #2
On Thu, Jun 13, 2019 at 11:01:19AM +0200, Philippe Mathieu-Daudé wrote:
> On 6/13/19 8:07 AM, David Gibson wrote:
> > ppc64 and ppc64le are different archs from the host kernel point of view
> > and are advertised as such in uname.  But these cover the same set of CPUs,
> > just in different endianness modes.  qemu-system-ppc64 handles both modes,
> > so make sure we select the correct binary when running on ppc64le host
> > architecture.
> > 
> > Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
> > ---
> >  tests/acceptance/avocado_qemu/__init__.py | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py
> > index 2b236a1cf0..0ba9c536f4 100644
> > --- a/tests/acceptance/avocado_qemu/__init__.py
> > +++ b/tests/acceptance/avocado_qemu/__init__.py
> > @@ -39,6 +39,8 @@ def pick_default_qemu_bin(arch=None):
> >      """
> >      if arch is None:
> >          arch = os.uname()[4]
> > +        if arch == 'ppc64le':
> > +            arch = 'ppc64'
> 
> I prefer the generic patch from Cleber:
> https://lists.gnu.org/archive/html/qemu-devel/2018-10/msg03418.html
> (I guess remember another version with a json file)

I hadn't seen that, that does indeed look better.

> 
> >      qemu_bin_relative_path = os.path.join("%s-softmmu" % arch,
> >                                            "qemu-system-%s" % arch)
> >      if is_readable_executable_file(qemu_bin_relative_path):
> > 
>
David Gibson June 14, 2019, 1:53 a.m. UTC | #3
On Fri, Jun 14, 2019 at 11:40:56AM +1000, David Gibson wrote:
> On Thu, Jun 13, 2019 at 11:01:19AM +0200, Philippe Mathieu-Daudé wrote:
> > On 6/13/19 8:07 AM, David Gibson wrote:
> > > ppc64 and ppc64le are different archs from the host kernel point of view
> > > and are advertised as such in uname.  But these cover the same set of CPUs,
> > > just in different endianness modes.  qemu-system-ppc64 handles both modes,
> > > so make sure we select the correct binary when running on ppc64le host
> > > architecture.
> > > 
> > > Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
> > > ---
> > >  tests/acceptance/avocado_qemu/__init__.py | 2 ++
> > >  1 file changed, 2 insertions(+)
> > > 
> > > diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py
> > > index 2b236a1cf0..0ba9c536f4 100644
> > > --- a/tests/acceptance/avocado_qemu/__init__.py
> > > +++ b/tests/acceptance/avocado_qemu/__init__.py
> > > @@ -39,6 +39,8 @@ def pick_default_qemu_bin(arch=None):
> > >      """
> > >      if arch is None:
> > >          arch = os.uname()[4]
> > > +        if arch == 'ppc64le':
> > > +            arch = 'ppc64'
> > 
> > I prefer the generic patch from Cleber:
> > https://lists.gnu.org/archive/html/qemu-devel/2018-10/msg03418.html
> > (I guess remember another version with a json file)
> 
> I hadn't seen that, that does indeed look better.

Hrm.  Well, it is better but it's been outstanding for like 8 months.
I'd just like to get this working on a ppc host in the near future.

> 
> > 
> > >      qemu_bin_relative_path = os.path.join("%s-softmmu" % arch,
> > >                                            "qemu-system-%s" % arch)
> > >      if is_readable_executable_file(qemu_bin_relative_path):
> > > 
> > 
>
Philippe Mathieu-Daudé June 14, 2019, 5:55 a.m. UTC | #4
On 6/14/19 3:53 AM, David Gibson wrote:
> On Fri, Jun 14, 2019 at 11:40:56AM +1000, David Gibson wrote:
>> On Thu, Jun 13, 2019 at 11:01:19AM +0200, Philippe Mathieu-Daudé wrote:
>>> On 6/13/19 8:07 AM, David Gibson wrote:
>>>> ppc64 and ppc64le are different archs from the host kernel point of view
>>>> and are advertised as such in uname.  But these cover the same set of CPUs,
>>>> just in different endianness modes.  qemu-system-ppc64 handles both modes,
>>>> so make sure we select the correct binary when running on ppc64le host
>>>> architecture.
>>>>
>>>> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
>>>> ---
>>>>  tests/acceptance/avocado_qemu/__init__.py | 2 ++
>>>>  1 file changed, 2 insertions(+)
>>>>
>>>> diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py
>>>> index 2b236a1cf0..0ba9c536f4 100644
>>>> --- a/tests/acceptance/avocado_qemu/__init__.py
>>>> +++ b/tests/acceptance/avocado_qemu/__init__.py
>>>> @@ -39,6 +39,8 @@ def pick_default_qemu_bin(arch=None):
>>>>      """
>>>>      if arch is None:
>>>>          arch = os.uname()[4]
>>>> +        if arch == 'ppc64le':
>>>> +            arch = 'ppc64'
>>>
>>> I prefer the generic patch from Cleber:
>>> https://lists.gnu.org/archive/html/qemu-devel/2018-10/msg03418.html
>>> (I guess remember another version with a json file)
>>
>> I hadn't seen that, that does indeed look better.
> 
> Hrm.  Well, it is better but it's been outstanding for like 8 months.
> I'd just like to get this working on a ppc host in the near future.

True :S I wanted you to know Cleber was working on this, but I don't
have any problem to get your fix merged and Cleber work added on top of
it, so:
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
diff mbox series

Patch

diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py
index 2b236a1cf0..0ba9c536f4 100644
--- a/tests/acceptance/avocado_qemu/__init__.py
+++ b/tests/acceptance/avocado_qemu/__init__.py
@@ -39,6 +39,8 @@  def pick_default_qemu_bin(arch=None):
     """
     if arch is None:
         arch = os.uname()[4]
+        if arch == 'ppc64le':
+            arch = 'ppc64'
     qemu_bin_relative_path = os.path.join("%s-softmmu" % arch,
                                           "qemu-system-%s" % arch)
     if is_readable_executable_file(qemu_bin_relative_path):