[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 01/30] migration/channel-block: fix return value for qio_channel_b
From: |
Juan Quintela |
Subject: |
[PULL 01/30] migration/channel-block: fix return value for qio_channel_block_{readv, writev} |
Date: |
Tue, 15 Nov 2022 16:34:45 +0100 |
From: Fiona Ebner <f.ebner@proxmox.com>
in the error case. The documentation in include/io/channel.h states
that -1 or QIO_CHANNEL_ERR_BLOCK should be returned upon error. Simply
passing along the return value from the bdrv-functions has the
potential to confuse the call sides. Non-blocking mode is not
implemented currently, so -1 it is.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
migration/channel-block.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/migration/channel-block.c b/migration/channel-block.c
index c55c8c93ce..f4ab53acdb 100644
--- a/migration/channel-block.c
+++ b/migration/channel-block.c
@@ -62,7 +62,8 @@ qio_channel_block_readv(QIOChannel *ioc,
qemu_iovec_init_external(&qiov, (struct iovec *)iov, niov);
ret = bdrv_readv_vmstate(bioc->bs, &qiov, bioc->offset);
if (ret < 0) {
- return ret;
+ error_setg_errno(errp, -ret, "bdrv_readv_vmstate failed");
+ return -1;
}
bioc->offset += qiov.size;
@@ -86,7 +87,8 @@ qio_channel_block_writev(QIOChannel *ioc,
qemu_iovec_init_external(&qiov, (struct iovec *)iov, niov);
ret = bdrv_writev_vmstate(bioc->bs, &qiov, bioc->offset);
if (ret < 0) {
- return ret;
+ error_setg_errno(errp, -ret, "bdrv_writev_vmstate failed");
+ return -1;
}
bioc->offset += qiov.size;
--
2.38.1
- [PULL 00/30] Next patches, Juan Quintela, 2022/11/15
- [PULL 05/30] multifd: Create page_count fields into both MultiFD{Recv, Send}Params, Juan Quintela, 2022/11/15
- [PULL 01/30] migration/channel-block: fix return value for qio_channel_block_{readv, writev},
Juan Quintela <=
- [PULL 03/30] migration: check magic value for deciding the mapping of channels, Juan Quintela, 2022/11/15
- [PULL 04/30] multifd: Create page_size fields into both MultiFD{Recv, Send}Params, Juan Quintela, 2022/11/15
- [PULL 02/30] migration/multifd/zero-copy: Create helper function for flushing, Juan Quintela, 2022/11/15
- [PULL 10/30] migration: Fix possible infinite loop of ram save process, Juan Quintela, 2022/11/15
- [PULL 07/30] migration: Export ram_release_page(), Juan Quintela, 2022/11/15
- [PULL 08/30] Update AVX512 support for xbzrle_encode_buffer, Juan Quintela, 2022/11/15
- [PULL 09/30] Unit test code and benchmark code, Juan Quintela, 2022/11/15
- [PULL 06/30] migration: Export ram_transferred_ram(), Juan Quintela, 2022/11/15
- [PULL 12/30] migration: Disallow postcopy preempt to be used with compress, Juan Quintela, 2022/11/15
- [PULL 13/30] migration: Use non-atomic ops for clear log bitmap, Juan Quintela, 2022/11/15