qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] Handle cpu_model in copy_cpu()


From: Dan Kenigsberg
Subject: Re: [Qemu-devel] [PATCH] Handle cpu_model in copy_cpu()
Date: Sun, 25 Nov 2007 15:04:38 +0200
User-agent: Mutt/1.5.17 (2007-11-01)

On Sat, Nov 24, 2007 at 11:30:28PM +0200, Kirill A. Shutemov wrote:
> copy_cpu() has been broken since cpu_model added to parameters list of
> cpu_init(). This patch fix copy_cpu() by storing cpu_model string in
> CPUState structure on cpu_init and use this string in copy_cpu().

Please excuse my layman's question: why does each cpu need its own copy
of the string, and not just point to the same const char *cpu_model?

The reason I'm asking is that

> +    char cpu_model_str[32];

might be too short for the feature-reach i386 cpu model string,
and that

> +    strcpy(env->cpu_model_str, cpu_model);

is not safe when this is mind.


Regards,
    Dan.




reply via email to

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