[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 37/91] virtio-pci: Fix the failure process in kvm_virtio_pci_vecto
From: |
Michael S. Tsirkin |
Subject: |
[PULL 37/91] virtio-pci: Fix the failure process in kvm_virtio_pci_vector_use_one() |
Date: |
Tue, 2 Jul 2024 10:08:51 -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 23/91] hw/mem/cxl_type3: Add host backend and address space handling for DC regions, (continued)
- [PULL 23/91] hw/mem/cxl_type3: Add host backend and address space handling for DC regions, Michael S. Tsirkin, 2024/07/02
- [PULL 25/91] hw/cxl/cxl-mailbox-utils: Add mailbox commands to support add/release dynamic capacity response, Michael S. Tsirkin, 2024/07/02
- [PULL 28/91] hw/cxl/cxl-mailbox-utils: Add superset extent release mailbox support, Michael S. Tsirkin, 2024/07/02
- [PULL 27/91] hw/mem/cxl_type3: Add DPA range validation for accesses to DC regions, Michael S. Tsirkin, 2024/07/02
- [PULL 24/91] hw/mem/cxl_type3: Add DC extent list representative and get DC extent list mailbox support, Michael S. Tsirkin, 2024/07/02
- [PULL 29/91] hw/mem/cxl_type3: Allow to release extent superset in QMP interface, Michael S. Tsirkin, 2024/07/02
- [PULL 26/91] hw/cxl/events: Add qmp interfaces to add/release dynamic capacity extents, Michael S. Tsirkin, 2024/07/02
- [PULL 32/91] tests/qtest/pvpanic: use centralized definition of supported events, Michael S. Tsirkin, 2024/07/02
- [PULL 33/91] hw/misc/pvpanic: add support for normal shutdowns, Michael S. Tsirkin, 2024/07/02
- [PULL 31/91] hw/misc/pvpanic: centralize definition of supported events, Michael S. Tsirkin, 2024/07/02
- [PULL 37/91] virtio-pci: Fix the failure process in kvm_virtio_pci_vector_use_one(),
Michael S. Tsirkin <=
- [PULL 38/91] hw/cxl: Fix read from bogus memory, Michael S. Tsirkin, 2024/07/02
- [PULL 34/91] pvpanic: Emit GUEST_PVSHUTDOWN QMP event on pvpanic shutdown signal, Michael S. Tsirkin, 2024/07/02
- [PULL 36/91] Revert "docs/specs/pvpanic: mark shutdown event as not implemented", Michael S. Tsirkin, 2024/07/02
- [PULL 40/91] vhost-user-test: don't set call fd -1 non-blocking, Michael S. Tsirkin, 2024/07/02
- [PULL 35/91] tests/qtest/pvpanic: add tests for pvshutdown event, Michael S. Tsirkin, 2024/07/02
- [PULL 39/91] virtio-pci: implement No_Soft_Reset bit, Michael S. Tsirkin, 2024/07/02
- [PULL 41/91] i386/apic: Add hint on boot failure because of disabling x2APIC, Michael S. Tsirkin, 2024/07/02
- [PULL 42/91] hw/virtio: Free vqs after vhost_dev_cleanup(), Michael S. Tsirkin, 2024/07/02
- [PULL 45/91] hw/net/virtio-net.c: fix crash in iov_copy(), Michael S. Tsirkin, 2024/07/02
- [PULL 44/91] vhost-user: Skip unnecessary duplicated VHOST_USER_SET_LOG_BASE requests, Michael S. Tsirkin, 2024/07/02