Peter Xu <pet...@redhat.com> wrote: > On Wed, Oct 04, 2017 at 12:39:28PM +0200, Juan Quintela wrote: > > [...] > > (having some unit tests for migration is really good...) > >> +static void test_precopy(const char *uri) >> +{ >> + QTestState *from, *to; >> + >> + test_migrate_start(&from, &to, uri); >> + >> + /* We want to pick a speed slow enough that the test completes >> + * quickly, but that it doesn't complete precopy even on a slow >> + * machine, so also set the downtime. >> + */ >> + /* 100 ms */ >> + migrate_set_parameter(from, "downtime-limit", "100"); >> + /* 1MB/s slow*/ > > This is 100MB/s? > >> + migrate_set_parameter(from, "max-bandwidth", "100000000"); >> + >> + /* Wait for the first serial output from the source */ >> + wait_for_serial("src_serial"); >> + >> + migrate(from, uri); >> + >> + wait_for_migration_pass(from); >> + >> + /* 1GB/s now it should converge */ >> + migrate_set_parameter(from, "max-bandwidth", "1000000000"); > > Curious: would it possible that 1GB/s won't suffice in some cases? > Is there any reason behind this 1GB/s value?
No. My new test setup just uses 1GB/s and plays with the downtime (1ms) while I want to wait for one full cycle and then 300ms. Notice that the guest is around 100MB of size, so .... > > (I agree with Thomas that it would be good to work upon the existing > postcopy-test.c file, at least easier to review :) Done. did the other way around: rename postcopy-test.c to migrate-test.c and then went from there. Later, Juan.