+
+static QLIST_HEAD(, RTCState) rtc_devices =
+ QLIST_HEAD_INITIALIZER(rtc_devices);
+
+void qmp_rtc_reset_reinjection(Error **errp)
+{
+ RTCState *s;
+
+ QLIST_FOREACH(s, &rtc_devices, link) {
+ s->irq_coalesced = 0;
+ }
+}
+
static void rtc_set_time(RTCState *s)
{
struct tm tm;
@@ -911,6 +926,8 @@ ISADevice *rtc_init(ISABus *bus, int bas
} else {
isa_init_irq(isadev, &s->irq, RTC_ISA_IRQ);
}
+ QLIST_INSERT_HEAD(&rtc_devices, s, link);
+
return isadev;
}
Index: qemu/qapi-schema.json
===================================================================
--- qemu.orig/qapi-schema.json
+++ qemu/qapi-schema.json
@@ -4722,3 +4722,15 @@
'btn' : 'InputBtnEvent',
'rel' : 'InputMoveEvent',
'abs' : 'InputMoveEvent' } }
+
+##
+# @: rtc-reset-reinjection
+#
+# This command will reset RTC's interrupt reinjection backlog.
+# Can be used if another mechanism to synchronize guest time
+# is in effect, for example QEMU guest agents guest-set-time
+# command.
+#
+# Since: 2.1
+##
+{ 'command': 'rtc-reset-reinjection' }