在 2016-05-14 00:00:18,"Andrea Bolognani" <abologna(a)redhat.com> 写道:
On Fri, 2016-05-13 at 16:19 +0100, Daniel P. Berrange wrote:
> On Fri, May 13, 2016 at 05:17:35PM +0200, Andrea Bolognani wrote:
> >
> > On Fri, 2016-05-13 at 17:16 +0800, Chen Hanxiao wrote:
> > >
> > > At 2016-05-10 15:17:48, "Chen Hanxiao"
<chen_han_xiao(a)126.com> wrote:
> > > >
> > > >
> > > > From: Chen Hanxiao <chenhanxiao(a)gmail.com>
> > > >
> > > > Signed-off-by: Chen Hanxiao <chenhanxiao(a)gmail.com>
> > > > ---
> > > > src/qemu/qemu_agent.c | 11 -----------
> > > > 1 file changed, 11 deletions(-)
> > > >
> > > > diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c
> > > > index c55f304..20597b4 100644
> > > > --- a/src/qemu/qemu_agent.c
> > > > +++ b/src/qemu/qemu_agent.c
> > > > @@ -287,17 +287,6 @@ qemuAgentIOProcessEvent(qemuAgentPtr mon,
> > > > return -1;
> > > > }
> > > >
> > > > -/*
> > > > - for (i = 0; i < ARRAY_CARDINALITY(eventHandlers); i++) {
> > > > - if (STREQ(eventHandlers[i].type, type)) {
> > > > - virJSONValuePtr data = virJSONValueObjectGet(obj,
"data");
> > > > - VIR_DEBUG("handle %s handler=%p data=%p",
type,
> > > > - eventHandlers[i].handler, data);
> > > > - (eventHandlers[i].handler)(mon, data);
> > > > - break;
> > > > - }
> > > > - }
> > > > -*/
> > > > return 0;
> > > > }
> > > >
> > This chunk is referenced near the top of the file:
> >
> > >
> > > /* When you are the first to uncomment this,
> > > * don't forget to uncomment the corresponding
> > > * part in qemuAgentIOProcessEvent as well.
> > > *
> > > static struct {
> > > const char *type;
> > > void (*handler)(qemuAgentPtr mon, virJSONValuePtr data);
> > > } eventHandlers[] = {
> > > };
> > > */
> >
> > Looks like we haven't felt the need to enable it in
> > about five years, so maybe we can just get rid of it.
> >
> > CC'ing Dan, who wrote the code.
>
> I only wrote the monitor code, not the agent code. This just looks like
> it was copied from the monitor code to prepare us for a future where the
> agent starts sending events. Personally I'd just leave all this code
> as-is.
I guess that's a NACK then. Sorry, Chen!
Hi, Andrea, Dan,
Thanks for your clarification.
Regards,
-Chen