Revision edfa1af5
b/buffered_file.c | ||
---|---|---|
32 | 32 |
size_t buffer_size; |
33 | 33 |
size_t buffer_capacity; |
34 | 34 |
QemuThread thread; |
35 |
bool complete; |
|
36 | 35 |
} QEMUFileBuffered; |
37 | 36 |
|
38 | 37 |
#ifdef DEBUG_BUFFERED_FILE |
... | ... | |
162 | 161 |
ret = ret2; |
163 | 162 |
} |
164 | 163 |
ret = migrate_fd_close(s->migration_state); |
165 |
s->complete = true; |
|
164 |
s->migration_state->complete = true;
|
|
166 | 165 |
return ret; |
167 | 166 |
} |
168 | 167 |
|
... | ... | |
231 | 230 |
while (true) { |
232 | 231 |
int64_t current_time = qemu_get_clock_ms(rt_clock); |
233 | 232 |
|
234 |
if (s->complete) { |
|
233 |
if (s->migration_state->complete) {
|
|
235 | 234 |
break; |
236 | 235 |
} |
237 | 236 |
if (s->freeze_output) { |
... | ... | |
263 | 262 |
.set_rate_limit = buffered_set_rate_limit, |
264 | 263 |
}; |
265 | 264 |
|
266 |
QEMUFile *qemu_fopen_ops_buffered(MigrationState *migration_state)
|
|
265 |
void qemu_fopen_ops_buffered(MigrationState *migration_state)
|
|
267 | 266 |
{ |
268 | 267 |
QEMUFileBuffered *s; |
269 | 268 |
|
... | ... | |
271 | 270 |
|
272 | 271 |
s->migration_state = migration_state; |
273 | 272 |
s->xfer_limit = migration_state->bandwidth_limit / 10; |
274 |
s->complete = false; |
|
273 |
s->migration_state->complete = false;
|
|
275 | 274 |
|
276 | 275 |
s->file = qemu_fopen_ops(s, &buffered_file_ops); |
277 | 276 |
|
277 |
migration_state->file = s->file; |
|
278 |
|
|
278 | 279 |
qemu_thread_create(&s->thread, buffered_file_thread, s, |
279 | 280 |
QEMU_THREAD_DETACHED); |
280 |
|
|
281 |
return s->file; |
|
282 | 281 |
} |
b/buffered_file.h | ||
---|---|---|
17 | 17 |
#include "hw/hw.h" |
18 | 18 |
#include "migration/migration.h" |
19 | 19 |
|
20 |
QEMUFile *qemu_fopen_ops_buffered(MigrationState *migration_state);
|
|
20 |
void qemu_fopen_ops_buffered(MigrationState *migration_state);
|
|
21 | 21 |
|
22 | 22 |
#endif |
b/include/migration/migration.h | ||
---|---|---|
45 | 45 |
int64_t dirty_pages_rate; |
46 | 46 |
bool enabled_capabilities[MIGRATION_CAPABILITY_MAX]; |
47 | 47 |
int64_t xbzrle_cache_size; |
48 |
bool complete; |
|
48 | 49 |
}; |
49 | 50 |
|
50 | 51 |
void process_incoming_migration(QEMUFile *f); |
b/migration.c | ||
---|---|---|
448 | 448 |
int ret; |
449 | 449 |
|
450 | 450 |
s->state = MIG_STATE_ACTIVE; |
451 |
s->file = qemu_fopen_ops_buffered(s);
|
|
451 |
qemu_fopen_ops_buffered(s); |
|
452 | 452 |
|
453 | 453 |
DPRINTF("beginning savevm\n"); |
454 | 454 |
ret = qemu_savevm_state_begin(s->file, &s->params); |
Also available in: Unified diff