]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virsh: Add support for VIR_MIGRATE_ZEROCOPY flag
authorJiri Denemark <jdenemar@redhat.com>
Wed, 22 Jun 2022 14:36:53 +0000 (16:36 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Thu, 23 Jun 2022 14:45:39 +0000 (16:45 +0200)
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
docs/manpages/virsh.rst
tools/virsh-domain.c

index 4701791b047e0876e535c3896e9a858628d4617b..45469f2f35d34b77cdaf83d578d0b6e59559aa2a 100644 (file)
@@ -3285,7 +3285,7 @@ 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]
+      [--postcopy-after-precopy] [--postcopy-resume] [--zerocopy]
       domain desturi [migrateuri] [graphicsuri] [listen-address] [dname]
       [--timeout seconds [--timeout-suspend | --timeout-postcopy]]
       [--xml file] [--migrate-disks disk-list] [--disks-port port]
@@ -3362,6 +3362,11 @@ high (and thus allowing the domain to lock most of the host's memory). Doing so
 may be dangerous to both the domain and the host itself since the host's kernel
 may run out of memory.
 
+*--zerocopy* requests zero-copy mechanism to be used for migrating memory pages.
+For QEMU/KVM this means QEMU will be temporarily allowed to lock all guest
+pages in host's memory, although only those that are queued for transfer will
+be locked at the same time.
+
 ``Note``: Individual hypervisors usually do not support all possible types of
 migration. For example, QEMU does not support direct migration.
 
index 1d71ac5a67010fa785163ba4a73143607ef78731..43034f2f8109ca8163c83c48f054dd1ba13ea209 100644 (file)
@@ -10890,6 +10890,10 @@ static const vshCmdOptDef opts_migrate[] = {
      .type = VSH_OT_BOOL,
      .help = N_("resume failed post-copy migration")
     },
+    {.name = "zerocopy",
+     .type = VSH_OT_BOOL,
+     .help = N_("use zero-copy mechanism for migrating memory pages")
+    },
     {.name = "migrateuri",
      .type = VSH_OT_STRING,
      .completer = virshCompleteEmpty,
@@ -11296,6 +11300,9 @@ doMigrate(void *opaque)
     if (vshCommandOptBool(cmd, "postcopy-resume"))
         flags |= VIR_MIGRATE_POSTCOPY_RESUME;
 
+    if (vshCommandOptBool(cmd, "zerocopy"))
+        flags |= VIR_MIGRATE_ZEROCOPY;
+
     if (vshCommandOptBool(cmd, "tls"))
         flags |= VIR_MIGRATE_TLS;