From 5f7ef309cdd7237f945f43a29dab50fc61a4d1d0 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: Mon, 5 Dec 2022 06:54:11 -0500
Subject: [PATCH 5/7] qemu_capabilities: Introduce QEMU_CAPS_DIRTYRATE_MODE
 capability
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

mode option of calc-dirty-rate command since qemu >=6.2.0.
Introduce QEMU_CAPS_DIRTYRATE_MODE capability definition.

Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
---
 src/qemu/qemu_capabilities.c | 2 ++
 src/qemu/qemu_capabilities.h | 1 +
 2 files changed, 3 insertions(+)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index c9b0a6c191..2e9f2025ba 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -578,6 +578,7 @@ VIR_ENUM_IMPL(virQEMUCaps,
 
               /* 365 */
               "calc-dirty-rate",
+              "dirtyrate-param.mode",
     );
 
 
@@ -1160,6 +1161,7 @@ struct virQEMUCapsStringFlags virQEMUCapsEvents[] = {
     { "VSERPORT_CHANGE", QEMU_CAPS_VSERPORT_CHANGE },
     { "BLOCK_WRITE_THRESHOLD", QEMU_CAPS_BLOCK_WRITE_THRESHOLD },
     { "DUMP_COMPLETED", QEMU_CAPS_DUMP_COMPLETED },
+    { "calc-dirty-rate/arg-type/mode", QEMU_CAPS_DIRTYRATE_MODE },
 };
 
 struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = {
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 6245072fc3..00682eb52c 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -559,6 +559,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
 
     /* 365 */
     QEMU_CAPS_CALC_DIRTY_RATE, /* accepts calc-dirty-rate */
+    QEMU_CAPS_DIRTYRATE_MODE , /* calc-dirty-rate accepts mode parameter */
 
     QEMU_CAPS_LAST /* this must always be the last item */
 } virQEMUCapsFlags;
-- 
2.27.0

