[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 14/55] vhost-user-blk: reconnect on any error during realize
From: |
Michael S. Tsirkin |
Subject: |
[PULL v2 14/55] vhost-user-blk: reconnect on any error during realize |
Date: |
Fri, 7 Jan 2022 06:03:45 -0500 |
From: Roman Kagan <rvkagan@yandex-team.ru>
vhost-user-blk realize only attempts to reconnect if the previous
connection attempt failed on "a problem with the connection and not an
error related to the content (which would fail again the same way in the
next attempt)".
However this distinction is very subtle, and may be inadvertently broken
if the code changes somewhere deep down the stack and a new error gets
propagated up to here.
OTOH now that the number of reconnection attempts is limited it seems
harmless to try reconnecting on any error.
So relax the condition of whether to retry connecting to check for any
error.
This patch amends a527e312b5 "vhost-user-blk: Implement reconnection
during realize".
Signed-off-by: Roman Kagan <rvkagan@yandex-team.ru>
Message-Id: <20211111153354.18807-2-rvkagan@yandex-team.ru>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Raphael Norwitz <raphael.norwitz@nutanix.com>
---
hw/block/vhost-user-blk.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c
index ba13cb87e5..f9b17f6813 100644
--- a/hw/block/vhost-user-blk.c
+++ b/hw/block/vhost-user-blk.c
@@ -511,7 +511,7 @@ static void vhost_user_blk_device_realize(DeviceState *dev,
Error **errp)
*errp = NULL;
}
ret = vhost_user_blk_realize_connect(s, errp);
- } while (ret == -EPROTO && retries--);
+ } while (ret < 0 && retries--);
if (ret < 0) {
goto virtio_err;
--
MST
- [PULL v2 04/55] virtio-pci: decouple notifier from interrupt process, (continued)
- [PULL v2 04/55] virtio-pci: decouple notifier from interrupt process, Michael S. Tsirkin, 2022/01/07
- [PULL v2 05/55] virtio-pci: decouple the single vector from the interrupt process, Michael S. Tsirkin, 2022/01/07
- [PULL v2 06/55] vhost: introduce new VhostOps vhost_set_config_call, Michael S. Tsirkin, 2022/01/07
- [PULL v2 07/55] vhost-vdpa: add support for config interrupt, Michael S. Tsirkin, 2022/01/07
- [PULL v2 09/55] vhost: add support for configure interrupt, Michael S. Tsirkin, 2022/01/07
- [PULL v2 10/55] virtio-net: add support for configure interrupt, Michael S. Tsirkin, 2022/01/07
- [PULL v2 08/55] virtio: add support for configure interrupt, Michael S. Tsirkin, 2022/01/07
- [PULL v2 11/55] virtio-mmio: add support for configure interrupt, Michael S. Tsirkin, 2022/01/07
- [PULL v2 12/55] virtio-pci: add support for configure interrupt, Michael S. Tsirkin, 2022/01/07
- [PULL v2 13/55] trace-events,pci: unify trace events format, Michael S. Tsirkin, 2022/01/07
- [PULL v2 14/55] vhost-user-blk: reconnect on any error during realize,
Michael S. Tsirkin <=
- [PULL v2 15/55] chardev/char-socket: tcp_chr_recv: don't clobber errno, Michael S. Tsirkin, 2022/01/07
- [PULL v2 16/55] chardev/char-socket: tcp_chr_sync_read: don't clobber errno, Michael S. Tsirkin, 2022/01/07
- [PULL v2 17/55] vhost-backend: avoid overflow on memslots_limit, Michael S. Tsirkin, 2022/01/07
- [PULL v2 19/55] vhost-vdpa: stick to -errno error return convention, Michael S. Tsirkin, 2022/01/07
- [PULL v2 18/55] vhost-backend: stick to -errno error return convention, Michael S. Tsirkin, 2022/01/07
- [PULL v2 20/55] vhost-user: stick to -errno error return convention, Michael S. Tsirkin, 2022/01/07
- [PULL v2 21/55] vhost: stick to -errno error return convention, Michael S. Tsirkin, 2022/01/07
- [PULL v2 22/55] vhost-user-blk: propagate error return from generic vhost, Michael S. Tsirkin, 2022/01/07
- [PULL v2 23/55] pci: Export the pci_intx() function, Michael S. Tsirkin, 2022/01/07
- [PULL v2 24/55] pcie_aer: Don't trigger a LSI if none are defined, Michael S. Tsirkin, 2022/01/07