summary refs log tree commit diff stats
path: root/migration/qemu-file-channel.c
diff options
context:
space:
mode:
authorDaniel P. Berrangé <berrange@redhat.com>2022-06-20 12:02:02 +0100
committerDr. David Alan Gilbert <dgilbert@redhat.com>2022-06-23 10:17:58 +0100
commitf759d7050bd0ec34f45bc0d91800625a6938e203 (patch)
tree17483eca47eb6f3f56a071604b1c615ea7b8cbf5 /migration/qemu-file-channel.c
parent0ae1f7f055d757c01ce3144a7041fa9341a3715b (diff)
downloadfocaccia-qemu-f759d7050bd0ec34f45bc0d91800625a6938e203.tar.gz
focaccia-qemu-f759d7050bd0ec34f45bc0d91800625a6938e203.zip
migration: remove the QEMUFileOps 'get_buffer' callback
This directly implements the get_buffer logic using QIOChannel APIs.

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
  dgilbert: Fixup len = *-*EIO as spotted by Peter Xu
Diffstat (limited to 'migration/qemu-file-channel.c')
-rw-r--r--migration/qemu-file-channel.c29
1 files changed, 0 insertions, 29 deletions
diff --git a/migration/qemu-file-channel.c b/migration/qemu-file-channel.c
index 8ff58e81f9..7b32831752 100644
--- a/migration/qemu-file-channel.c
+++ b/migration/qemu-file-channel.c
@@ -74,34 +74,6 @@ static ssize_t channel_writev_buffer(void *opaque,
 }
 
 
-static ssize_t channel_get_buffer(void *opaque,
-                                  uint8_t *buf,
-                                  int64_t pos,
-                                  size_t size,
-                                  Error **errp)
-{
-    QIOChannel *ioc = QIO_CHANNEL(opaque);
-    ssize_t ret;
-
-    do {
-        ret = qio_channel_read(ioc, (char *)buf, size, errp);
-        if (ret < 0) {
-            if (ret == QIO_CHANNEL_ERR_BLOCK) {
-                if (qemu_in_coroutine()) {
-                    qio_channel_yield(ioc, G_IO_IN);
-                } else {
-                    qio_channel_wait(ioc, G_IO_IN);
-                }
-            } else {
-                return -EIO;
-            }
-        }
-    } while (ret == QIO_CHANNEL_ERR_BLOCK);
-
-    return ret;
-}
-
-
 static QEMUFile *channel_get_input_return_path(void *opaque)
 {
     QIOChannel *ioc = QIO_CHANNEL(opaque);
@@ -117,7 +89,6 @@ static QEMUFile *channel_get_output_return_path(void *opaque)
 }
 
 static const QEMUFileOps channel_input_ops = {
-    .get_buffer = channel_get_buffer,
     .get_return_path = channel_get_input_return_path,
 };