1 Star 0 Fork 24

MendeZ/libvirt_anolis

forked from src-anolis-os/libvirt 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
libvirt-qemu_domain-Format-qemuDomainObjPrivate-originalMemlock.patch 1.75 KB
一键复制 编辑 原始数据 按行查看 历史
From b221b3ab6d881efedc544e0e0ed9c507e21fd178 Mon Sep 17 00:00:00 2001
Message-Id: <b221b3ab6d881efedc544e0e0ed9c507e21fd178@dist-git>
From: Michal Privoznik <mprivozn@redhat.com>
Date: Wed, 11 May 2022 16:37:27 +0200
Subject: [PATCH] qemu_domain: Format qemuDomainObjPrivate::originalMemlock
Now that qemuDomainObjPrivate struct gained new member format it
into XML and parse it so that the value is preserved across
daemon restarts.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
(cherry picked from commit 21aec91790ae14d24512856b20cff49764ede637)
https://bugzilla.redhat.com/show_bug.cgi?id=2089433
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
src/qemu/qemu_domain.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 86d673dafa..ee7d310903 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -2383,6 +2383,12 @@ qemuDomainObjPrivateXMLFormat(virBuffer *buf,
if (qemuDomainObjPrivateXMLFormatBackups(buf, vm) < 0)
return -1;
+ if (priv->originalMemlock > 0) {
+ virBufferAsprintf(buf,
+ "<originalMemlock>%llu</originalMemlock>\n",
+ priv->originalMemlock);
+ }
+
return 0;
}
@@ -3104,6 +3110,13 @@ qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt,
priv->memPrealloc = virXPathBoolean("boolean(./memPrealloc)", ctxt) == 1;
+ if (virXPathULongLong("string(./originalMemlock)",
+ ctxt, &priv->originalMemlock) == -2) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("failed to parse original memlock size"));
+ goto error;
+ }
+
return 0;
error:
--
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