[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 01/30] migration/channel-block: fix return value for qio_channel_
From: |
Juan Quintela |
Subject: |
[PATCH 01/30] migration/channel-block: fix return value for qio_channel_block_{readv, writev} |
Date: |
Tue, 15 Nov 2022 13:11:57 +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
- [PATCH 00/30] Migration PULL request, Juan Quintela, 2022/11/15
- [PATCH 01/30] migration/channel-block: fix return value for qio_channel_block_{readv, writev},
Juan Quintela <=
- [PATCH 02/30] migration/multifd/zero-copy: Create helper function for flushing, Juan Quintela, 2022/11/15
- [PATCH 03/30] migration: check magic value for deciding the mapping of channels, Juan Quintela, 2022/11/15
- [PATCH 04/30] multifd: Create page_size fields into both MultiFD{Recv, Send}Params, Juan Quintela, 2022/11/15
- [PATCH 06/30] migration: Export ram_transferred_ram(), Juan Quintela, 2022/11/15
- [PATCH 07/30] migration: Export ram_release_page(), Juan Quintela, 2022/11/15
- [PATCH 05/30] multifd: Create page_count fields into both MultiFD{Recv, Send}Params, Juan Quintela, 2022/11/15
- [PATCH 11/30] migration: Fix race on qemu_file_shutdown(), Juan Quintela, 2022/11/15
- [PATCH 09/30] Unit test code and benchmark code, Juan Quintela, 2022/11/15
- [PATCH 10/30] migration: Fix possible infinite loop of ram save process, Juan Quintela, 2022/11/15
- [PATCH 12/30] migration: Disallow postcopy preempt to be used with compress, Juan Quintela, 2022/11/15