diff mbox

[1/3] start vm after reseting it

Message ID 4FB9E57C.5040003@cn.fujitsu.com
State New
Headers show

Commit Message

Wen Congyang May 21, 2012, 6:49 a.m. UTC
The guest should run after reseting it, but it does not
run if its old state is RUN_STATE_INTERNAL_ERROR or RUN_STATE_PAUSED.

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
---
 vl.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Comments

Luiz Capitulino May 30, 2012, 7:17 p.m. UTC | #1
On Mon, 21 May 2012 14:49:32 +0800
Wen Congyang <wency@cn.fujitsu.com> wrote:

> The guest should run after reseting it, but it does not
> run if its old state is RUN_STATE_INTERNAL_ERROR or RUN_STATE_PAUSED.
> 
> Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
> ---
>  vl.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/vl.c b/vl.c
> index 23ab3a3..7f5fed8 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -1539,6 +1539,7 @@ static bool main_loop_should_exit(void)
>          if (runstate_check(RUN_STATE_INTERNAL_ERROR) ||
>              runstate_check(RUN_STATE_SHUTDOWN)) {
>              runstate_set(RUN_STATE_PAUSED);
> +            vm_start();

Please, drop the runstate_set() call. I think you also have to
to call bdrv_iostatus_reset(), as qmp_cont() does.

>          }
>      }
>      if (qemu_powerdown_requested()) {
Wen Congyang June 12, 2012, 7:23 a.m. UTC | #2
At 05/31/2012 03:17 AM, Luiz Capitulino Wrote:
> On Mon, 21 May 2012 14:49:32 +0800
> Wen Congyang <wency@cn.fujitsu.com> wrote:
> 
>> The guest should run after reseting it, but it does not
>> run if its old state is RUN_STATE_INTERNAL_ERROR or RUN_STATE_PAUSED.
>>
>> Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
>> ---
>>  vl.c |    1 +
>>  1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/vl.c b/vl.c
>> index 23ab3a3..7f5fed8 100644
>> --- a/vl.c
>> +++ b/vl.c
>> @@ -1539,6 +1539,7 @@ static bool main_loop_should_exit(void)
>>          if (runstate_check(RUN_STATE_INTERNAL_ERROR) ||
>>              runstate_check(RUN_STATE_SHUTDOWN)) {
>>              runstate_set(RUN_STATE_PAUSED);
>> +            vm_start();
> 
> Please, drop the runstate_set() call. I think you also have to
> to call bdrv_iostatus_reset(), as qmp_cont() does.

I am not sure whether we should call it here. I think you may be right,
so I will do it as you suggested.

Thanks
Wen Congyang

> 
>>          }
>>      }
>>      if (qemu_powerdown_requested()) {
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>
Wen Congyang June 13, 2012, 6:54 a.m. UTC | #3
At 05/31/2012 03:17 AM, Luiz Capitulino Wrote:
> On Mon, 21 May 2012 14:49:32 +0800
> Wen Congyang <wency@cn.fujitsu.com> wrote:
> 
>> The guest should run after reseting it, but it does not
>> run if its old state is RUN_STATE_INTERNAL_ERROR or RUN_STATE_PAUSED.
>>
>> Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
>> ---
>>  vl.c |    1 +
>>  1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/vl.c b/vl.c
>> index 23ab3a3..7f5fed8 100644
>> --- a/vl.c
>> +++ b/vl.c
>> @@ -1539,6 +1539,7 @@ static bool main_loop_should_exit(void)
>>          if (runstate_check(RUN_STATE_INTERNAL_ERROR) ||
>>              runstate_check(RUN_STATE_SHUTDOWN)) {
>>              runstate_set(RUN_STATE_PAUSED);
>> +            vm_start();
> 
> Please, drop the runstate_set() call. I think you also have to
> to call bdrv_iostatus_reset(), as qmp_cont() does.

Hmm, if we drop the runstate_set() call here, we should update
runstate_transitions_def too.

Thanks
Wen Congyang

> 
>>          }
>>      }
>>      if (qemu_powerdown_requested()) {
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>
diff mbox

Patch

diff --git a/vl.c b/vl.c
index 23ab3a3..7f5fed8 100644
--- a/vl.c
+++ b/vl.c
@@ -1539,6 +1539,7 @@  static bool main_loop_should_exit(void)
         if (runstate_check(RUN_STATE_INTERNAL_ERROR) ||
             runstate_check(RUN_STATE_SHUTDOWN)) {
             runstate_set(RUN_STATE_PAUSED);
+            vm_start();
         }
     }
     if (qemu_powerdown_requested()) {