diff options
Diffstat (limited to 'migration')
-rw-r--r-- | migration/colo-failover.c | 4 | ||||
-rw-r--r-- | migration/colo.c | 14 | ||||
-rw-r--r-- | migration/global_state.c | 6 | ||||
-rw-r--r-- | migration/migration.c | 1 |
4 files changed, 11 insertions, 14 deletions
diff --git a/migration/colo-failover.c b/migration/colo-failover.c index f9914869c5..6563862b36 100644 --- a/migration/colo-failover.c +++ b/migration/colo-failover.c @@ -34,7 +34,7 @@ static void colo_failover_bh(void *opaque) FAILOVER_STATUS_ACTIVE); if (old_state != FAILOVER_STATUS_REQUIRE) { error_report("Unknown error for failover, old_state = %s", - FailoverStatus_lookup[old_state]); + FailoverStatus_str(old_state)); return; } @@ -64,7 +64,7 @@ FailoverStatus failover_set_state(FailoverStatus old_state, old = atomic_cmpxchg(&failover_state, old_state, new_state); if (old == old_state) { - trace_colo_failover_set_state(FailoverStatus_lookup[new_state]); + trace_colo_failover_set_state(FailoverStatus_str(new_state)); } return old; } diff --git a/migration/colo.c b/migration/colo.c index a4255432ac..dee3aa8bf7 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -61,7 +61,7 @@ static void secondary_vm_do_failover(void) FAILOVER_STATUS_RELAUNCH); if (old_state != FAILOVER_STATUS_ACTIVE) { error_report("Unknown error while do failover for secondary VM," - "old_state: %s", FailoverStatus_lookup[old_state]); + "old_state: %s", FailoverStatus_str(old_state)); } return; } @@ -91,7 +91,7 @@ static void secondary_vm_do_failover(void) FAILOVER_STATUS_COMPLETED); if (old_state != FAILOVER_STATUS_ACTIVE) { error_report("Incorrect state (%s) while doing failover for " - "secondary VM", FailoverStatus_lookup[old_state]); + "secondary VM", FailoverStatus_str(old_state)); return; } /* Notify COLO incoming thread that failover work is finished */ @@ -126,7 +126,7 @@ static void primary_vm_do_failover(void) FAILOVER_STATUS_COMPLETED); if (old_state != FAILOVER_STATUS_ACTIVE) { error_report("Incorrect state (%s) while doing failover for Primary VM", - FailoverStatus_lookup[old_state]); + FailoverStatus_str(old_state)); return; } /* Notify COLO thread that failover work is finished */ @@ -222,7 +222,7 @@ static void colo_send_message(QEMUFile *f, COLOMessage msg, if (ret < 0) { error_setg_errno(errp, -ret, "Can't send COLO message"); } - trace_colo_send_message(COLOMessage_lookup[msg]); + trace_colo_send_message(COLOMessage_str(msg)); } static void colo_send_message_value(QEMUFile *f, COLOMessage msg, @@ -242,7 +242,7 @@ static void colo_send_message_value(QEMUFile *f, COLOMessage msg, ret = qemu_file_get_error(f); if (ret < 0) { error_setg_errno(errp, -ret, "Failed to send value for message:%s", - COLOMessage_lookup[msg]); + COLOMessage_str(msg)); } } @@ -261,7 +261,7 @@ static COLOMessage colo_receive_message(QEMUFile *f, Error **errp) error_setg(errp, "%s: Invalid message", __func__); return msg; } - trace_colo_receive_message(COLOMessage_lookup[msg]); + trace_colo_receive_message(COLOMessage_str(msg)); return msg; } @@ -299,7 +299,7 @@ static uint64_t colo_receive_message_value(QEMUFile *f, uint32_t expect_msg, ret = qemu_file_get_error(f); if (ret < 0) { error_setg_errno(errp, -ret, "Failed to get value for COLO message: %s", - COLOMessage_lookup[expect_msg]); + COLOMessage_str(expect_msg)); } return value; } diff --git a/migration/global_state.c b/migration/global_state.c index dcbbcb28be..dfdaf63910 100644 --- a/migration/global_state.c +++ b/migration/global_state.c @@ -14,7 +14,6 @@ #include "qemu/cutils.h" #include "qemu/error-report.h" #include "qapi/error.h" -#include "qapi/util.h" #include "migration.h" #include "migration/global_state.h" #include "migration/vmstate.h" @@ -42,7 +41,7 @@ int global_state_store(void) void global_state_store_running(void) { - const char *state = RunState_lookup[RUN_STATE_RUNNING]; + const char *state = RunState_str(RUN_STATE_RUNNING); strncpy((char *)global_state.runstate, state, sizeof(global_state.runstate)); } @@ -89,8 +88,7 @@ static int global_state_post_load(void *opaque, int version_id) s->received = true; trace_migrate_global_state_post_load(runstate); - r = qapi_enum_parse(RunState_lookup, runstate, RUN_STATE__MAX, - -1, &local_err); + r = qapi_enum_parse(&RunState_lookup, runstate, -1, &local_err); if (r == -1) { if (local_err) { diff --git a/migration/migration.c b/migration/migration.c index c3fe0ed9ca..1a2b3ebd1a 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -31,7 +31,6 @@ #include "migration/vmstate.h" #include "block/block.h" #include "qapi/qmp/qerror.h" -#include "qapi/util.h" #include "qemu/rcu.h" #include "block.h" #include "postcopy-ram.h" |