[Top][All Lists]
[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."
- [Qemu-devel] [PATCH 0/21] Accelerators: cleaned up version, Glauber Costa, 2008/10/15
- [Qemu-devel] [PATCH 01/21] split kqemu_init into two, Glauber Costa, 2008/10/15
- [Qemu-devel] [PATCH 02/21] introduce QEMUAccel and fill it with interrupt specific driver, Glauber Costa, 2008/10/15
- [Qemu-devel] [PATCH 04/21] wrap cache flushing functions into accel drivers, Glauber Costa, 2008/10/15
- [Qemu-devel] [PATCH 03/21] init env made accel driver, Glauber Costa, 2008/10/15
- [Qemu-devel] [PATCH 07/21] move kqemu externs to kqemu.h, Glauber Costa, 2008/10/15
- [Qemu-devel] [PATCH 06/21] separate accelerator part of info profiler, Glauber Costa, 2008/10/15