[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 07/21] Fix bugs when VM shutdown with virtio-gpu unplugged
From: |
Michael S. Tsirkin |
Subject: |
[PULL 07/21] Fix bugs when VM shutdown with virtio-gpu unplugged |
Date: |
Tue, 26 Dec 2023 04:24:26 -0500 |
From: wangmeiling <wangmeiling21@huawei.com>
Virtio-gpu malloc memory for the queue when it realized, but the queues was not
released when it unrealized, which resulting in a memory leak. In addition,
vm_change_state_handler is not cleaned up, which is related to vdev and will
lead to segmentation fault when VM shutdown.
Signed-off-by: wangmeiling <wangmeiling21@huawei.com>
Signed-off-by: Binfeng Wu <wubinfeng@huawei.com>
Message-Id: <7bbbc0f3-2ad9-83ca-b39b-f976d0837daf@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/display/virtio-gpu-base.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/display/virtio-gpu-base.c b/hw/display/virtio-gpu-base.c
index 37af256219..4fc7ef8896 100644
--- a/hw/display/virtio-gpu-base.c
+++ b/hw/display/virtio-gpu-base.c
@@ -251,7 +251,11 @@ void
virtio_gpu_base_device_unrealize(DeviceState *qdev)
{
VirtIOGPUBase *g = VIRTIO_GPU_BASE(qdev);
+ VirtIODevice *vdev = VIRTIO_DEVICE(qdev);
+ virtio_del_queue(vdev, 0);
+ virtio_del_queue(vdev, 1);
+ virtio_cleanup(vdev);
migrate_del_blocker(&g->migration_blocker);
}
--
MST
- [PULL 00/21] virtio,pc,pci: features, cleanups, fixes, Michael S. Tsirkin, 2023/12/26
- [PULL 01/21] virtio: rng: Check notifier helpers for VIRTIO_CONFIG_IRQ_IDX, Michael S. Tsirkin, 2023/12/26
- [PULL 02/21] tests: bios-tables-test: Rename smbios type 4 related test functions, Michael S. Tsirkin, 2023/12/26
- [PULL 03/21] vhost: Add worker backend callouts, Michael S. Tsirkin, 2023/12/26
- [PULL 04/21] vhost-scsi: Add support for a worker thread per virtqueue, Michael S. Tsirkin, 2023/12/26
- [PULL 05/21] hw/acpi: propagate vcpu hotplug after switch to modern interface, Michael S. Tsirkin, 2023/12/26
- [PULL 07/21] Fix bugs when VM shutdown with virtio-gpu unplugged,
Michael S. Tsirkin <=
- [PULL 08/21] vdpa: do not set virtio status bits if unneeded, Michael S. Tsirkin, 2023/12/26
- [PULL 09/21] vdpa: add VhostVDPAShared, Michael S. Tsirkin, 2023/12/26
- [PULL 10/21] vdpa: move iova tree to the shared struct, Michael S. Tsirkin, 2023/12/26
- [PULL 11/21] vdpa: move iova_range to vhost_vdpa_shared, Michael S. Tsirkin, 2023/12/26
- [PULL 12/21] vdpa: move shadow_data to vhost_vdpa_shared, Michael S. Tsirkin, 2023/12/26
- [PULL 13/21] vdpa: use vdpa shared for tracing, Michael S. Tsirkin, 2023/12/26
- [PULL 14/21] vdpa: move file descriptor to vhost_vdpa_shared, Michael S. Tsirkin, 2023/12/26
- [PULL 15/21] vdpa: move iotlb_batch_begin_sent to vhost_vdpa_shared, Michael S. Tsirkin, 2023/12/26
- [PULL 16/21] vdpa: move backend_cap to vhost_vdpa_shared, Michael S. Tsirkin, 2023/12/26
- [PULL 17/21] vdpa: remove msg type of vhost_vdpa, Michael S. Tsirkin, 2023/12/26