19 Star 0 Fork 71

openEuler-RISC-V/libvirt

forked from src-openEuler/libvirt 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
include-Introduce-virDomainDirtyRateCalcFlags.patch 3.03 KB
一键复制 编辑 原始数据 按行查看 历史
yezengruan 提交于 2022-12-06 15:38 . libvirt update to version 6.2.0-47
From c4c665b4654280560eafe5782359b71e8ef2b1b5 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:11 +0800
Subject: [PATCH 6/7] include: Introduce virDomainDirtyRateCalcFlags
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Introduce virDomainDirtyRateCalcFlags to get ready for
adding mode parameter to qemuDomainStartDirtyRateCalc.
Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
---
include/libvirt/libvirt-domain.h | 13 +++++++++++++
src/libvirt-domain.c | 12 +++++++++++-
2 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
index e1954ae663..c7956c81d6 100644
--- a/include/libvirt/libvirt-domain.h
+++ b/include/libvirt/libvirt-domain.h
@@ -5030,6 +5030,19 @@ typedef enum {
# endif
} virDomainDirtyRateStatus;
+/**
+ * virDomainDirtyRateCalcFlags:
+ *
+ * Flags OR'ed together to provide specific behaviour when calculating dirty page
+ * rate for a Domain
+ *
+ */
+typedef enum {
+ VIR_DOMAIN_DIRTYRATE_MODE_PAGE_SAMPLING = 0, /* default mode - page-sampling */
+ VIR_DOMAIN_DIRTYRATE_MODE_DIRTY_BITMAP = 1 << 0, /* dirty-bitmap mode */
+ VIR_DOMAIN_DIRTYRATE_MODE_DIRTY_RING = 1 << 1, /* dirty-ring mode */
+} virDomainDirtyRateCalcFlags;
+
int virDomainStartDirtyRateCalc(virDomainPtr domain,
int seconds,
unsigned int flags);
diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index 6a37ea85b7..0ff99c94b6 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -12821,7 +12821,7 @@ virDomainHotpatchManage(virDomainPtr domain,
* virDomainStartDirtyRateCalc:
* @domain: a domain object
* @seconds: specified calculating time in seconds
- * @flags: extra flags; not used yet, so callers should always pass 0
+ * @flags: bitwise-OR of supported virDomainDirtyRateCalcFlags
*
* Calculate the current domain's memory dirty rate in next @seconds.
* The calculated dirty rate information is available by calling
@@ -12845,6 +12845,16 @@ virDomainStartDirtyRateCalc(virDomainPtr domain,
virCheckReadOnlyGoto(conn->flags, error);
+ VIR_EXCLUSIVE_FLAGS_GOTO(VIR_DOMAIN_DIRTYRATE_MODE_PAGE_SAMPLING,
+ VIR_DOMAIN_DIRTYRATE_MODE_DIRTY_BITMAP,
+ error);
+ VIR_EXCLUSIVE_FLAGS_GOTO(VIR_DOMAIN_DIRTYRATE_MODE_PAGE_SAMPLING,
+ VIR_DOMAIN_DIRTYRATE_MODE_DIRTY_RING,
+ error);
+ VIR_EXCLUSIVE_FLAGS_GOTO(VIR_DOMAIN_DIRTYRATE_MODE_DIRTY_BITMAP,
+ VIR_DOMAIN_DIRTYRATE_MODE_DIRTY_RING,
+ error);
+
if (conn->driver->domainStartDirtyRateCalc) {
int ret;
ret = conn->driver->domainStartDirtyRateCalc(domain, seconds, flags);
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openeuler-risc-v/libvirt.git
git@gitee.com:openeuler-risc-v/libvirt.git
openeuler-risc-v
libvirt
libvirt
master

搜索帮助