[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 1/8] migration/channel-block: fix return value for qio_channel_blo
From: |
Juan Quintela |
Subject: |
[PULL 1/8] migration/channel-block: fix return value for qio_channel_block_{readv, writev} |
Date: |
Mon, 21 Nov 2022 13:59:00 +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 0/8] Next patches, Juan Quintela, 2022/11/21
- [PULL 1/8] migration/channel-block: fix return value for qio_channel_block_{readv, writev},
Juan Quintela <=
- [PULL 2/8] migration/multifd/zero-copy: Create helper function for flushing, Juan Quintela, 2022/11/21
- [PULL 3/8] migration: Fix possible infinite loop of ram save process, Juan Quintela, 2022/11/21
- [PULL 4/8] migration: Fix race on qemu_file_shutdown(), Juan Quintela, 2022/11/21
- [PULL 5/8] migration: Disallow postcopy preempt to be used with compress, Juan Quintela, 2022/11/21
- [PULL 8/8] migration: Block migration comment or code is wrong, Juan Quintela, 2022/11/21
- [PULL 7/8] migration: Disable multifd explicitly with compression, Juan Quintela, 2022/11/21
- [PULL 6/8] migration: Use non-atomic ops for clear log bitmap, Juan Quintela, 2022/11/21
- Re: [PULL 0/8] Next patches, Stefan Hajnoczi, 2022/11/21