Migration pull 2018-03-09
-----BEGIN PGP SIGNATURE----- iQIcBAABAgAGBQJaosnuAAoJEAUWMx68W/3njQQQAIcLokkEviUHBTpWuHFGhMH/ +GJz51Q0GkjUx2WY1rx4TZl8YeptHlPEDI5NT48t8ADq0UzThTQFIWq23sbI73Fl blV99IWNOF5rj8WYRwSrV5XtT8l2Rq8tDGAV4jSLbkLi3MXXU5FcT7/1sWAeV2VV Fq3DfEqZdzCPmL615vlxYuNf2eG2ZOy45jJLifaJCJSw9UIKSjm0RtMPdu1KyVvd 7+5o0LI/CfGdAddCDoJe/Dg3dYOaCwgE2Xl0GKlgzKby1ScfDtbeiqG4No7MmopG mmQE/fhf60tKw4LETnc/NsWP1+VFLZkAOZoim3Bh9rZClrNJmFyQVxRY+e5Ig0oJ /C9CZkHirrucwTrYbv2r4cU+PmfGGkNPkoOMcKViA1EfmaWJDW1Pchs3Vob6K4Wd J/h9ZIV8ek2TGfqcHj9hX5DPQjpOLXA9XLnfGAC/lh8qgVqvrgNCSqY6sNY/Oy/I hJ21M3QkSWIFZunc5r8HD1YttShvMCa8tdm6W73ExnF9fGPspyjfLVBwzV4J1hsK RDSNZTZK+aOM/ZO8yJj4QtGtLus1MTttNmDOPwzpJPurtuDxC6bktc3Mrnzi4HRg b/RvngeZHzDK0o/q+YYG3xNpp2cG7dVcDUwB0rMzkPmQx2qYrzeGwmkoXTRaDmYK GXPGLc+SUwUg/IhEgRVn =ZvD9 -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/dgilbert/tags/pull-migration-20180309a' into staging Migration pull 2018-03-09 # gpg: Signature made Fri 09 Mar 2018 17:52:46 GMT # gpg: using RSA key 0516331EBC5BFDE7 # gpg: Good signature from "Dr. David Alan Gilbert (RH2) <dgilbert@redhat.com>" # Primary key fingerprint: 45F5 C71B 4A0C B7FB 977A 9FA9 0516 331E BC5B FDE7 * remotes/dgilbert/tags/pull-migration-20180309a: tests: Silence migration-test 'bad' test migration: fix applying wrong capabilities migration/block: rename MAX_INFLIGHT_IO to MAX_IO_BUFFERS migration/block: reset dirty bitmap before read in bulk phase migration: do not transfer ram during bulk storage migration migration: fix minor finalize leak Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
819fd4699c
@ -36,7 +36,7 @@
|
||||
|
||||
#define MAX_IS_ALLOCATED_SEARCH (65536 * BDRV_SECTOR_SIZE)
|
||||
|
||||
#define MAX_INFLIGHT_IO 512
|
||||
#define MAX_IO_BUFFERS 512
|
||||
|
||||
//#define DEBUG_BLK_MIGRATION
|
||||
|
||||
@ -331,11 +331,10 @@ static int mig_save_device_bulk(QEMUFile *f, BlkMigDevState *bmds)
|
||||
*/
|
||||
qemu_mutex_lock_iothread();
|
||||
aio_context_acquire(blk_get_aio_context(bmds->blk));
|
||||
blk->aiocb = blk_aio_preadv(bb, cur_sector * BDRV_SECTOR_SIZE, &blk->qiov,
|
||||
0, blk_mig_read_cb, blk);
|
||||
|
||||
bdrv_reset_dirty_bitmap(bmds->dirty_bitmap, cur_sector * BDRV_SECTOR_SIZE,
|
||||
nr_sectors * BDRV_SECTOR_SIZE);
|
||||
blk->aiocb = blk_aio_preadv(bb, cur_sector * BDRV_SECTOR_SIZE, &blk->qiov,
|
||||
0, blk_mig_read_cb, blk);
|
||||
aio_context_release(blk_get_aio_context(bmds->blk));
|
||||
qemu_mutex_unlock_iothread();
|
||||
|
||||
@ -776,9 +775,8 @@ static int block_save_iterate(QEMUFile *f, void *opaque)
|
||||
while ((block_mig_state.submitted +
|
||||
block_mig_state.read_done) * BLOCK_SIZE <
|
||||
qemu_file_get_rate_limit(f) &&
|
||||
(block_mig_state.submitted +
|
||||
block_mig_state.read_done) <
|
||||
MAX_INFLIGHT_IO) {
|
||||
(block_mig_state.submitted + block_mig_state.read_done) <
|
||||
MAX_IO_BUFFERS) {
|
||||
blk_mig_unlock();
|
||||
if (block_mig_state.bulk_completed == 0) {
|
||||
/* first finish the bulk phase */
|
||||
|
@ -747,13 +747,15 @@ void qmp_migrate_set_capabilities(MigrationCapabilityStatusList *params,
|
||||
{
|
||||
MigrationState *s = migrate_get_current();
|
||||
MigrationCapabilityStatusList *cap;
|
||||
bool cap_list[MIGRATION_CAPABILITY__MAX];
|
||||
|
||||
if (migration_is_setup_or_active(s->state)) {
|
||||
error_setg(errp, QERR_MIGRATION_ACTIVE);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!migrate_caps_check(s->enabled_capabilities, params, errp)) {
|
||||
memcpy(cap_list, s->enabled_capabilities, sizeof(cap_list));
|
||||
if (!migrate_caps_check(cap_list, params, errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2541,6 +2543,7 @@ static void migration_instance_finalize(Object *obj)
|
||||
g_free(params->tls_hostname);
|
||||
g_free(params->tls_creds);
|
||||
qemu_sem_destroy(&ms->pause_sem);
|
||||
error_free(ms->error);
|
||||
}
|
||||
|
||||
static void migration_instance_init(Object *obj)
|
||||
|
@ -2258,6 +2258,13 @@ static int ram_save_iterate(QEMUFile *f, void *opaque)
|
||||
int64_t t0;
|
||||
int done = 0;
|
||||
|
||||
if (blk_mig_bulk_active()) {
|
||||
/* Avoid transferring ram during bulk phase of block migration as
|
||||
* the bulk phase will usually take a long time and transferring
|
||||
* ram updates during that time is pointless. */
|
||||
goto out;
|
||||
}
|
||||
|
||||
rcu_read_lock();
|
||||
if (ram_list.version != rs->last_version) {
|
||||
ram_state_reset(rs);
|
||||
@ -2304,6 +2311,7 @@ static int ram_save_iterate(QEMUFile *f, void *opaque)
|
||||
*/
|
||||
ram_control_after_iterate(f, RAM_CONTROL_ROUND);
|
||||
|
||||
out:
|
||||
qemu_put_be64(f, RAM_SAVE_FLAG_EOS);
|
||||
ram_counters.transferred += 8;
|
||||
|
||||
|
@ -382,7 +382,7 @@ static void migrate_start_postcopy(QTestState *who)
|
||||
}
|
||||
|
||||
static void test_migrate_start(QTestState **from, QTestState **to,
|
||||
const char *uri)
|
||||
const char *uri, bool hide_stderr)
|
||||
{
|
||||
gchar *cmd_src, *cmd_dst;
|
||||
char *bootpath = g_strdup_printf("%s/bootsect", tmpfs);
|
||||
@ -427,6 +427,17 @@ static void test_migrate_start(QTestState **from, QTestState **to,
|
||||
|
||||
g_free(bootpath);
|
||||
|
||||
if (hide_stderr) {
|
||||
gchar *tmp;
|
||||
tmp = g_strdup_printf("%s 2>/dev/null", cmd_src);
|
||||
g_free(cmd_src);
|
||||
cmd_src = tmp;
|
||||
|
||||
tmp = g_strdup_printf("%s 2>/dev/null", cmd_dst);
|
||||
g_free(cmd_dst);
|
||||
cmd_dst = tmp;
|
||||
}
|
||||
|
||||
*from = qtest_start(cmd_src);
|
||||
g_free(cmd_src);
|
||||
|
||||
@ -518,7 +529,7 @@ static void test_migrate(void)
|
||||
char *uri = g_strdup_printf("unix:%s/migsocket", tmpfs);
|
||||
QTestState *from, *to;
|
||||
|
||||
test_migrate_start(&from, &to, uri);
|
||||
test_migrate_start(&from, &to, uri, false);
|
||||
|
||||
migrate_set_capability(from, "postcopy-ram", "true");
|
||||
migrate_set_capability(to, "postcopy-ram", "true");
|
||||
@ -560,7 +571,7 @@ static void test_baddest(void)
|
||||
const char *status;
|
||||
bool failed;
|
||||
|
||||
test_migrate_start(&from, &to, "tcp:0:0");
|
||||
test_migrate_start(&from, &to, "tcp:0:0", true);
|
||||
migrate(from, "tcp:0:0");
|
||||
do {
|
||||
rsp = wait_command(from, "{ 'execute': 'query-migrate' }");
|
||||
|
Loading…
Reference in New Issue
Block a user