1 Star 0 Fork 71

Jiangjiacheng/src_libvirt

forked from src-openEuler/libvirt 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
qemu_driver-Probe-capability-before-calculating-dirt.patch 1.75 KB
一键复制 编辑 原始数据 按行查看 历史
yezengruan 提交于 2022-12-06 15:38 . libvirt update to version 6.2.0-47
From 7889fb1123cbe6aca437797005b8b18b3d5ae93a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hyman=20Huang=28=E9=BB=84=E5=8B=87=29?=
<huangy81@chinatelecom.cn>
Date: Sun, 20 Feb 2022 21:28:09 +0800
Subject: [PATCH 4/7] qemu_driver: Probe capability before calculating dirty
page rate
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Probing QEMU_CAPS_CALC_DIRTY_RATE capability in advance
in case of failure when calculating dirty page rate.
Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
---
src/qemu/qemu_driver.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 62806da86a..19d32b5fa3 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -23332,6 +23332,16 @@ qemuDomainStartDirtyRateCalc(virDomainPtr dom,
if (virDomainStartDirtyRateCalcEnsureACL(dom->conn, vm->def) < 0)
goto cleanup;
+ if (virDomainObjCheckActive(vm) < 0)
+ goto cleanup;
+
+ priv = vm->privateData;
+ if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_CALC_DIRTY_RATE)) {
+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
+ _("QEMU does not support calculating dirty page rate"));
+ goto cleanup;
+ }
+
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
goto cleanup;
@@ -23343,7 +23353,6 @@ qemuDomainStartDirtyRateCalc(virDomainPtr dom,
VIR_DEBUG("Calculate dirty rate in next %d seconds", seconds);
- priv = vm->privateData;
qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorStartDirtyRateCalc(priv->mon, seconds);
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jjiacheng/src_libvirt.git
git@gitee.com:jjiacheng/src_libvirt.git
jjiacheng
src_libvirt
src_libvirt
master

搜索帮助