1 Star 0 Fork 70

mds.lanruo/libvirt

forked from src-openEuler/libvirt 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
qemu-Fix-memstat-for-non-transitional-memballoon.patch 2.19 KB
一键复制 编辑 原始数据 按行查看 历史
From b7993fb89518de145d41a631040900b42cf97858 Mon Sep 17 00:00:00 2001
From: Andrea Bolognani <[email protected]>
Date: Tue, 12 Jan 2021 17:17:44 +0100
Subject: [PATCH 084/108] qemu: Fix memstat for (non-)transitional memballoon
Depending on the memballoon model, the corresponding QOM node
will have a different type and we need to account for this
when searching for it in the QOM tree.
https://bugzilla.redhat.com/show_bug.cgi?id=1911786
Signed-off-by: Andrea Bolognani <[email protected]>
Reviewed-by: Daniel Henrique Barboza <[email protected]>
Reviewed-by: Michal Privoznik <[email protected]>
(cherry picked from commit 0a6cb05e953d315b7a05103d707cff4d36221211)
---
src/qemu/qemu_monitor.c | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index c98edbd254..8f6261ace2 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -1031,7 +1031,27 @@ qemuMonitorInitBalloonObjectPath(qemuMonitorPtr mon,
switch (balloon->info.type) {
case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI:
- name = "virtio-balloon-pci";
+ switch ((virDomainMemballoonModel) balloon->model) {
+ case VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO:
+ name = "virtio-balloon-pci";
+ break;
+ case VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO_TRANSITIONAL:
+ name = "virtio-balloon-pci-transitional";
+ break;
+ case VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO_NON_TRANSITIONAL:
+ name = "virtio-balloon-pci-non-transitional";
+ break;
+ case VIR_DOMAIN_MEMBALLOON_MODEL_XEN:
+ case VIR_DOMAIN_MEMBALLOON_MODEL_NONE:
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("invalid model for virtio-balloon-pci"));
+ return;
+ case VIR_DOMAIN_MEMBALLOON_MODEL_LAST:
+ default:
+ virReportEnumRangeError(virDomainMemballoonModel,
+ balloon->model);
+ return;
+ }
break;
case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW:
name = "virtio-balloon-ccw";
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mdslanruo/libvirt.git
[email protected]:mdslanruo/libvirt.git
mdslanruo
libvirt
libvirt
master

搜索帮助