Revision 13197e3c block-migration.c
b/block-migration.c | ||
---|---|---|
231 | 231 |
blk->iov.iov_len = nr_sectors * BDRV_SECTOR_SIZE; |
232 | 232 |
qemu_iovec_init_external(&blk->qiov, &blk->iov, 1); |
233 | 233 |
|
234 |
block_mig_state.submitted++; |
|
235 |
|
|
234 | 236 |
blk->aiocb = bdrv_aio_readv(bs, cur_sector, &blk->qiov, |
235 | 237 |
nr_sectors, blk_mig_read_cb, blk); |
236 |
block_mig_state.submitted++; |
|
237 | 238 |
|
238 | 239 |
bdrv_reset_dirty(bs, cur_sector, nr_sectors); |
239 | 240 |
bmds->cur_sector = cur_sector + nr_sectors; |
... | ... | |
440 | 441 |
ret = blk->ret; |
441 | 442 |
break; |
442 | 443 |
} |
443 |
blk_send(f, blk); |
|
444 | 444 |
|
445 | 445 |
QSIMPLEQ_REMOVE_HEAD(&block_mig_state.blk_list, entry); |
446 |
blk_send(f, blk); |
|
447 |
|
|
446 | 448 |
g_free(blk->buf); |
447 | 449 |
g_free(blk); |
448 | 450 |
|
... | ... | |
542 | 544 |
/* finished saving bulk on all devices */ |
543 | 545 |
block_mig_state.bulk_completed = 1; |
544 | 546 |
} |
547 |
ret = 0; |
|
545 | 548 |
} else { |
546 | 549 |
ret = blk_mig_save_dirty_block(f, 1); |
547 |
if (ret < 0) {
|
|
548 |
return ret;
|
|
549 |
}
|
|
550 |
if (ret != 0) {
|
|
551 |
/* no more dirty blocks */
|
|
552 |
break;
|
|
553 |
}
|
|
550 |
}
|
|
551 |
if (ret < 0) {
|
|
552 |
return ret;
|
|
553 |
}
|
|
554 |
if (ret != 0) {
|
|
555 |
/* no more dirty blocks */
|
|
556 |
break;
|
|
554 | 557 |
} |
555 | 558 |
} |
556 | 559 |
|
... | ... | |
560 | 563 |
} |
561 | 564 |
|
562 | 565 |
qemu_put_be64(f, BLK_MIG_FLAG_EOS); |
563 |
|
|
564 | 566 |
return qemu_ftell(f) - last_ftell; |
565 | 567 |
} |
566 | 568 |
|
... | ... | |
603 | 605 |
static uint64_t block_save_pending(QEMUFile *f, void *opaque, uint64_t max_size) |
604 | 606 |
{ |
605 | 607 |
/* Estimate pending number of bytes to send */ |
606 |
uint64_t pending = get_remaining_dirty() + |
|
608 |
uint64_t pending; |
|
609 |
|
|
610 |
pending = get_remaining_dirty() + |
|
607 | 611 |
block_mig_state.submitted * BLOCK_SIZE + |
608 | 612 |
block_mig_state.read_done * BLOCK_SIZE; |
609 | 613 |
|
Also available in: Unified diff