[v2,18/24] fixup! ppc: spapr: use generic cpu_model parsing

Message ID 1507823408-270386-1-git-send-email-imammedo@redhat.com
State New
Headers show
Series
  • Untitled series #7828
Related show

Commit Message

Igor Mammedov Oct. 12, 2017, 3:50 p.m.
inot sure how it managed to compile locally and on travis
but build fails with type mismatch on PPC host, fixup it
by casting to expected type

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
 target/ppc/kvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Gibson Oct. 12, 2017, 10:24 p.m. | #1
On Thu, Oct 12, 2017 at 05:50:08PM +0200, Igor Mammedov wrote:
> inot sure how it managed to compile locally and on travis

Because target/ppc/kvm.c is only compiled on a ppc _host_.

> but build fails with type mismatch on PPC host, fixup it
> by casting to expected type

I already hit this one and fixed it up in place.

> 
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> ---
>  target/ppc/kvm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c
> index 48dc3f7..9d57deb 100644
> --- a/target/ppc/kvm.c
> +++ b/target/ppc/kvm.c
> @@ -2505,7 +2505,7 @@ static int kvm_ppc_register_host_cpu_type(MachineState *ms)
>      }
>      type_info.parent = object_class_get_name(OBJECT_CLASS(pvr_pcc));
>      type_register(&type_info);
> -    if (object_dynamic_cast(ms, TYPE_SPAPR_MACHINE)) {
> +    if (object_dynamic_cast(OBJECT(ms), TYPE_SPAPR_MACHINE)) {
>          /* override TCG default cpu type with 'host' cpu model */
>          mc->default_cpu_type = TYPE_HOST_POWERPC_CPU;
>      }
Alexey Kardashevskiy Oct. 23, 2017, 4:43 a.m. | #2
On 13/10/17 09:24, David Gibson wrote:
> On Thu, Oct 12, 2017 at 05:50:08PM +0200, Igor Mammedov wrote:
>> inot sure how it managed to compile locally and on travis
> 
> Because target/ppc/kvm.c is only compiled on a ppc _host_.


that or in cross environment, to be precise.


> 
>> but build fails with type mismatch on PPC host, fixup it
>> by casting to expected type
> 
> I already hit this one and fixed it up in place.
> 
>>
>> Signed-off-by: Igor Mammedov <imammedo@redhat.com>
>> ---
>>  target/ppc/kvm.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c
>> index 48dc3f7..9d57deb 100644
>> --- a/target/ppc/kvm.c
>> +++ b/target/ppc/kvm.c
>> @@ -2505,7 +2505,7 @@ static int kvm_ppc_register_host_cpu_type(MachineState *ms)
>>      }
>>      type_info.parent = object_class_get_name(OBJECT_CLASS(pvr_pcc));
>>      type_register(&type_info);
>> -    if (object_dynamic_cast(ms, TYPE_SPAPR_MACHINE)) {
>> +    if (object_dynamic_cast(OBJECT(ms), TYPE_SPAPR_MACHINE)) {
>>          /* override TCG default cpu type with 'host' cpu model */
>>          mc->default_cpu_type = TYPE_HOST_POWERPC_CPU;
>>      }
>

Patch

diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c
index 48dc3f7..9d57deb 100644
--- a/target/ppc/kvm.c
+++ b/target/ppc/kvm.c
@@ -2505,7 +2505,7 @@  static int kvm_ppc_register_host_cpu_type(MachineState *ms)
     }
     type_info.parent = object_class_get_name(OBJECT_CLASS(pvr_pcc));
     type_register(&type_info);
-    if (object_dynamic_cast(ms, TYPE_SPAPR_MACHINE)) {
+    if (object_dynamic_cast(OBJECT(ms), TYPE_SPAPR_MACHINE)) {
         /* override TCG default cpu type with 'host' cpu model */
         mc->default_cpu_type = TYPE_HOST_POWERPC_CPU;
     }