We only used it once, just remove the callback indirection.
Signed-off-by: Juan Quintela <quintela@redhat.com>
typedef struct QEMUFileBuffered
{
- BufferedWaitForUnfreezeFunc *wait_for_unfreeze;
BufferedCloseFunc *close;
MigrationState *migration_state;
QEMUFile *file;
while (!qemu_file_get_error(s->file) && s->buffer_size) {
buffered_flush(s);
if (s->freeze_output)
- s->wait_for_unfreeze(s->migration_state);
+ migrate_fd_wait_for_unfreeze(s->migration_state);
}
ret = s->close(s->migration_state);
QEMUFile *qemu_fopen_ops_buffered(MigrationState *migration_state,
size_t bytes_per_sec,
- BufferedWaitForUnfreezeFunc *wait_for_unfreeze,
BufferedCloseFunc *close)
{
QEMUFileBuffered *s;
s->migration_state = migration_state;
s->xfer_limit = bytes_per_sec / 10;
- s->wait_for_unfreeze = wait_for_unfreeze;
s->close = close;
s->file = qemu_fopen_ops(s, buffered_put_buffer, NULL,
#include "hw/hw.h"
#include "migration.h"
-typedef void (BufferedWaitForUnfreezeFunc)(void *opaque);
typedef int (BufferedCloseFunc)(void *opaque);
QEMUFile *qemu_fopen_ops_buffered(MigrationState *migration_state,
size_t xfer_limit,
- BufferedWaitForUnfreezeFunc *wait_for_unfreeze,
BufferedCloseFunc *close);
#endif
migrate_fd_cleanup(s);
}
-static void migrate_fd_wait_for_unfreeze(void *opaque)
+void migrate_fd_wait_for_unfreeze(MigrationState *s)
{
- MigrationState *s = opaque;
int ret;
DPRINTF("wait for unfreeze\n");
s->state = MIG_STATE_ACTIVE;
s->file = qemu_fopen_ops_buffered(s,
s->bandwidth_limit,
- migrate_fd_wait_for_unfreeze,
migrate_fd_close);
DPRINTF("beginning savevm\n");
ssize_t migrate_fd_put_buffer(MigrationState *s, const void *data,
size_t size);
void migrate_fd_put_ready(MigrationState *s);
+void migrate_fd_wait_for_unfreeze(MigrationState *s);
void add_migration_state_change_notifier(Notifier *notify);
void remove_migration_state_change_notifier(Notifier *notify);