From 4ff504f61fc559078fcd1e8bf9adc5114a7da761 Mon Sep 17 00:00:00 2001 From: Chen Qun Date: Thu, 10 Feb 2022 11:35:58 +0800 Subject: [PATCH] monitor: limit io error qmp event to at most once per 60s The speed of BLOCK IO ERROR event maybe very high (thousands per second). If we report all BLOCK IO ERRORs, the log file will be flooded with BLOCK IO ERROR event. So throttle it to at most once per 60s. Signed-off-by: Yan Wang Signed-off-by: imxcc (cherry picked from commit 381b95fdf20ab5326ca1811155134a23fbc2046e) --- ...-error-qmp-event-to-at-most-once-per.patch | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 monitor-limit-io-error-qmp-event-to-at-most-once-per.patch diff --git a/monitor-limit-io-error-qmp-event-to-at-most-once-per.patch b/monitor-limit-io-error-qmp-event-to-at-most-once-per.patch new file mode 100644 index 0000000..2b3b02f --- /dev/null +++ b/monitor-limit-io-error-qmp-event-to-at-most-once-per.patch @@ -0,0 +1,29 @@ +From 44f45b5c163efed5387dac40e229e0a50bf5921a Mon Sep 17 00:00:00 2001 +From: Yan Wang +Date: Thu, 10 Feb 2022 11:35:58 +0800 +Subject: [PATCH] monitor: limit io error qmp event to at most once per 60s + +The speed of BLOCK IO ERROR event maybe very high (thousands per +second). If we report all BLOCK IO ERRORs, the log file will be flooded +with BLOCK IO ERROR event. So throttle it to at most once per 60s. + +Signed-off-by: Yan Wang +--- + monitor/monitor.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/monitor/monitor.c b/monitor/monitor.c +index fb4ae9531c..621e79eb66 100644 +--- a/monitor/monitor.c ++++ b/monitor/monitor.c +@@ -300,6 +300,7 @@ static MonitorQAPIEventConf monitor_qapi_event_conf[QAPI_EVENT__MAX] = { + [QAPI_EVENT_QUORUM_FAILURE] = { 1000 * SCALE_MS }, + [QAPI_EVENT_VSERPORT_CHANGE] = { 1000 * SCALE_MS }, + [QAPI_EVENT_MEMORY_DEVICE_SIZE_CHANGE] = { 1000 * SCALE_MS }, ++ [QAPI_EVENT_BLOCK_IO_ERROR] = { 60L * 1000 * SCALE_MS }, + }; + + /* +-- +2.27.0 +