diff options
author | Glauber Costa <glommer@redhat.com> | 2009-05-20 18:26:57 -0400 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-05-22 10:50:30 -0500 |
commit | 19629537bd8d81fa7a32f2df5c39419afded04fa (patch) | |
tree | c07d954bd6c75d60ea5a036187f94c3b5d624679 /hw/hw.h | |
parent | 9f9e28cda74bc8cddd8ac4c0a9c007b31d42c6f6 (diff) | |
download | qemu-19629537bd8d81fa7a32f2df5c39419afded04fa.zip |
introduce set_rate_limit function for QEMUFile
This patch converts the current callers of qemu_fopen_ops().
Signed-off-by: Glauber Costa <glommer@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/hw.h')
-rw-r--r-- | hw/hw.h | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -36,10 +36,17 @@ typedef int (QEMUFileCloseFunc)(void *opaque); */ typedef int (QEMUFileRateLimit)(void *opaque); +/* Called to change the current bandwidth allocation. This function must return + * the new actual bandwidth. It should be new_rate if everything goes ok, and + * the old rate otherwise + */ +typedef size_t (QEMUFileSetRateLimit)(void *opaque, size_t new_rate); + QEMUFile *qemu_fopen_ops(void *opaque, QEMUFilePutBufferFunc *put_buffer, QEMUFileGetBufferFunc *get_buffer, QEMUFileCloseFunc *close, - QEMUFileRateLimit *rate_limit); + QEMUFileRateLimit *rate_limit, + QEMUFileSetRateLimit *set_rate_limit); QEMUFile *qemu_fopen(const char *filename, const char *mode); QEMUFile *qemu_fopen_socket(int fd); QEMUFile *qemu_popen(FILE *popen_file, const char *mode); @@ -73,6 +80,7 @@ unsigned int qemu_get_be16(QEMUFile *f); unsigned int qemu_get_be32(QEMUFile *f); uint64_t qemu_get_be64(QEMUFile *f); int qemu_file_rate_limit(QEMUFile *f); +size_t qemu_file_set_rate_limit(QEMUFile *f, size_t new_rate); int qemu_file_has_error(QEMUFile *f); void qemu_file_set_error(QEMUFile *f); |