mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-11-05 20:35:44 +00:00
runstate: Print state transition when invalid
Makes it easier to debug. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
This commit is contained in:
parent
7f3850c262
commit
207c5cd20c
1 changed files with 6 additions and 3 deletions
9
vl.c
9
vl.c
|
@ -393,9 +393,12 @@ void runstate_init(void)
|
|||
/* This function will abort() on invalid state transitions */
|
||||
void runstate_set(RunState new_state)
|
||||
{
|
||||
if (new_state >= RUN_STATE_MAX ||
|
||||
!runstate_valid_transitions[current_run_state][new_state]) {
|
||||
fprintf(stderr, "invalid runstate transition\n");
|
||||
assert(new_state < RUN_STATE_MAX);
|
||||
|
||||
if (!runstate_valid_transitions[current_run_state][new_state]) {
|
||||
fprintf(stderr, "ERROR: invalid runstate transition: '%s' -> '%s'\n",
|
||||
RunState_lookup[current_run_state],
|
||||
RunState_lookup[new_state]);
|
||||
abort();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue