qapi: De-duplicate enum code generation
Duplicated in commit 21cd70df. Yes, we can't import qapi-types, but that's no excuse. Move the helpers from qapi-types.py to qapi.py, and replace the duplicates in qapi-event.py. The generated event enumeration type's lookup table becomes const-correct (see commit 2e4450ff), and uses explicit indexes instead of relying on order (see commit 912ae9c8). Signed-off-by: NMarkus Armbruster <armbru@redhat.com> Message-Id: <1442401589-24189-10-git-send-email-armbru@redhat.com> Reviewed-by: NDaniel P. Berrange <berrange@redhat.com> Reviewed-by: NEric Blake <eblake@redhat.com>
Showing
想要评论请 注册 或 登录