aboutsummaryrefslogtreecommitdiff
path: root/libcacard
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2015-02-19 11:13:10 +0100
committerLuiz Capitulino <lcapitulino@redhat.com>2015-02-23 11:00:05 -0500
commit912ae9c88669d0a0cbae1f20b8c80dde8e526251 (patch)
tree628d4425755469fb889b78fe917c7fe3eb64129f /libcacard
parent606ee8f5eadd79627216bbdde4da0337cb7d4360 (diff)
downloadqemu-912ae9c88669d0a0cbae1f20b8c80dde8e526251.zip
qemu-912ae9c88669d0a0cbae1f20b8c80dde8e526251.tar.gz
qemu-912ae9c88669d0a0cbae1f20b8c80dde8e526251.tar.bz2
qapi-types: add C99 index names to arrays
It's not easy to figure out how monitor translates strings: most QEMU code deals with translated indexes, these are translated using _lookup arrays, so you need to find the array name, and find the appropriate offset. This patch adds C99 indexes to lookup arrays, which makes it possible to find the correct key using simple grep, and see that the matching is correct at a glance. Example: Before: const char *MigrationCapability_lookup[] = { "xbzrle", "rdma-pin-all", "auto-converge", "zero-blocks", NULL, }; After: const char *MigrationCapability_lookup[] = { [MIGRATION_CAPABILITY_XBZRLE] = "xbzrle", [MIGRATION_CAPABILITY_RDMA_PIN_ALL] = "rdma-pin-all", [MIGRATION_CAPABILITY_AUTO_CONVERGE] = "auto-converge", [MIGRATION_CAPABILITY_ZERO_BLOCKS] = "zero-blocks", [MIGRATION_CAPABILITY_MAX] = NULL, }; Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'libcacard')
0 files changed, 0 insertions, 0 deletions