mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-28 21:03:54 -06:00
migration: introduce set_blocking function in QEMUFileOps
Remove the assumption that every QEMUFile implementation has a file descriptor available by introducing a new function in QEMUFileOps to change the blocking state of a QEMUFile. If not set, it will fallback to the original code using the get_fd method. Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Message-Id: <1461751518-12128-7-git-send-email-berrange@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
This commit is contained in:
parent
0436e09f96
commit
06ad513532
3 changed files with 13 additions and 6 deletions
|
@ -54,6 +54,10 @@ typedef int (QEMUFileCloseFunc)(void *opaque);
|
|||
*/
|
||||
typedef int (QEMUFileGetFD)(void *opaque);
|
||||
|
||||
/* Called to change the blocking mode of the file
|
||||
*/
|
||||
typedef int (QEMUFileSetBlocking)(void *opaque, bool enabled);
|
||||
|
||||
/*
|
||||
* This function writes an iovec to file. The handler must write all
|
||||
* of the data or return a negative errno value.
|
||||
|
@ -107,6 +111,7 @@ typedef struct QEMUFileOps {
|
|||
QEMUFileGetBufferFunc *get_buffer;
|
||||
QEMUFileCloseFunc *close;
|
||||
QEMUFileGetFD *get_fd;
|
||||
QEMUFileSetBlocking *set_blocking;
|
||||
QEMUFileWritevBufferFunc *writev_buffer;
|
||||
QEMURetPathFunc *get_return_path;
|
||||
QEMUFileShutdownFunc *shut_down;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue