[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCHv2] add "info ioapic" monitor command
From: |
Luiz Capitulino |
Subject: |
[Qemu-devel] Re: [PATCHv2] add "info ioapic" monitor command |
Date: |
Wed, 30 Dec 2009 11:19:30 -0200 |
On Wed, 30 Dec 2009 13:50:43 +0200
Gleb Natapov <address@hidden> wrote:
> I am starring to learn this QObject kung-fu.
Nice, you really got how to do it. Just two minor comments.
> One question:
> Why qlist_iter(..., func, ...) and not
> FOREACH_QOBJ() {
> do things
> }
Well, when I started working on the QObjects I was still getting
familiar with QEMU internals and just ignored the FOREACH_ loops.
Later, I realized that they could be better but then we were
planning to have libqmp and now I'm wondering if it's ok to expose
data structure members to the public.
> diff --git a/hw/ioapic.c b/hw/ioapic.c
> index b0ad78f..efb9744 100644
> --- a/hw/ioapic.c
> +++ b/hw/ioapic.c
> @@ -24,6 +24,12 @@
> #include "pc.h"
> #include "qemu-timer.h"
> #include "host-utils.h"
> +#include "monitor.h"
> +#include "qint.h"
> +#include "qlist.h"
> +#include "qdict.h"
> +#include "qstring.h"
> +#include "qjson.h"
You can include qemu-objects.h.
> +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);
- [Qemu-devel] [PATCHv2] add "info ioapic" monitor command, Gleb Natapov, 2009/12/30
- Re: [Qemu-devel] [PATCHv2] add "info ioapic" monitor command, Blue Swirl, 2009/12/30
- Re: [Qemu-devel] [PATCHv2] add "info ioapic" monitor command, Gleb Natapov, 2009/12/30
- Re: [Qemu-devel] [PATCHv2] add "info ioapic" monitor command, Izik Eidus, 2009/12/30
- Re: [Qemu-devel] [PATCHv2] add "info ioapic" monitor command, Gleb Natapov, 2009/12/30
- Re: [Qemu-devel] [PATCHv2] add "info ioapic" monitor command, Anthony Liguori, 2009/12/30
- Re: [Qemu-devel] [PATCHv2] add "info ioapic" monitor command, Gleb Natapov, 2009/12/30
- Re: [Qemu-devel] [PATCHv2] add "info ioapic" monitor command, Anthony Liguori, 2009/12/31
- Re: [Qemu-devel] [PATCHv2] add "info ioapic" monitor command, Gleb Natapov, 2009/12/31
Re: [Qemu-devel] [PATCHv2] add "info ioapic" monitor command, Luiz Capitulino, 2009/12/30
[Qemu-devel] Re: [PATCHv2] add "info ioapic" monitor command,
Luiz Capitulino <=
Re: [Qemu-devel] [PATCHv2] add "info ioapic" monitor command, Avi Kivity, 2009/12/30
- Re: [Qemu-devel] [PATCHv2] add "info ioapic" monitor command, Gleb Natapov, 2009/12/30
- Re: [Qemu-devel] [PATCHv2] add "info ioapic" monitor command, Avi Kivity, 2009/12/30
- Re: [Qemu-devel] [PATCHv2] add "info ioapic" monitor command, Anthony Liguori, 2009/12/30
- Re: [Qemu-devel] [PATCHv2] add "info ioapic" monitor command, Gleb Natapov, 2009/12/30
- Re: [Qemu-devel] [PATCHv2] add "info ioapic" monitor command, Anthony Liguori, 2009/12/31
- Re: [Qemu-devel] [PATCHv2] add "info ioapic" monitor command, Gleb Natapov, 2009/12/31
- Re: [Qemu-devel] [PATCHv2] add "info ioapic" monitor command, Anthony Liguori, 2009/12/31