Fix bugs when VM shutdown with virtio-gpu unplugged
authorwangmeiling <wangmeiling21@huawei.com>
Thu, 14 Dec 2023 07:22:08 +0000 (07:22 +0000)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 26 Dec 2023 09:51:07 +0000 (04:51 -0500)
commit410cefbd5c3682432229f5905aa43358785d2ae0
treedebdd52d2d94226d40cb2945685c632048bdc5a0
parent551bf7b4c1795ef89407039dd908c2f199b122c2
Fix bugs when VM shutdown with virtio-gpu unplugged

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