[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] vl.c/exit: pause cpus before closing block devices
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[Qemu-devel] [PATCH] vl.c/exit: pause cpus before closing block devices |
Date: |
Thu, 13 Jul 2017 20:01:16 +0100 |
From: "Dr. David Alan Gilbert" <address@hidden>
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 <address@hidden>
Reported-by: Cong Li <address@hidden>
--
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
- [Qemu-devel] [PATCH] vl.c/exit: pause cpus before closing block devices,
Dr. David Alan Gilbert (git) <=