summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDr. David Alan Gilbert <dgilbert@redhat.com>2017-07-13 20:01:16 +0100
committerMichael Roth <mdroth@linux.vnet.ibm.com>2017-08-31 17:09:34 -0500
commit53206753ba1e0eb1e2b508c2608962a194d0df25 (patch)
tree13b12904a3f2091e3f18d44f82377635e5f34c84
parent167e76494e0ae3250585b98c32004ae340283a97 (diff)
downloadqemu-53206753ba1e0eb1e2b508c2608962a194d0df25.tar.gz
vl.c/exit: pause cpus before closing block devices
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. Message-Id: <20170713190116.21608-1-dgilbert@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> (cherry picked from commit 452589b6b47e8dc6353df257fc803dfc1383bed8) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
-rw-r--r--vl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/vl.c b/vl.c
index 0b4ed5241c..c465eb2af2 100644
--- a/vl.c
+++ b/vl.c
@@ -4710,8 +4710,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. */