From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Jay Zhou <jianjay.zhou@huawei.com>,
qemu-devel@nongnu.org, quintela@redhat.com,
wangxinxin.wang@huawei.com
Subject: Re: [Qemu-devel] [RFC PATCH] vl: fix migration when watchdog expires
Date: Tue, 14 Aug 2018 12:52:03 +0100 [thread overview]
Message-ID: <20180814115202.GH2580@work-vm> (raw)
In-Reply-To: <2278afdb-d2a6-54b3-67c7-c1f43e4d311c@redhat.com>
* Paolo Bonzini (pbonzini@redhat.com) wrote:
> On 14/08/2018 12:48, Jay Zhou wrote:
> > I got the following error when migrating a VM with watchdog
> > device:
> >
> > {"timestamp": {"seconds": 1533884471, "microseconds": 668099},
> > "event": "WATCHDOG", "data": {"action": "reset"}}
> > {"timestamp": {"seconds": 1533884471, "microseconds": 677658},
> > "event": "RESET", "data": {"guest": true}}
> > {"timestamp": {"seconds": 1533884471, "microseconds": 677874},
> > "event": "STOP"}
> > qemu-system-x86_64: invalid runstate transition: 'prelaunch' -> 'postmigrate'
> > Aborted
> >
> > The run state transition is RUN_STATE_FINISH_MIGRATE to RUN_STATE_PRELAUNCH,
> > then the migration thread aborted when it tries to set RUN_STATE_POSTMIGRATE.
> > There is a race between the main loop thread and the migration thread I think.
>
> In that case I think you shouldn't go to POSTMIGRATE at all, because the
> VM has been reset.
Migration has the VM stopped; it's not expecting the state to change at
that point.
> Alternatively, when the watchdog fires in RUN_STATE_FINISH_MIGRATE
> state, it might delay the action until after the "cont" command is
> invoked on the source, but I'm not sure what's the best way to achieve
> that...
Jay: Which watchdog were you using?
a) Should the watchdog expire when the VM is stopped; I think it
shouldn't - hw/acpi/tco.c uses a virtual timer as does i6300esb; so
is the bug here that the watchdog being used didn't use a virtual
timer?
b) If the watchdog expires just before the VM gets stopped, is there
a race which could hit this? Possibly.
c) Could main_loop_should_exit guard all the 'request's by
something that checks whether the VM is stopped?
Dave
> Paolo
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
next prev parent reply other threads:[~2018-08-14 11:52 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-14 10:48 [Qemu-devel] [RFC PATCH] vl: fix migration when watchdog expires Jay Zhou
2018-08-14 11:20 ` Paolo Bonzini
2018-08-14 11:52 ` Dr. David Alan Gilbert [this message]
2018-08-14 12:02 ` Paolo Bonzini
2018-08-14 13:03 ` Zhoujian (jay)
2018-08-14 13:07 ` Paolo Bonzini
2018-08-14 13:34 ` Zhoujian (jay)
2018-08-16 7:22 ` Zhoujian (jay)
2018-08-17 16:03 ` Paolo Bonzini
2018-08-17 16:09 ` Dr. David Alan Gilbert
2018-08-14 12:49 ` Zhoujian (jay)
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=20180814115202.GH2580@work-vm \
--to=dgilbert@redhat.com \
--cc=jianjay.zhou@huawei.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=wangxinxin.wang@huawei.com \
/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.