summaryrefslogtreecommitdiffstats
path: root/scsi
diff options
context:
space:
mode:
authorLeonardo Bras2022-05-13 08:28:31 +0200
committerDr. David Alan Gilbert2022-05-16 14:56:24 +0200
commitb88651cb4d4fa416fdbb6afaf5b26ec8c035eaad (patch)
treeb165c469c48c11c9c2dfcf5a05d27c75ad4dc4a6 /scsi
parentmeson.build: Fix docker-test-build@alpine when including linux/errqueue.h (diff)
downloadqemu-b88651cb4d4fa416fdbb6afaf5b26ec8c035eaad.tar.gz
qemu-b88651cb4d4fa416fdbb6afaf5b26ec8c035eaad.tar.xz
qemu-b88651cb4d4fa416fdbb6afaf5b26ec8c035eaad.zip
QIOChannel: Add flags on io_writev and introduce io_flush callback
Add flags to io_writev and introduce io_flush as optional callback to QIOChannelClass, allowing the implementation of zero copy writes by subclasses. How to use them: - Write data using qio_channel_writev*(...,QIO_CHANNEL_WRITE_FLAG_ZERO_COPY), - Wait write completion with qio_channel_flush(). Notes: As some zero copy write implementations work asynchronously, it's recommended to keep the write buffer untouched until the return of qio_channel_flush(), to avoid the risk of sending an updated buffer instead of the buffer state during write. As io_flush callback is optional, if a subclass does not implement it, then: - io_flush will return 0 without changing anything. Also, some functions like qio_channel_writev_full_all() were adapted to receive a flag parameter. That allows shared code between zero copy and non-zero copy writev, and also an easier implementation on new flags. Signed-off-by: Leonardo Bras <leobras@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Peter Xu <peterx@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Message-Id: <20220513062836.965425-3-leobras@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'scsi')
-rw-r--r--scsi/pr-manager-helper.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/scsi/pr-manager-helper.c b/scsi/pr-manager-helper.c
index 451c7631b7..3be52a98d5 100644
--- a/scsi/pr-manager-helper.c
+++ b/scsi/pr-manager-helper.c
@@ -77,7 +77,7 @@ static int pr_manager_helper_write(PRManagerHelper *pr_mgr,
iov.iov_base = (void *)buf;
iov.iov_len = sz;
n_written = qio_channel_writev_full(QIO_CHANNEL(pr_mgr->ioc), &iov, 1,
- nfds ? &fd : NULL, nfds, errp);
+ nfds ? &fd : NULL, nfds, 0, errp);
if (n_written <= 0) {
assert(n_written != QIO_CHANNEL_ERR_BLOCK);