qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Re: [PATCH 05/21] turn info kqemu into generic info acc


From: Glauber Costa
Subject: Re: [Qemu-devel] Re: [PATCH 05/21] turn info kqemu into generic info accelerator
Date: Wed, 15 Oct 2008 19:28:55 -0200

On Wed, Oct 15, 2008 at 7:23 PM, M. Warner Losh <address@hidden> wrote:
> In message: <address@hidden>
>            Anthony Liguori <address@hidden> writes:
> : Glauber Costa wrote:
> : > From: Glauber Costa <address@hidden>
> : >
> : > Yet another accel field: info.
> : > From this point on, "info kqemu" is no more. "info accelerator" should
> : > be used instead.
> : >
> : > Signed-off-by: Glauber Costa <address@hidden>
> : > ---
> : >  accel.c   |    6 ++++++
> : >  accel.h   |    6 ++++++
> : >  kqemu.c   |   24 ++++++++++++++++++++++++
> : >  monitor.c |   36 +++++++++++++-----------------------
> : >  4 files changed, 49 insertions(+), 23 deletions(-)
> : >
> : > diff --git a/accel.c b/accel.c
> : > index 6776244..466fe67 100644
> : > --- a/accel.c
> : > +++ b/accel.c
> : > @@ -8,6 +8,11 @@ int _accel_nop(void)
> : >      return 0;
> : >  }
> : >
> : > +int noaccel_info(CPUState *env, char *buf)
> : > +{
> : > +    return sprintf(buf, "no accelerator present.\n");
> : >
> :
> : sprintf() is evil and never should be used.  You should refactor this
> : patch for the info callback to take a buffer size and use snprintf().
>
> why use sprintf for this?

Accelerators probably want to display something on their own.
Returning a pointer to a string seems even worse to me.
>
> Warner
>
>
>



-- 
Glauber  Costa.
"Free as in Freedom"
http://glommer.net

"The less confident you are, the more serious you have to act."




reply via email to

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