[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-8.0.3 52/54] vhost: release virtqueue objects in error path
From: |
Michael Tokarev |
Subject: |
[Stable-8.0.3 52/54] vhost: release virtqueue objects in error path |
Date: |
Mon, 26 Jun 2023 21:49:59 +0300 |
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>
(cherry picked from commit 77ece20ba04582d94c345ac0107ddff2fd18d27a)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index 7c87f1328b..58bd9ab82a 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -1956,7 +1956,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);
--
2.39.2
- [PATCH 0/6] migration: Test the new "file:" migration, Fabiano Rosas, 2023/06/26
- [PATCH 2/6] tests/qtest: migration: Expose migrate_set_capability, Fabiano Rosas, 2023/06/26
- [PATCH 1/6] migration: Set migration status early in incoming side, Fabiano Rosas, 2023/06/26
- [PATCH 3/6] tests/qtest: migration: Add migrate_incoming_qmp helper, Fabiano Rosas, 2023/06/26
- [PATCH 4/6] tests/qtest: migration: Use migrate_incoming_qmp where appropriate, Fabiano Rosas, 2023/06/26
- [PATCH 5/6] tests/qtest: migration: Add support for negative testing of qmp_migrate, Fabiano Rosas, 2023/06/26
- [PATCH 6/6] tests/qtest: migration-test: Add tests for file-based migration, Fabiano Rosas, 2023/06/26