[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2][ 10/21] qapi: add QMP input visiter
From: |
Luiz Capitulino |
Subject: |
Re: [Qemu-devel] [PATCH v2][ 10/21] qapi: add QMP input visiter |
Date: |
Mon, 13 Jun 2011 16:12:49 -0300 |
On Fri, 3 Jun 2011 17:33:08 -0500
Michael Roth <address@hidden> wrote:
> +static void qmp_input_type_int(Visiter *v, int64_t *obj, const char *name,
> Error **errp)
> +{
> + QmpInputVisiter *qiv = to_qiv(v);
> + QObject *qobj = qmp_input_get_object(qiv, name);
> +
> + if (!qobj || qobject_type(qobj) != QTYPE_QINT) {
> + error_set(errp, QERR_INVALID_PARAMETER_TYPE, name, "integer");
> + return;
> + }
> +
> + *obj = qint_get_int(qobject_to_qint(qobj));
Let me warn you for an error I just got: if 'name' is NULL and the if test is
true, then error_set() will segfault, because 'name' must not be NULL.
So either, we always pass 'name' in the generated code or we automatically
build a new string if 'name' is NULL.
Re: [Qemu-devel] [PATCH v2][ 10/21] qapi: add QMP input visiter,
Luiz Capitulino <=
[Qemu-devel] [PATCH v2][ 11/21] qapi: add QMP output visiter, Michael Roth, 2011/06/03
[Qemu-devel] [PATCH v2][ 12/21] qapi: add QAPI dealloc visiter, Michael Roth, 2011/06/03
[Qemu-devel] [PATCH v2][ 13/21] qapi: add command registration/lookup functions, Michael Roth, 2011/06/03
[Qemu-devel] [PATCH v2][ 14/21] qapi: add QMP dispatch functions, Michael Roth, 2011/06/03
[Qemu-devel] [PATCH v2][ 15/21] qapi: add base declaration/types for QMP, Michael Roth, 2011/06/03
[Qemu-devel] [PATCH v2][ 16/21] qapi: test schema used for unit tests, Michael Roth, 2011/06/03
[Qemu-devel] [PATCH v2][ 17/21] qapi: add test-visiter, tests for gen. visiter code, Michael Roth, 2011/06/03