Skip to content

Commit

Permalink
buffered_file: opaque is MigrationState
Browse files Browse the repository at this point in the history
It always have that type, just change it.
We will remove buffered file later on the migration thread series.

Signed-off-by: Juan Quintela <quintela@redhat.com>

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
Juan Quintela committed Oct 17, 2012
1 parent 8e92c9e commit c7a8f0c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions buffered_file.c
Expand Up @@ -27,7 +27,7 @@ typedef struct QEMUFileBuffered
BufferedPutReadyFunc *put_ready;
BufferedWaitForUnfreezeFunc *wait_for_unfreeze;
BufferedCloseFunc *close;
void *migration_state;
MigrationState *migration_state;
QEMUFile *file;
int freeze_output;
size_t bytes_xfer;
Expand Down Expand Up @@ -226,7 +226,7 @@ static void buffered_rate_tick(void *opaque)
buffered_put_buffer(s, NULL, 0, 0);
}

QEMUFile *qemu_fopen_ops_buffered(void *opaque,
QEMUFile *qemu_fopen_ops_buffered(MigrationState *migration_state,
size_t bytes_per_sec,
BufferedPutFunc *put_buffer,
BufferedPutReadyFunc *put_ready,
Expand All @@ -237,7 +237,7 @@ QEMUFile *qemu_fopen_ops_buffered(void *opaque,

s = g_malloc0(sizeof(*s));

s->migration_state = opaque;
s->migration_state = migration_state;
s->xfer_limit = bytes_per_sec / 10;
s->put_buffer = put_buffer;
s->put_ready = put_ready;
Expand Down
4 changes: 3 additions & 1 deletion buffered_file.h
Expand Up @@ -15,13 +15,15 @@
#define QEMU_BUFFERED_FILE_H

#include "hw/hw.h"
#include "migration.h"

typedef ssize_t (BufferedPutFunc)(void *opaque, const void *data, size_t size);
typedef void (BufferedPutReadyFunc)(void *opaque);
typedef void (BufferedWaitForUnfreezeFunc)(void *opaque);
typedef int (BufferedCloseFunc)(void *opaque);

QEMUFile *qemu_fopen_ops_buffered(void *opaque, size_t xfer_limit,
QEMUFile *qemu_fopen_ops_buffered(MigrationState *migration_state,
size_t xfer_limit,
BufferedPutFunc *put_buffer,
BufferedPutReadyFunc *put_ready,
BufferedWaitForUnfreezeFunc *wait_for_unfreeze,
Expand Down

0 comments on commit c7a8f0c

Please sign in to comment.