]> git.proxmox.com Git - qemu.git/commit
qapi: generate list struct and visit_list for enum
authorAmos Kong <akong@redhat.com>
Fri, 31 Aug 2012 02:56:23 +0000 (10:56 +0800)
committerLuiz Capitulino <lcapitulino@redhat.com>
Wed, 5 Sep 2012 18:48:56 +0000 (15:48 -0300)
commitb9c4b48d50057b6aee7c70879b240ff76f39c85b
tree350bac3ec1a13b67a2c5e289c35ccd0b60a30e76
parent2ef20c15b4736c9b0afc7ef2b14239182fbcd3e1
qapi: generate list struct and visit_list for enum

Currently, if we define an 'enum' and use it in one command's
data, list struct for enum could not be generated, but it's
used in qmp function.

For example: KeyCodesList could not be generated.
>>> qapi-schema.json:
{ 'enum': 'KeyCodes',
  'data': [ 'shift', 'alt' ... ] }
{ 'command': 'sendkey',
  'data': { 'keys': ['KeyCodes'], '*hold-time': 'int' } }

>>> qmp-command.h:
void qmp_sendkey(KeyCodesList * keys, bool has_hold_time, int64_t
hold_time, Error **errp);

This patch lets qapi generate list struct and visit_list for enum.

Signed-off-by: Amos Kong <akong@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
scripts/qapi-types.py
scripts/qapi-visit.py