1 Star 0 Fork 24

MendeZ/libvirt_anolis

forked from src-anolis-os/libvirt 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
libvirt-virsh-Add-support-for-VIR_MIGRATE_ZEROCOPY-flag.patch 3.11 KB
一键复制 编辑 原始数据 按行查看 历史
From 20c1c86f96dd7293734888ef6f8b75c11cda5fae Mon Sep 17 00:00:00 2001
Message-Id: <20c1c86f96dd7293734888ef6f8b75c11cda5fae@dist-git>
From: Jiri Denemark <jdenemar@redhat.com>
Date: Wed, 22 Jun 2022 16:36:53 +0200
Subject: [PATCH] virsh: Add support for VIR_MIGRATE_ZEROCOPY flag
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
(cherry picked from commit efa3baeae70fbdf4ab032ca485cb9272ee96bd50)
https://bugzilla.redhat.com/show_bug.cgi?id=2089433
Conflicts:
docs/manpages/virsh.rst
tools/virsh-domain.c
- post-copy recovery not backported
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
docs/manpages/virsh.rst | 8 +++++++-
tools/virsh-domain.c | 7 +++++++
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst
index dd534c10cb..d24e7774a6 100644
--- a/docs/manpages/virsh.rst
+++ b/docs/manpages/virsh.rst
@@ -3225,7 +3225,8 @@ migrate
migrate [--live] [--offline] [--direct] [--p2p [--tunnelled]]
[--persistent] [--undefinesource] [--suspend] [--copy-storage-all]
[--copy-storage-inc] [--change-protection] [--unsafe] [--verbose]
- [--rdma-pin-all] [--abort-on-error] [--postcopy] [--postcopy-after-precopy]
+ [--rdma-pin-all] [--abort-on-error] [--postcopy]
+ [--postcopy-after-precopy] [--zerocopy]
domain desturi [migrateuri] [graphicsuri] [listen-address] [dname]
[--timeout seconds [--timeout-suspend | --timeout-postcopy]]
[--xml file] [--migrate-disks disk-list] [--disks-port port]
@@ -3298,6 +3299,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.
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index b56f6a90f5..c5bade1dbf 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -10730,6 +10730,10 @@ static const vshCmdOptDef opts_migrate[] = {
.type = VSH_OT_BOOL,
.help = N_("automatically switch to post-copy migration after one pass of pre-copy")
},
+ {.name = "zerocopy",
+ .type = VSH_OT_BOOL,
+ .help = N_("use zero-copy mechanism for migrating memory pages")
+ },
{.name = "migrateuri",
.type = VSH_OT_STRING,
.completer = virshCompleteEmpty,
@@ -11133,6 +11137,9 @@ doMigrate(void *opaque)
if (vshCommandOptBool(cmd, "postcopy"))
flags |= VIR_MIGRATE_POSTCOPY;
+ if (vshCommandOptBool(cmd, "zerocopy"))
+ flags |= VIR_MIGRATE_ZEROCOPY;
+
if (vshCommandOptBool(cmd, "tls"))
flags |= VIR_MIGRATE_TLS;
--
2.35.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/shuaijiakun/libvirt_anolis.git
git@gitee.com:shuaijiakun/libvirt_anolis.git
shuaijiakun
libvirt_anolis
libvirt_anolis
a8.9-virt-stream-an

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385