This new option will enable VIR_MIGRATE_POSTCOPY_PREEMPT flag.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
docs/manpages/virsh.rst | 9 ++++++---
tools/virsh-domain.c | 6 ++++++
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst
index ed1027e133..4d55665ac1 100644
--- a/docs/manpages/virsh.rst
+++ b/docs/manpages/virsh.rst
@@ -3373,9 +3373,9 @@ migrate
[--persistent] [--undefinesource] [--suspend] [--copy-storage-all]
[--copy-storage-inc] [--change-protection] [--unsafe] [--verbose]
[--rdma-pin-all] [--abort-on-error] [--postcopy]
- [--postcopy-after-precopy] [--postcopy-resume] [--zerocopy]
- domain desturi [migrateuri] [graphicsuri] [listen-address] [dname]
- [--timeout seconds [--timeout-suspend | --timeout-postcopy]]
+ [--postcopy-after-precopy] [--postcopy-resume] [--postcopy-preempt]
+ [--zerocopy] domain desturi [migrateuri] [graphicsuri] [listen-address]
+ [dname] [--timeout seconds [--timeout-suspend | --timeout-postcopy]]
[--xml file] [--migrate-disks disk-list] [--disks-port port]
[--compressed] [--comp-methods method-list]
[--comp-mt-level] [--comp-mt-threads] [--comp-mt-dthreads]
@@ -3428,6 +3428,9 @@ Once migration is running, the user may switch to post-copy using
the
``migrate-postcopy`` command sent from another virsh instance or use
*--postcopy-after-precopy* along with *--postcopy* to let libvirt
automatically switch to post-copy after the first pass of pre-copy is finished.
+The *--postcopy-preempt* option can be used to speed up handling page faults on
+the destination host caused by accessing a memory page that was not migrated yet
+by letting such pages preempt migration of other memory pages.
The maximum bandwidth consumed during the post-copy phase may be limited using
*--postcopy-bandwidth*. The maximum bandwidth consumed during the pre-copy phase
may be limited using *--bandwidth*. In case connection between the hosts breaks
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 58d5a4ab57..25b41cab22 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -11014,6 +11014,10 @@ static const vshCmdOptDef opts_migrate[] = {
.type = VSH_OT_BOOL,
.help = N_("resume failed post-copy migration")
},
+ {.name = "postcopy-preempt",
+ .type = VSH_OT_BOOL,
+ .help = N_("let post-copy requests preempt normal migration stream")
+ },
{.name = "zerocopy",
.type = VSH_OT_BOOL,
.help = N_("use zero-copy mechanism for migrating memory pages")
@@ -11182,6 +11186,7 @@ doMigrate(void *opaque)
{ "abort-on-error", VIR_MIGRATE_ABORT_ON_ERROR },
{ "postcopy", VIR_MIGRATE_POSTCOPY },
{ "postcopy-resume", VIR_MIGRATE_POSTCOPY_RESUME },
+ { "postcopy-preempt", VIR_MIGRATE_POSTCOPY_PREEMPT },
{ "zerocopy", VIR_MIGRATE_ZEROCOPY },
{ "tls", VIR_MIGRATE_TLS },
{ "parallel", VIR_MIGRATE_PARALLEL },
@@ -11530,6 +11535,7 @@ cmdMigrate(vshControl *ctl, const vshCmd *cmd)
VSH_EXCLUSIVE_OPTIONS("copy-storage-all", "copy-storage-inc");
VSH_REQUIRE_OPTION("postcopy-after-precopy", "postcopy");
VSH_REQUIRE_OPTION("postcopy-resume", "postcopy");
+ VSH_REQUIRE_OPTION("postcopy-preempt", "postcopy");
VSH_REQUIRE_OPTION("timeout-postcopy", "postcopy");
VSH_REQUIRE_OPTION("persistent-xml", "persistent");
VSH_REQUIRE_OPTION("tls-destination", "tls");
--
2.43.0