#include "hw/timer/mc146818rtc.h"
#include "qapi/visitor.h"
#include "qapi-event.h"
+#include "qmp-commands.h"
#ifdef TARGET_I386
#include "hw/i386/apic.h"
Notifier clock_reset_notifier;
LostTickPolicy lost_tick_policy;
Notifier suspend_notifier;
+ QLIST_ENTRY(RTCState) link;
} RTCState;
static void rtc_set_time(RTCState *s);
rtc_from_bcd(s, s->cmos_data[RTC_CENTURY]) * 100 - 1900;
}
+static QLIST_HEAD(, RTCState) rtc_devices =
+ QLIST_HEAD_INITIALIZER(rtc_devices);
+
+#ifdef TARGET_I386
+void qmp_rtc_reset_reinjection(Error **errp)
+{
+ RTCState *s;
+
+ QLIST_FOREACH(s, &rtc_devices, link) {
+ s->irq_coalesced = 0;
+ }
+}
+#endif
+
static void rtc_set_time(RTCState *s)
{
struct tm tm;
} else {
isa_init_irq(isadev, &s->irq, RTC_ISA_IRQ);
}
+ QLIST_INSERT_HEAD(&rtc_devices, s, link);
+
return isadev;
}
{ /* end of list */ }
},
};
+
+#ifndef TARGET_I386
+void qmp_rtc_reset_reinjection(Error **errp)
+{
+ error_set(errp, QERR_FEATURE_DISABLED, "rtc-reset-reinjection");
+}
+#endif
##
{ 'enum': 'GuestPanicAction',
'data': [ 'pause' ] }
+
+##
+# @rtc-reset-reinjection
+#
+# This command will reset the RTC interrupt reinjection backlog.
+# Can be used if another mechanism to synchronize guest time
+# is in effect, for example QEMU guest agent's guest-set-time
+# command.
+#
+# Since: 2.1
+##
+{ 'command': 'rtc-reset-reinjection' }
{ "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
]}
EQMP
+
+#if defined TARGET_I386
+ {
+ .name = "rtc-reset-reinjection",
+ .args_type = "",
+ .mhandler.cmd_new = qmp_marshal_input_rtc_reset_reinjection,
+ },
+#endif
+
+SQMP
+rtc-reset-reinjection
+---------------------
+
+Reset the RTC interrupt reinjection backlog.
+
+Arguments: None.
+
+Example:
+
+-> { "execute": "rtc-reset-reinjection" }
+<- { "return": {} }
+
+EQMP