diff options
author | Markus Armbruster <armbru@redhat.com> | 2017-08-24 10:46:08 +0200 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2017-09-04 13:09:13 +0200 |
commit | 977c736f80c232de7c6476d793ed575359c049d8 (patch) | |
tree | 986bf327e75929660aa367008574343e59818ee4 /monitor.c | |
parent | 5b5f825d44306b18509cd10ba9ac6983e90d6e0f (diff) |
qapi: Mechanically convert FOO_lookup[...] to FOO_str(...)
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <1503564371-26090-14-git-send-email-armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Diffstat (limited to 'monitor.c')
-rw-r--r-- | monitor.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -928,7 +928,7 @@ EventInfoList *qmp_query_events(Error **errp) QAPIEvent e; for (e = 0 ; e < QAPI_EVENT__MAX ; e++) { - const char *event_name = QAPIEvent_lookup[e]; + const char *event_name = QAPIEvent_str(e); assert(event_name != NULL); info = g_malloc0(sizeof(*info)); info->value = g_malloc0(sizeof(*info->value)); @@ -3250,7 +3250,7 @@ void netdev_add_completion(ReadLineState *rs, int nb_args, const char *str) len = strlen(str); readline_set_completion_index(rs, len); for (i = 0; i < NET_CLIENT_DRIVER__MAX; i++) { - add_completion_option(rs, str, NetClientDriver_lookup[i]); + add_completion_option(rs, str, NetClientDriver_str(i)); } } @@ -3434,8 +3434,8 @@ void sendkey_completion(ReadLineState *rs, int nb_args, const char *str) len = strlen(str); readline_set_completion_index(rs, len); for (i = 0; i < Q_KEY_CODE__MAX; i++) { - if (!strncmp(str, QKeyCode_lookup[i], len)) { - readline_add_completion(rs, QKeyCode_lookup[i]); + if (!strncmp(str, QKeyCode_str(i), len)) { + readline_add_completion(rs, QKeyCode_str(i)); } } } @@ -3538,7 +3538,7 @@ void watchdog_action_completion(ReadLineState *rs, int nb_args, const char *str) } readline_set_completion_index(rs, strlen(str)); for (i = 0; i < WATCHDOG_EXPIRATION_ACTION__MAX; i++) { - add_completion_option(rs, str, WatchdogExpirationAction_lookup[i]); + add_completion_option(rs, str, WatchdogExpirationAction_str(i)); } } @@ -3552,7 +3552,7 @@ void migrate_set_capability_completion(ReadLineState *rs, int nb_args, if (nb_args == 2) { int i; for (i = 0; i < MIGRATION_CAPABILITY__MAX; i++) { - const char *name = MigrationCapability_lookup[i]; + const char *name = MigrationCapability_str(i); if (!strncmp(str, name, len)) { readline_add_completion(rs, name); } @@ -3573,7 +3573,7 @@ void migrate_set_parameter_completion(ReadLineState *rs, int nb_args, if (nb_args == 2) { int i; for (i = 0; i < MIGRATION_PARAMETER__MAX; i++) { - const char *name = MigrationParameter_lookup[i]; + const char *name = MigrationParameter_str(i); if (!strncmp(str, name, len)) { readline_add_completion(rs, name); } @@ -3852,7 +3852,7 @@ static void handle_qmp_command(JSONMessageParser *parser, GQueue *tokens) qdict = qdict_get_qdict(qobject_to_qdict(rsp), "error"); if (qdict && !g_strcmp0(qdict_get_try_str(qdict, "class"), - QapiErrorClass_lookup[ERROR_CLASS_COMMAND_NOT_FOUND])) { + QapiErrorClass_str(ERROR_CLASS_COMMAND_NOT_FOUND))) { /* Provide a more useful error message */ qdict_del(qdict, "desc"); qdict_put_str(qdict, "desc", "Expecting capabilities negotiation" |