Re: [Qemu-devel] [PATCH 3/9] QMP: First half of the new argument checking code

2010-06-03 Thread Markus Armbruster
Luiz Capitulino lcapitul...@redhat.com writes: On Wed, 02 Jun 2010 08:59:11 +0200 Markus Armbruster arm...@redhat.com wrote: Luiz Capitulino lcapitul...@redhat.com writes: [...] + +type = qobject_to_qstring(obj); +assert(type != NULL); + +if (qstring_get_str(type)[0]

Re: [Qemu-devel] [PATCH 3/9] QMP: First half of the new argument checking code

2010-06-02 Thread Markus Armbruster
Luiz Capitulino lcapitul...@redhat.com writes: This commit introduces the first half of qmp_check_client_args(), which is the new client argument checker. It's introduced on top of the existing code, so that there are no regressions during the transition. It works this way: the command's

Re: [Qemu-devel] [PATCH 3/9] QMP: First half of the new argument checking code

2010-06-02 Thread Markus Armbruster
There's more... Luiz Capitulino lcapitul...@redhat.com writes: This commit introduces the first half of qmp_check_client_args(), which is the new client argument checker. It's introduced on top of the existing code, so that there are no regressions during the transition. It works this

Re: [Qemu-devel] [PATCH 3/9] QMP: First half of the new argument checking code

2010-06-02 Thread Luiz Capitulino
On Wed, 02 Jun 2010 08:59:11 +0200 Markus Armbruster arm...@redhat.com wrote: Luiz Capitulino lcapitul...@redhat.com writes: [...] + +type = qobject_to_qstring(obj); +assert(type != NULL); + +if (qstring_get_str(type)[0] == 'O') { +QemuOptsList *opts_list =

Re: [Qemu-devel] [PATCH 3/9] QMP: First half of the new argument checking code

2010-06-02 Thread Markus Armbruster
Luiz Capitulino lcapitul...@redhat.com writes: On Wed, 02 Jun 2010 09:22:40 +0200 Markus Armbruster arm...@redhat.com wrote: [...] Higher order functions rock. But C is too static and limited for elegant use of higher order functions. Means to construct loops are usually more convenient to

[Qemu-devel] [PATCH 3/9] QMP: First half of the new argument checking code

2010-06-01 Thread Luiz Capitulino
This commit introduces the first half of qmp_check_client_args(), which is the new client argument checker. It's introduced on top of the existing code, so that there are no regressions during the transition. It works this way: the command's args_type field (from qemu-monitor.hx) is transformed