All of lore.kernel.org
 help / color / mirror / Atom feed
From: hangaohuai <hangaohuai@huawei.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, arei.gonglei@huawei.com
Subject: Re: [Qemu-devel] [PATCH] Fix the vm state after vm migration when vm panic
Date: Tue, 7 Mar 2017 14:54:06 +0800	[thread overview]
Message-ID: <58BE590E.4070202@huawei.com> (raw)
In-Reply-To: <a3354e81-8671-6951-42a3-ff5c1dc5b55a@redhat.com>

debugging the migration step with the same steps.
with
libvirt version:1.3.4
qemu version:2.8.50

I found qemu held the right state.
But libvirt will send cont at the end of the migration, it will rewrite the vm's state.

after migration
HOSTA                             |               HOSTB
virsh list   vm crashed           ->    virsh list   vm running

I will check the new libvirt about handling the state.

Thanks

On 2017/3/7 2:11, Paolo Bonzini wrote:
>
> On 06/03/2017 15:05, hangaohuai wrote:
>> Bug steps:
>> 1. windows VM with pvpanic device:<panic model='isa'/>in xml
>> 2. inject the panic in windows, the vm state is paused (guest-panicked)
>> 3. migrate the vm to other host, vm state is running
>>
>> Check the vmstate before runstate_set(RUN_STATE_RUNNING)
> What's the backtrace for runstate_set(RUN_STATE_RUNNING)?
>
> This should be triggered:
>
>     if (!global_state_received() ||
>         global_state_get_runstate() == RUN_STATE_RUNNING) {
>         if (autostart) {
>             vm_start();
>         } else {
>             runstate_set(RUN_STATE_PAUSED);
>         }
>     } else {
>         runstate_set(global_state_get_runstate());   /* <<<< */
>     }
>
> I also suggest a testcase to tests/pvpanic-test.c.
>
> Paolo
>
>> Signed-off-by: hangaohuai <hangaohuai@huawei.com>
>> ---
>>  cpus.c                  | 3 +++
>>  include/sysemu/sysemu.h | 1 +
>>  vl.c                    | 5 +++++
>>  3 files changed, 9 insertions(+)
>>
>> diff --git a/cpus.c b/cpus.c
>> index c857ad2..37b93aa 100644
>> --- a/cpus.c
>> +++ b/cpus.c
>> @@ -1734,6 +1734,9 @@ int vm_prepare_start(void)
>>      if (runstate_is_running()) {
>>          qapi_event_send_stop(&error_abort);
>>          res = -1;
>> +    } else if (runstate_is_paniced()) {
>> +        qemu_system_guest_panicked(NULL);
>> +        res = -1;
>>      } else {
>>          replay_enable_events();
>>          cpu_enable_ticks();
> .
>

      reply	other threads:[~2017-03-07  6:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-06 14:05 [Qemu-devel] [PATCH] Fix the vm state after vm migration when vm panic hangaohuai
2017-03-06 18:11 ` Paolo Bonzini
2017-03-07  6:54   ` hangaohuai [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=58BE590E.4070202@huawei.com \
    --to=hangaohuai@huawei.com \
    --cc=arei.gonglei@huawei.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.