mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 16:53:55 -06:00
rtc: Have event RTC_CHANGE identify the RTC by QOM path
Event RTC_CHANGE is "emitted when the guest changes the RTC time" (and the RTC supports the event). What if there's more than one RTC? Which one changed? New @qom-path identifies it. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <87a6ejnm80.fsf@pond.sub.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
This commit is contained in:
parent
03397528d9
commit
2beb1e5f9a
4 changed files with 10 additions and 4 deletions
|
@ -611,12 +611,13 @@ static void rtc_get_time(RTCState *s, struct tm *tm)
|
|||
static void rtc_set_time(RTCState *s)
|
||||
{
|
||||
struct tm tm;
|
||||
g_autofree const char *qom_path = object_get_canonical_path(OBJECT(s));
|
||||
|
||||
rtc_get_time(s, &tm);
|
||||
s->base_rtc = mktimegm(&tm);
|
||||
s->last_update = qemu_clock_get_ns(rtc_clock);
|
||||
|
||||
qapi_event_send_rtc_change(qemu_timedate_diff(&tm));
|
||||
qapi_event_send_rtc_change(qemu_timedate_diff(&tm), qom_path);
|
||||
}
|
||||
|
||||
static void rtc_set_cmos(RTCState *s, const struct tm *tm)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue