aboutsummaryrefslogtreecommitdiff
path: root/hw/hw.h
diff options
context:
space:
mode:
authorGlauber Costa <glommer@redhat.com>2009-05-20 18:26:57 -0400
committerAnthony Liguori <aliguori@us.ibm.com>2009-05-22 10:50:30 -0500
commit19629537bd8d81fa7a32f2df5c39419afded04fa (patch)
treec07d954bd6c75d60ea5a036187f94c3b5d624679 /hw/hw.h
parent9f9e28cda74bc8cddd8ac4c0a9c007b31d42c6f6 (diff)
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.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/hw/hw.h b/hw/hw.h
index c990d1a1a9..dd11f0a242 100644
--- a/hw/hw.h
+++ b/hw/hw.h
@@ -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);