aboutsummaryrefslogtreecommitdiff
path: root/buffered_file.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2012-07-20 13:04:42 +0200
committerJuan Quintela <quintela@redhat.com>2012-10-17 18:34:58 +0200
commit8e92c9e24f8c4edd7976aca82abf90e9a12667b4 (patch)
tree55f2247408d7a8e001329cf1b58a52739b6ca6ab /buffered_file.c
parent2dddf6f4133975af62e64cb6406ec1239491fa89 (diff)
buffered_file: rename opaque to migration_state
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'buffered_file.c')
-rw-r--r--buffered_file.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/buffered_file.c b/buffered_file.c
index 71558009bd..33b700be50 100644
--- a/buffered_file.c
+++ b/buffered_file.c
@@ -27,7 +27,7 @@ typedef struct QEMUFileBuffered
BufferedPutReadyFunc *put_ready;
BufferedWaitForUnfreezeFunc *wait_for_unfreeze;
BufferedCloseFunc *close;
- void *opaque;
+ void *migration_state;
QEMUFile *file;
int freeze_output;
size_t bytes_xfer;
@@ -78,7 +78,7 @@ static void buffered_flush(QEMUFileBuffered *s)
while (s->bytes_xfer < s->xfer_limit && offset < s->buffer_size) {
ssize_t ret;
- ret = s->put_buffer(s->opaque, s->buffer + offset,
+ ret = s->put_buffer(s->migration_state, s->buffer + offset,
s->buffer_size - offset);
if (ret == -EAGAIN) {
DPRINTF("backend not ready, freezing\n");
@@ -129,7 +129,7 @@ static int buffered_put_buffer(void *opaque, const uint8_t *buf, int64_t pos, in
DPRINTF("file is ready\n");
if (!s->freeze_output && s->bytes_xfer < s->xfer_limit) {
DPRINTF("notifying client\n");
- s->put_ready(s->opaque);
+ s->put_ready(s->migration_state);
}
}
@@ -147,10 +147,10 @@ static int buffered_close(void *opaque)
while (!qemu_file_get_error(s->file) && s->buffer_size) {
buffered_flush(s);
if (s->freeze_output)
- s->wait_for_unfreeze(s->opaque);
+ s->wait_for_unfreeze(s->migration_state);
}
- ret = s->close(s->opaque);
+ ret = s->close(s->migration_state);
qemu_del_timer(s->timer);
qemu_free_timer(s->timer);
@@ -237,7 +237,7 @@ QEMUFile *qemu_fopen_ops_buffered(void *opaque,
s = g_malloc0(sizeof(*s));
- s->opaque = opaque;
+ s->migration_state = opaque;
s->xfer_limit = bytes_per_sec / 10;
s->put_buffer = put_buffer;
s->put_ready = put_ready;