xen-hvm: Emit RTC_CHANGE upon TIMEOFFSET ioreq
When the guest writes to the RTC, the write is intercepted and emulated by Xen and the time difference is broadcasted as a TIMEOFFSET ioreq. Emit an RTC_CHANGE QMP event when this happens rather than ignoring it so that something can make use of the information (e.g. the toolstack can persist it between VM starts). Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com> Message-ID: <20260108135406.1879210-1-ross.lagerwall@citrix.com> Acked-by: Anthony PERARD <anthony.perard@vates.tech> Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
Ross Lagerwall committed
Jan 8, 2026 at 13:54 UTC
5a0b8890862251de3f182020cdfa3faaec7623aa
1 file changed
+2
hw/xen/xen-hvm-common.c
+2
@@ -4,6 +4,7 @@
4
#include "qemu/error-report.h"
5
#include "qemu/target-info.h"
6
#include "qapi/error.h"
7
+#include "qapi/qapi-events-misc.h"
8
#include "exec/target_page.h"
9
#include "trace.h"
10
@@ -471,6 +472,7 @@ static void handle_ioreq(XenIOState *state, ioreq_t *req)
472
cpu_ioreq_move(req);
473
break;
474
case IOREQ_TYPE_TIMEOFFSET:
475
+ qapi_event_send_rtc_change((int64_t)req->data, "");
476
break;
477
case IOREQ_TYPE_INVALIDATE:
478
xen_invalidate_map_cache();