[Qemu-devel] [PATCH] xen: Emit RTC_CHANGE upon TIMEOFFSET ioreq

Ross Lagerwall posted 1 patch 6 years, 7 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20170821140138.27421-1-ross.lagerwall@citrix.com
Test FreeBSD passed
Test checkpatch passed
Test docker passed
Test s390x passed
There is a newer version of this series
hw/i386/xen/xen-hvm.c | 2 ++
1 file changed, 2 insertions(+)
[Qemu-devel] [PATCH] xen: Emit RTC_CHANGE upon TIMEOFFSET ioreq
Posted by Ross Lagerwall 6 years, 7 months ago
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.

Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
---
 hw/i386/xen/xen-hvm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c
index d9ccd5d..ffd20dc 100644
--- a/hw/i386/xen/xen-hvm.c
+++ b/hw/i386/xen/xen-hvm.c
@@ -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();
-- 
2.9.5


Re: [Qemu-devel] [PATCH] xen: Emit RTC_CHANGE upon TIMEOFFSET ioreq
Posted by Stefano Stabellini 6 years, 7 months ago
On Mon, 21 Aug 2017, Ross Lagerwall wrote:
> 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.


> Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
> ---
>  hw/i386/xen/xen-hvm.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c
> index d9ccd5d..ffd20dc 100644
> --- a/hw/i386/xen/xen-hvm.c
> +++ b/hw/i386/xen/xen-hvm.c
> @@ -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();
> -- 
> 2.9.5
> 

Re: [Qemu-devel] [PATCH] xen: Emit RTC_CHANGE upon TIMEOFFSET ioreq
Posted by Ross Lagerwall 6 years, 7 months ago
On 08/21/2017 11:30 PM, Stefano Stabellini wrote:
> On Mon, 21 Aug 2017, Ross Lagerwall wrote:
>> 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.

-- 
Ross Lagerwall

Re: [Qemu-devel] [PATCH] xen: Emit RTC_CHANGE upon TIMEOFFSET ioreq
Posted by Stefano Stabellini 6 years, 7 months ago
On Tue, 22 Aug 2017, Ross Lagerwall wrote:
> On 08/21/2017 11:30 PM, Stefano Stabellini wrote:
> > On Mon, 21 Aug 2017, Ross Lagerwall wrote:
> > > 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.

OK, please expland the patch description and repost.