aboutsummaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/monitor.c b/monitor.c
index 86438f4b75..9239f7adde 100644
--- a/monitor.c
+++ b/monitor.c
@@ -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"