qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-ppc] [PATCH 2/2] vl: Print CPU help after we've registered the


From: Paolo Bonzini
Subject: Re: [Qemu-ppc] [PATCH 2/2] vl: Print CPU help after we've registered the CPU accelerators
Date: Wed, 1 Feb 2017 17:11:46 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1


On 31/01/2017 16:08, David Gibson wrote:
> On Tue, Jan 31, 2017 at 02:11:59PM +0100, Thomas Huth wrote:
>> When running with KVM on POWER, we register some CPU types during
>> the initialization function of the ppc64 KVM code (which unfortunately
>> also can not be done via a type_init() like it is done on x86). So to
>> be able to see these updates in the CPU help text, the code that calls
>> list_cpus() has to be run after configure_accelerator(). This move should
>> be fine since the "cpu_model" variable is also never used before the call
>> to configure_accelerator(), and thus there should not be any unwanted
>> side effects in the code before configure_accelerator() if the user
>> started QEMU with "-cpu ?" or "-cpu help".
>>
>> Signed-off-by: Thomas Huth <address@hidden>
> 
> Reviewed-by: David Gibson <address@hidden>
> 
> This looks fine to me, but it's not within my area to apply.  Paolo,
> if you want to ack I'm happy to take it through my tree if that's
> convenient for you.
> 
>> ---
>>  vl.c | 10 +++++-----
>>  1 file changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/vl.c b/vl.c
>> index 0b72b12..315c5c3 100644
>> --- a/vl.c
>> +++ b/vl.c
>> @@ -4055,11 +4055,6 @@ int main(int argc, char **argv, char **envp)
>>          qemu_set_hw_version(machine_class->hw_version);
>>      }
>>  
>> -    if (cpu_model && is_help_option(cpu_model)) {
>> -        list_cpus(stdout, &fprintf, cpu_model);
>> -        exit(0);
>> -    }
>> -
>>      if (!trace_init_backends()) {
>>          exit(1);
>>      }
>> @@ -4298,6 +4293,11 @@ int main(int argc, char **argv, char **envp)
>>  
>>      configure_accelerator(current_machine);
>>  
>> +    if (cpu_model && is_help_option(cpu_model)) {
>> +        list_cpus(stdout, &fprintf, cpu_model);
>> +        exit(0);
>> +    }
>> +
>>      if (qtest_chrdev) {
>>          qtest_init(qtest_chrdev, qtest_log, &error_fatal);
>>      }
> 

Eduardo is the one who did most of the accel and CPU definitions work.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]