mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 16:53:55 -06:00
QMP: Introduce RTC_CHANGE event
Emitted whenever the RTC time changes. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
d74c7dfd1b
commit
80cd34787f
6 changed files with 32 additions and 0 deletions
9
vl.c
9
vl.c
|
@ -1492,6 +1492,15 @@ int qemu_timedate_diff(struct tm *tm)
|
|||
return seconds - time(NULL);
|
||||
}
|
||||
|
||||
void rtc_change_mon_event(struct tm *tm)
|
||||
{
|
||||
QObject *data;
|
||||
|
||||
data = qobject_from_jsonf("{ 'offset': %d }", qemu_timedate_diff(tm));
|
||||
monitor_protocol_event(QEVENT_RTC_CHANGE, data);
|
||||
qobject_decref(data);
|
||||
}
|
||||
|
||||
static void configure_rtc_date_offset(const char *startdate, int legacy)
|
||||
{
|
||||
time_t rtc_start_date;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue