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
This commit is contained in:
Daniel P. Berrangé 2022-06-20 12:02:02 +01:00 committed by Dr. David Alan Gilbert
parent 0ae1f7f055
commit f759d7050b
3 changed files with 16 additions and 40 deletions

View file

@ -29,14 +29,6 @@
#include "exec/cpu-common.h"
#include "io/channel.h"
/* Read a chunk of data from a file at the given position. The pos argument
* can be ignored if the file is only be used for streaming. The number of
* bytes actually read should be returned.
*/
typedef ssize_t (QEMUFileGetBufferFunc)(void *opaque, uint8_t *buf,
int64_t pos, size_t size,
Error **errp);
/*
* This function writes an iovec to file. The handler must write all
* of the data or return a negative errno value.
@ -77,7 +69,6 @@ typedef size_t (QEMURamSaveFunc)(QEMUFile *f,
typedef QEMUFile *(QEMURetPathFunc)(void *opaque);
typedef struct QEMUFileOps {
QEMUFileGetBufferFunc *get_buffer;
QEMUFileWritevBufferFunc *writev_buffer;
QEMURetPathFunc *get_return_path;
} QEMUFileOps;