[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 37/88] virtio-pci: Fix the failure process in kvm_virtio_pci_ve
From: |
Michael S. Tsirkin |
Subject: |
[PULL v2 37/88] virtio-pci: Fix the failure process in kvm_virtio_pci_vector_use_one() |
Date: |
Tue, 2 Jul 2024 16:17:40 -0400 |
From: Cindy Lu <lulu@redhat.com>
In function kvm_virtio_pci_vector_use_one(), the function will only use
the irqfd/vector for itself. Therefore, in the undo label, the failing
process is incorrect.
To fix this, we can just remove this label.
Fixes: f9a09ca3ea ("vhost: add support for configure interrupt")
Cc: qemu-stable@nongnu.org
Signed-off-by: Cindy Lu <lulu@redhat.com>
Message-Id: <20240528084840.194538-1-lulu@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/virtio/virtio-pci.c | 18 ++----------------
1 file changed, 2 insertions(+), 16 deletions(-)
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 7d62e92365..5941f1a94d 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -898,7 +898,7 @@ static int kvm_virtio_pci_vector_use_one(VirtIOPCIProxy
*proxy, int queue_no)
}
ret = kvm_virtio_pci_vq_vector_use(proxy, vector);
if (ret < 0) {
- goto undo;
+ return ret;
}
/*
* If guest supports masking, set up irqfd now.
@@ -908,25 +908,11 @@ static int kvm_virtio_pci_vector_use_one(VirtIOPCIProxy
*proxy, int queue_no)
ret = kvm_virtio_pci_irqfd_use(proxy, n, vector);
if (ret < 0) {
kvm_virtio_pci_vq_vector_release(proxy, vector);
- goto undo;
+ return ret;
}
}
return 0;
-undo:
-
- vector = virtio_queue_vector(vdev, queue_no);
- if (vector >= msix_nr_vectors_allocated(dev)) {
- return ret;
- }
- if (vdev->use_guest_notifier_mask && k->guest_notifier_mask) {
- ret = virtio_pci_get_notifier(proxy, queue_no, &n, &vector);
- if (ret < 0) {
- return ret;
- }
- kvm_virtio_pci_irqfd_release(proxy, n, vector);
- }
- return ret;
}
static int kvm_virtio_pci_vector_vq_use(VirtIOPCIProxy *proxy, int nvqs)
{
--
MST
- [PULL v2 18/88] hw/cxl/cxl-mailbox-utils: Add dc_event_log_size field to output payload of identify memory device command, (continued)
- [PULL v2 18/88] hw/cxl/cxl-mailbox-utils: Add dc_event_log_size field to output payload of identify memory device command, Michael S. Tsirkin, 2024/07/02
- [PULL v2 26/88] hw/cxl/events: Add qmp interfaces to add/release dynamic capacity extents, Michael S. Tsirkin, 2024/07/02
- [PULL v2 30/88] linux-headers: update to 6.10-rc1, Michael S. Tsirkin, 2024/07/02
- [PULL v2 31/88] hw/misc/pvpanic: centralize definition of supported events, Michael S. Tsirkin, 2024/07/02
- [PULL v2 33/88] hw/misc/pvpanic: add support for normal shutdowns, Michael S. Tsirkin, 2024/07/02
- [PULL v2 34/88] pvpanic: Emit GUEST_PVSHUTDOWN QMP event on pvpanic shutdown signal, Michael S. Tsirkin, 2024/07/02
- [PULL v2 13/88] vhost-user-gpu: fix import of DMABUF, Michael S. Tsirkin, 2024/07/02
- [PULL v2 32/88] tests/qtest/pvpanic: use centralized definition of supported events, Michael S. Tsirkin, 2024/07/02
- [PULL v2 35/88] tests/qtest/pvpanic: add tests for pvshutdown event, Michael S. Tsirkin, 2024/07/02
- [PULL v2 36/88] Revert "docs/specs/pvpanic: mark shutdown event as not implemented", Michael S. Tsirkin, 2024/07/02
- [PULL v2 37/88] virtio-pci: Fix the failure process in kvm_virtio_pci_vector_use_one(),
Michael S. Tsirkin <=
- [PULL v2 39/88] virtio-pci: implement No_Soft_Reset bit, Michael S. Tsirkin, 2024/07/02
- [PULL v2 40/88] vhost-user-test: no set non-blocking for cal fd less than 0., Michael S. Tsirkin, 2024/07/02
- [PULL v2 41/88] i386/apic: Add hint on boot failure because of disabling x2APIC, Michael S. Tsirkin, 2024/07/02
- [PULL v2 42/88] hw/virtio: Free vqs after vhost_dev_cleanup(), Michael S. Tsirkin, 2024/07/02
- [PULL v2 38/88] hw/cxl: Fix read from bogus memory, Michael S. Tsirkin, 2024/07/02
- [PULL v2 46/88] qapi: clarify that the default is backend dependent, Michael S. Tsirkin, 2024/07/02
- [PULL v2 50/88] vhost-user-server: do not set memory fd non-blocking, Michael S. Tsirkin, 2024/07/02
- [PULL v2 43/88] virtio-iommu: add error check before assert, Michael S. Tsirkin, 2024/07/02
- [PULL v2 44/88] vhost-user: Skip unnecessary duplicated VHOST_USER_SET_LOG_BASE requests, Michael S. Tsirkin, 2024/07/02
- [PULL v2 48/88] libvhost-user: fail vu_message_write() if sendmsg() is failing, Michael S. Tsirkin, 2024/07/02