qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] vl.c/exit: pause cpus before closing block devices
@ 2017-07-13 19:01 Dr. David Alan Gilbert (git)
  2017-07-17 10:17 ` Stefan Hajnoczi
  2017-08-02 14:42 ` Alberto Garcia
  0 siblings, 2 replies; 17+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2017-07-13 19:01 UTC (permalink / raw)
  To: qemu-devel, pbonzini, jsnow

From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>

There's a rare exit seg if the guest is accessing
IO during exit.
It's always hitting the atomic_inc(&bs->in_flight) with a NULL
bs. This was added recently in 99723548  but I don't see it
as the cause.

Flip vl.c around so we pause the cpus before closing the block devices,
that way we shouldn't have anything trying to access them when
they're gone.

This was originally Red Hat bz https://bugzilla.redhat.com/show_bug.cgi?id=1451015

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reported-by: Cong Li <coli@redhat.com>

--
This is a very rare race, I'll leave it running in a loop to see if
we hit anything else and to check this really fixes it.

I do worry if there are other cases that can trigger this - e.g.
hot-unplug or ejecting a CD.

---
 vl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vl.c b/vl.c
index f7560de622..d53f715e91 100644
--- a/vl.c
+++ b/vl.c
@@ -4787,8 +4787,8 @@ int main(int argc, char **argv, char **envp)
     replay_disable_events();
     iothread_stop_all();
 
-    bdrv_close_all();
     pause_all_vcpus();
+    bdrv_close_all();
     res_free();
 
     /* vhost-user must be cleaned up before chardevs.  */
-- 
2.13.0

^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2017-08-08 13:07 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-13 19:01 [Qemu-devel] [PATCH] vl.c/exit: pause cpus before closing block devices Dr. David Alan Gilbert (git)
2017-07-17 10:17 ` Stefan Hajnoczi
2017-07-17 10:26   ` Dr. David Alan Gilbert
2017-07-17 16:43     ` John Snow
2017-08-04  9:58       ` Stefan Hajnoczi
2017-08-04 11:46         ` Paolo Bonzini
2017-08-08 10:02           ` Kevin Wolf
2017-08-08 11:04             ` Paolo Bonzini
2017-08-08 11:56               ` Kevin Wolf
2017-08-08 12:47                 ` Paolo Bonzini
2017-08-08 12:53           ` Stefan Hajnoczi
2017-08-08 13:03             ` Kevin Wolf
2017-08-08 13:07             ` Paolo Bonzini
2017-08-02 14:42 ` Alberto Garcia
2017-08-03 16:45   ` Dr. David Alan Gilbert
2017-08-03 22:36     ` Paolo Bonzini
2017-08-04  9:56       ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).