All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>
To: qemu-devel@nongnu.org, pbonzini@redhat.com, jsnow@redhat.com
Subject: [Qemu-devel] [PATCH] vl.c/exit: pause cpus before closing block devices
Date: Thu, 13 Jul 2017 20:01:16 +0100	[thread overview]
Message-ID: <20170713190116.21608-1-dgilbert@redhat.com> (raw)

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

             reply	other threads:[~2017-07-13 19:01 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-13 19:01 Dr. David Alan Gilbert (git) [this message]
2017-07-17 10:17 ` [Qemu-devel] [PATCH] vl.c/exit: pause cpus before closing block devices 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

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=20170713190116.21608-1-dgilbert@redhat.com \
    --to=dgilbert@redhat.com \
    --cc=jsnow@redhat.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.