Signed-off-by: Cristian Klein <cristiklein@xxxxxxxxx> --- tools/virsh-domain.c | 6 ++++++ tools/virsh.pod | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 52e91d9..c453dc4 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -9443,6 +9443,10 @@ static const vshCmdOptDef opts_migrate[] = { .type = VSH_OT_INT, .help = N_("switch to post-copy migration if live migration exceeds timeout (in seconds)") }, + {.name = "postcopy-after-precopy", + .type = VSH_OT_BOOL, + .help = N_("switch to post-copy migration after one pass of pre-copy") + }, {.name = "xml", .type = VSH_OT_STRING, .help = N_("filename containing updated XML for the target") @@ -9528,6 +9532,8 @@ doMigrate(void *opaque) flags |= VIR_MIGRATE_ENABLE_POSTCOPY; if (vshCommandOptBool(cmd, "postcopy-after")) /* actually an int */ flags |= VIR_MIGRATE_ENABLE_POSTCOPY; + if (vshCommandOptBool(cmd, "postcopy-after-precopy")) + flags |= VIR_MIGRATE_POSTCOPY_AFTER_PRECOPY; if (vshCommandOptBool(cmd, "live")) flags |= VIR_MIGRATE_LIVE; if (vshCommandOptBool(cmd, "p2p")) diff --git a/tools/virsh.pod b/tools/virsh.pod index a4c5d34..22c4447 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -1430,6 +1430,7 @@ I<domain> I<desturi> [I<migrateuri>] [I<graphicsuri>] [I<listen-address>] [I<dname>] [I<--timeout> B<seconds>] [I<--xml> B<file>] [I<--enable-postcopy>] [I<--postcopy-after> B<seconds>] +[I<--postcopy-after-precopy>] Migrate domain to another host. Add I<--live> for live migration; <--p2p> for peer-2-peer migration; I<--direct> for direct migration; or I<--tunnelled> @@ -1486,6 +1487,10 @@ I<--postcopy-after> switches to post-copy migration when pre-copy migration exceeds that many seconds. Zero means start post-copy as soon as possible. It can only be used with I<--live>. +I<--postcopy-after-precopy> switches to post-copy migration after the +first pass of pre-copy. For most VMs, this is the most efficient way to +do migration while minimizing downtime. + Running migration can be canceled by interrupting virsh (usually using C<Ctrl-C>) or by B<domjobabort> command sent from another virsh instance. -- 1.9.1 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list