On 2012-01-17 15:17, Jan Kiszka wrote:
>>
>> /* output Bochs bios info messages */
>> //#define DEBUG_BIOS
>> @@ -930,10 +932,22 @@ static void pc_cpu_reset(void *opaque)
>> env->halted = !cpu_is_bsp(env);
>> }
>>
>> -static CPUState *pc_new_cpu(const char *cpu_model)
>> +CPUState *pc_new_cpu(const char *cpu_model)
>> {
>> CPUState *env;
>>
>> + if (cpu_model == NULL) {
>> +#ifdef TARGET_X86_64
>> + cpu_model = "qemu64";
>> +#else
>> + cpu_model = "qemu32";
>> +#endif
>
> Just always initialize global_cpu_model to a non-NULL value.
Another interface idea: cache the first cpu_model in this function and
use the cached one if a later call passes in NULL. That way PIIX4 would
not need to have access to an ugly global variable.
Jan
--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux