mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-25 04:30:02 +00:00
hw/virtio: Add flatview update in vhost_user_cleanup()
Qemu will crash on vhost backend unexpected exit and re-connect │ in some case due to access released memory. Signed-off-by: Yuwei Zhang <zhangyuwei.9149@bytedance.com> Message-Id: <20210830123433.45727-1-zhangyuwei.9149@bytedance.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
b116d6c319
commit
c6effa9cf5
@ -2480,7 +2480,7 @@ void vhost_user_cleanup(VhostUserState *user)
|
|||||||
if (!user->chr) {
|
if (!user->chr) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
memory_region_transaction_begin();
|
||||||
for (i = 0; i < VIRTIO_QUEUE_MAX; i++) {
|
for (i = 0; i < VIRTIO_QUEUE_MAX; i++) {
|
||||||
if (user->notifier[i].addr) {
|
if (user->notifier[i].addr) {
|
||||||
object_unparent(OBJECT(&user->notifier[i].mr));
|
object_unparent(OBJECT(&user->notifier[i].mr));
|
||||||
@ -2488,6 +2488,7 @@ void vhost_user_cleanup(VhostUserState *user)
|
|||||||
user->notifier[i].addr = NULL;
|
user->notifier[i].addr = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
memory_region_transaction_commit();
|
||||||
user->chr = NULL;
|
user->chr = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user