[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 24/53] vhost: release virtqueue objects in error path
From: |
Michael S. Tsirkin |
Subject: |
[PULL 24/53] vhost: release virtqueue objects in error path |
Date: |
Mon, 26 Jun 2023 08:29:02 -0400 |
From: Prasad Pandit <pjp@fedoraproject.org>
vhost_dev_start function does not release virtqueue objects when
event_notifier_init() function fails. Release virtqueue objects
and log a message about function failure.
Signed-off-by: Prasad Pandit <pjp@fedoraproject.org>
Message-Id: <20230529114333.31686-3-ppandit@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Fixes: f9a09ca3ea ("vhost: add support for configure interrupt")
Reviewed-by: Peter Xu <peterx@redhat.com>
Cc: qemu-stable@nongnu.org
Acked-by: Jason Wang <jasowang@redhat.com>
---
hw/virtio/vhost.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index 7e1f556994..fb7abc9769 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -1941,7 +1941,8 @@ int vhost_dev_start(struct vhost_dev *hdev, VirtIODevice
*vdev, bool vrings)
r = event_notifier_init(
&hdev->vqs[VHOST_QUEUE_NUM_CONFIG_INR].masked_config_notifier, 0);
if (r < 0) {
- return r;
+ VHOST_OPS_DEBUG(r, "event_notifier_init failed");
+ goto fail_vq;
}
event_notifier_test_and_clear(
&hdev->vqs[VHOST_QUEUE_NUM_CONFIG_INR].masked_config_notifier);
--
MST
- [PULL 08/53] hw/cxl/events: Add event interrupt support, (continued)
- [PULL 08/53] hw/cxl/events: Add event interrupt support, Michael S. Tsirkin, 2023/06/26
- [PULL 09/53] hw/cxl/events: Add injection of General Media Events, Michael S. Tsirkin, 2023/06/26
- [PULL 10/53] hw/cxl/events: Add injection of DRAM events, Michael S. Tsirkin, 2023/06/26
- [PULL 11/53] hw/cxl/events: Add injection of Memory Module Events, Michael S. Tsirkin, 2023/06/26
- [PULL 12/53] cryptodev-vhost-user: add asymmetric crypto support, Michael S. Tsirkin, 2023/06/26
- [PULL 13/53] softmmu: Introduce qemu_target_page_mask() helper, Michael S. Tsirkin, 2023/06/26
- [PULL 15/53] hw/scsi: Rearrange meson.build, Michael S. Tsirkin, 2023/06/26
- [PULL 18/53] hw/virtio/virtio-mem: Use qemu_ram_get_fd() helper, Michael S. Tsirkin, 2023/06/26
- [PULL 14/53] hw/scsi: Introduce VHOST_SCSI_COMMON symbol in Kconfig, Michael S. Tsirkin, 2023/06/26
- [PULL 23/53] vhost: release memory_listener object in error path, Michael S. Tsirkin, 2023/06/26
- [PULL 24/53] vhost: release virtqueue objects in error path,
Michael S. Tsirkin <=
- [PULL 25/53] pci: ROM preallocation for incoming migration, Michael S. Tsirkin, 2023/06/26
- [PULL 16/53] hw/scsi: Rename target-specific source set as 'specific_virtio_scsi_ss', Michael S. Tsirkin, 2023/06/26
- [PULL 27/53] vdpa: return errno in vhost_vdpa_get_vring_group error, Michael S. Tsirkin, 2023/06/26
- [PULL 30/53] hw/acpi: Fix PM control register access, Michael S. Tsirkin, 2023/06/26
- [PULL 38/53] vdpa: reuse virtio_vdev_has_feature(), Michael S. Tsirkin, 2023/06/26
- [PULL 20/53] hw/virtio/virtio-iommu: Use target-agnostic qemu_target_page_mask(), Michael S. Tsirkin, 2023/06/26
- [PULL 37/53] include/hw/virtio: make some VirtIODevice const, Michael S. Tsirkin, 2023/06/26
- [PULL 21/53] hw/virtio: Remove unnecessary 'virtio-access.h' header, Michael S. Tsirkin, 2023/06/26