[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 14/52] vhost-user-blk: reconnect on any error during realize
From: |
Michael S. Tsirkin |
Subject: |
[PULL 14/52] vhost-user-blk: reconnect on any error during realize |
Date: |
Thu, 6 Jan 2022 08:16:53 -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 03/52] virtio: introduce macro IRTIO_CONFIG_IRQ_IDX, (continued)
- [PULL 03/52] virtio: introduce macro IRTIO_CONFIG_IRQ_IDX, Michael S. Tsirkin, 2022/01/06
- [PULL 06/52] vhost: introduce new VhostOps vhost_set_config_call, Michael S. Tsirkin, 2022/01/06
- [PULL 05/52] virtio-pci: decouple the single vector from the interrupt process, Michael S. Tsirkin, 2022/01/06
- [PULL 07/52] vhost-vdpa: add support for config interrupt, Michael S. Tsirkin, 2022/01/06
- [PULL 09/52] vhost: add support for configure interrupt, Michael S. Tsirkin, 2022/01/06
- [PULL 12/52] virtio-pci: add support for configure interrupt, Michael S. Tsirkin, 2022/01/06
- [PULL 08/52] virtio: add support for configure interrupt, Michael S. Tsirkin, 2022/01/06
- [PULL 10/52] virtio-net: add support for configure interrupt, Michael S. Tsirkin, 2022/01/06
- [PULL 11/52] virtio-mmio: add support for configure interrupt, Michael S. Tsirkin, 2022/01/06
- [PULL 13/52] trace-events,pci: unify trace events format, Michael S. Tsirkin, 2022/01/06
- [PULL 14/52] vhost-user-blk: reconnect on any error during realize,
Michael S. Tsirkin <=
- [PULL 16/52] chardev/char-socket: tcp_chr_sync_read: don't clobber errno, Michael S. Tsirkin, 2022/01/06
- [PULL 15/52] chardev/char-socket: tcp_chr_recv: don't clobber errno, Michael S. Tsirkin, 2022/01/06
- [PULL 17/52] vhost-backend: avoid overflow on memslots_limit, Michael S. Tsirkin, 2022/01/06
- [PULL 19/52] vhost-vdpa: stick to -errno error return convention, Michael S. Tsirkin, 2022/01/06
- [PULL 20/52] vhost-user: stick to -errno error return convention, Michael S. Tsirkin, 2022/01/06
- [PULL 22/52] vhost-user-blk: propagate error return from generic vhost, Michael S. Tsirkin, 2022/01/06
- [PULL 18/52] vhost-backend: stick to -errno error return convention, Michael S. Tsirkin, 2022/01/06
- [PULL 23/52] pci: Export the pci_intx() function, Michael S. Tsirkin, 2022/01/06
- [PULL 25/52] smbios: Rename SMBIOS_ENTRY_POINT_* enums, Michael S. Tsirkin, 2022/01/06
- [PULL 21/52] vhost: stick to -errno error return convention, Michael S. Tsirkin, 2022/01/06