]> git.proxmox.com Git - mirror_qemu.git/commit - monitor.c
monitor: New format for handlers argument types
authorLuiz Capitulino <lcapitulino@redhat.com>
Fri, 28 Aug 2009 18:27:09 +0000 (15:27 -0300)
committerAnthony Liguori <aliguori@us.ibm.com>
Fri, 4 Sep 2009 14:37:29 +0000 (09:37 -0500)
commit4d76d2ba9d313a827012d72d8352459d3b7b8833
treeda0836b8e4cc38f83e915a2ed274a2a8a23a0c62
parent3818318682c3aaca7856f577ec61e05e5ad449ea
monitor: New format for handlers argument types

Current handlers argument types, as defined in qemu-monitor.hx file,
are a sequence of chars where each one represents one argument type
of the command handler. The number of chars is also used to know how
many arguments a given handler accepts.

This commit defines a new format, which makes mandatory the use of
a name for each argument.

For example, do_eject() command handler is currently defined as:

{ "eject", "-fB", do_eject, ... }

With the new format it becomes:

{ "eject", "force:-f,filename:B", do_eject, ... }

This way the Monitor will be capable of setting up a dictionary, using
each argument's name as the key and the argument itself as the value.

This commit also adds two new functions: key_get_info() and
next_arg_type(), both are used to parse the new format.

Currently key_get_info() consumes the 'key' part of the new format and
discards it, this way the current parsing code is not affected by this
change.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
monitor.c
qemu-monitor.hx