Skip to contentSkip to conversation

xen: Emit RTC_CHANGE upon TIMEOFFSET ioreq

PATCH Superseded Ross Lagerwall 2 participants 4 messages Aug 21, 2017 – Aug 22, 2017

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen: Emit RTC_CHANGE upon TIMEOFFSET ioreq

When the guest writes to the RTC, Xen emulates it and broadcasts a TIMEOFFSET ioreq. Emit an RTC_CHANGE QMP message when this happens rather than ignoring it so that something useful can be done with the information.

---
 hw/i386/xen/xen-hvm.c | 2 ++
 1 file changed, 2 insertions(+)
hw/i386/xen/xen-hvm.c +2 -0
index d9ccd5d..ffd20dc 100644
@@ -16,6 +16,7 @@
 #include "hw/i386/apic-msidef.h"
 #include "hw/xen/xen_common.h"
 #include "hw/xen/xen_backend.h"
+#include "qapi-event.h"
 #include "qmp-commands.h"
 
 #include "qemu/error-report.h"
@@ -967,6 +968,7 @@ static void handle_ioreq(XenIOState *state, ioreq_t *req)
             handle_vmport_ioreq(state, req);
             break;
         case IOREQ_TYPE_TIMEOFFSET:
+            qapi_event_send_rtc_change((int64_t)req->data, &error_abort);
             break;
         case IOREQ_TYPE_INVALIDATE:
             xen_invalidate_map_cache();
Signature · 7 lines
2.9.5


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#1 lore raw
Quoted 4 lines · Ross Lagerwall

When the guest writes to the RTC, Xen emulates it and broadcasts a TIMEOFFSET ioreq. Emit an RTC_CHANGE QMP message when this happens rather than ignoring it so that something useful can be done with the information.

Are there any handlers of the RTC_CHANGE QMP message today? What happens if there are no handlers?

In other words, does this patch change the existing behavior? If so, please describe, otherwise, please state that there are no behavioral changes.

Quoted 28 lines
---
 hw/i386/xen/xen-hvm.c | 2 ++
 1 file changed, 2 insertions(+)
hw/i386/xen/xen-hvm.c +2 -0
index d9ccd5d..ffd20dc 100644
@@ -16,6 +16,7 @@
 #include "hw/i386/apic-msidef.h"
 #include "hw/xen/xen_common.h"
 #include "hw/xen/xen_backend.h"
+#include "qapi-event.h"
 #include "qmp-commands.h"
 
 #include "qemu/error-report.h"
@@ -967,6 +968,7 @@ static void handle_ioreq(XenIOState *state, ioreq_t *req)
             handle_vmport_ioreq(state, req);
             break;
         case IOREQ_TYPE_TIMEOFFSET:
+            qapi_event_send_rtc_change((int64_t)req->data, &error_abort);
             break;
         case IOREQ_TYPE_INVALIDATE:
             xen_invalidate_map_cache();
Signature · 1 line
2.9.5

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#2 lore raw
Quoted 8 lines · Stefano Stabellini
Quoted 4 lines · Ross Lagerwall

When the guest writes to the RTC, Xen emulates it and broadcasts a TIMEOFFSET ioreq. Emit an RTC_CHANGE QMP message when this happens rather than ignoring it so that something useful can be done with the information.

Are there any handlers of the RTC_CHANGE QMP message today? What happens if there are no handlers?

The libxl toolstack doesn't handle it nor does the XAPI project currently, although we plan on modifying XAPI to handle it.

It is simply an event that is broadcast to any QMP monitors. If nothing handles the event, then it is the same behavior as before. If something is interested in the event, then it can make use of the time offset however it wants.

Signature · 6 lines
Ross Lagerwall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#3 lore raw
Quoted 10 lines · Ross Lagerwall
Quoted 8 lines · Stefano Stabellini
Quoted 4 lines · Ross Lagerwall

When the guest writes to the RTC, Xen emulates it and broadcasts a TIMEOFFSET ioreq. Emit an RTC_CHANGE QMP message when this happens rather than ignoring it so that something useful can be done with the information.

Are there any handlers of the RTC_CHANGE QMP message today? What happens if there are no handlers?

Quoted 7 lines

The libxl toolstack doesn't handle it nor does the XAPI project currently, although we plan on modifying XAPI to handle it.

It is simply an event that is broadcast to any QMP monitors. If nothing handles the event, then it is the same behavior as before. If something is interested in the event, then it can make use of the time offset however it wants.

OK, please expland the patch description and repost.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel