On Wed, 30 Dec 2009 15:22:19 +0200
Gleb Natapov <g...@redhat.com> wrote:

> > > +void do_info_ioapic(Monitor *mon, QObject **ret_data)
> > > +{
> > > +    int i;
> > > +    QList *list;
> > > +
> > > +    *ret_data = NULL;
> > > +
> > > +    if (!ioapic)
> > > +        return;
> > > +
> > > +    list = qlist_new();
> > > +
> > > +    for (i = 0; i < IOAPIC_NUM_PINS; i++) {
> > > +        QObject *obj;
> > > +        uint64 e = ioapic->ioredtbl[i];
> > > +        if (e & IOAPIC_LVT_MASKED) {
> > > +            obj = qobject_from_jsonf("{'index': %d, 'masked': 1}", i);
> > 
> >  'masked' should be a bool, using %i will do it, like:
> > 
> > 
> >  obj = qobject_from_jsonf("{'index': %d, 'masked': %i}", i);
> No need to put anything here? ------------------------------^?
> OR should it be
> obj = qobject_from_jsonf("{'index': %d, 'masked': %i}", i, true);

 Oh yes, you right. Actually, you can do:

obj = qobject_from_jsonf("{'index': %d, 'masked': true }", i);

 I would also include this key in the unmasked dict (the one
you fill in the else clause), just for consistency in the protocol.

 And yes, having to worry about the protocol in the handler is a sign
that we have to improve.


Reply via email to