diff options
author | Anthony Liguori | 2012-11-02 19:06:28 +0100 |
---|---|---|
committer | Anthony Liguori | 2012-11-02 19:06:28 +0100 |
commit | 2a0dfd004d9fae4adf2ccfcb2e3b1a76906b48a0 (patch) | |
tree | 98dbd8f0ee86efb371da9fa605d87f96b51d55e5 /qemu-file.h | |
parent | Merge remote-tracking branch 'afaerber/qom-cpu' into staging (diff) | |
parent | migration: move process_incoming_migration to a coroutine (diff) | |
download | qemu-2a0dfd004d9fae4adf2ccfcb2e3b1a76906b48a0.tar.gz qemu-2a0dfd004d9fae4adf2ccfcb2e3b1a76906b48a0.tar.xz qemu-2a0dfd004d9fae4adf2ccfcb2e3b1a76906b48a0.zip |
Merge remote-tracking branch 'bonzini/migr-coroutine' into staging
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* bonzini/migr-coroutine:
migration: move process_incoming_migration to a coroutine
migration: handle EAGAIN while reading QEMUFile
migration: move qemu_fclose to process_incoming_migration
migration: close socket QEMUFile from socket_close
migration: xxx_close will only be called once
migration: use closesocket, not close
migration: use migrate_fd_close in migrate_fd_cleanup
migration: clean up server sockets and handlers before invoking process_incoming_migration
migration: replace qemu_stdio_fd with qemu_get_fd
migration: add qemu_get_fd
migration: consolidate QEMUFile methods in a single QEMUFileOps struct
migration: unify stdio-based QEMUFile operations
Diffstat (limited to 'qemu-file.h')
-rw-r--r-- | qemu-file.h | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/qemu-file.h b/qemu-file.h index 9c8985b610..d64bdbb19b 100644 --- a/qemu-file.h +++ b/qemu-file.h @@ -47,6 +47,10 @@ typedef int (QEMUFileGetBufferFunc)(void *opaque, uint8_t *buf, */ typedef int (QEMUFileCloseFunc)(void *opaque); +/* Called to return the OS file descriptor associated to the QEMUFile. + */ +typedef int (QEMUFileGetFD)(void *opaque); + /* Called to determine if the file has exceeded its bandwidth allocation. The * bandwidth capping is a soft limit, not a hard limit. */ @@ -59,18 +63,23 @@ typedef int (QEMUFileRateLimit)(void *opaque); typedef int64_t (QEMUFileSetRateLimit)(void *opaque, int64_t new_rate); typedef int64_t (QEMUFileGetRateLimit)(void *opaque); -QEMUFile *qemu_fopen_ops(void *opaque, QEMUFilePutBufferFunc *put_buffer, - QEMUFileGetBufferFunc *get_buffer, - QEMUFileCloseFunc *close, - QEMUFileRateLimit *rate_limit, - QEMUFileSetRateLimit *set_rate_limit, - QEMUFileGetRateLimit *get_rate_limit); +typedef struct QEMUFileOps { + QEMUFilePutBufferFunc *put_buffer; + QEMUFileGetBufferFunc *get_buffer; + QEMUFileCloseFunc *close; + QEMUFileGetFD *get_fd; + QEMUFileRateLimit *rate_limit; + QEMUFileSetRateLimit *set_rate_limit; + QEMUFileGetRateLimit *get_rate_limit; +} QEMUFileOps; + +QEMUFile *qemu_fopen_ops(void *opaque, const QEMUFileOps *ops); QEMUFile *qemu_fopen(const char *filename, const char *mode); QEMUFile *qemu_fdopen(int fd, const char *mode); QEMUFile *qemu_fopen_socket(int fd); QEMUFile *qemu_popen(FILE *popen_file, const char *mode); QEMUFile *qemu_popen_cmd(const char *command, const char *mode); -int qemu_stdio_fd(QEMUFile *f); +int qemu_get_fd(QEMUFile *f); int qemu_fclose(QEMUFile *f); void qemu_put_buffer(QEMUFile *f, const uint8_t *buf, int size); void qemu_put_byte(QEMUFile *f, int v); |