QMP: New argument checker (first part)
authorLuiz Capitulino <lcapitulino@redhat.com>
Wed, 26 May 2010 19:13:09 +0000 (16:13 -0300)
committerLuiz Capitulino <lcapitulino@redhat.com>
Thu, 1 Jul 2010 17:27:13 +0000 (14:27 -0300)
commit470e54a3817e116587c1318df3323e039ad32048
treedeb68ee619efa043a40c7d1354f6208c453f2c05
parent362c2bbc8594731b86ee8f3d267a19dff08832f4
QMP: New argument checker (first part)

Current QMP's argument checker is more complex than it should be
and has (at least) one serious bug: it ignores unknown arguments.

To solve both problems we introduce a new argument checker. It's
added on top of the existing one, so that there are no regressions
during the transition.

This commit introduces the first part of the new checker, which
is run by qmp_check_client_args() and does the following:

  1. Check if all mandatory arguments were provided
  2. Set flags for argument validation

In order to do that, we transform the args_type string (from
qemu-montor.hx) into a qdict and iterate over it.

Next commit adds the new checker's second part: type checking and
invalid argument detection.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
monitor.c