[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/5] runstate: Print state transition when inval
From: |
Wen Congyang |
Subject: |
Re: [Qemu-devel] [PATCH 2/5] runstate: Print state transition when invalid |
Date: |
Wed, 19 Oct 2011 08:43:33 +0800 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100413 Fedora/3.0.4-2.fc13 Thunderbird/3.0.4 |
At 10/15/2011 01:26 AM, Luiz Capitulino Write:
> Makes it easier to debug.
>
> Signed-off-by: Luiz Capitulino <address@hidden>
> ---
> vl.c | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/vl.c b/vl.c
> index dbf7778..6645720 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -397,7 +397,9 @@ 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");
> + fprintf(stderr, "ERROR: invalid runstate transition: '%s' -> '%s'\n",
> + RunState_lookup[current_run_state],
> + RunState_lookup[new_state]);
If new_state >= RUN_STATE_MAX, we can not use RunState_lookup.
I think it's better to use:
new_state >= RUN_STATE_MAX ? "invalid state" : RunState_lookup[new_state]
Thanks
Wen Congyang
> abort();
> }
>
- [Qemu-devel] [PULL 0/5]: QMP queue, Luiz Capitulino, 2011/10/14
- [Qemu-devel] [PATCH 1/5] QMP: Fix blockdev-snapshot-sync doc example, Luiz Capitulino, 2011/10/14
- [Qemu-devel] [PATCH 2/5] runstate: Print state transition when invalid, Luiz Capitulino, 2011/10/14
- Re: [Qemu-devel] [PATCH 2/5] runstate: Print state transition when invalid,
Wen Congyang <=
- [Qemu-devel] [PATCH 3/5] runstate: Allow to transition from paused to postmigrate, Luiz Capitulino, 2011/10/14
- [Qemu-devel] [PATCH 4/5] savevm: qemu_savevm_state(): Drop stop VM logic, Luiz Capitulino, 2011/10/14
- [Qemu-devel] [PATCH 5/5] runstate: Allow user to migrate twice, Luiz Capitulino, 2011/10/14
- Re: [Qemu-devel] [PULL 0/5]: QMP queue, Anthony Liguori, 2011/10/20