From nobody Fri May 3 14:10:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1503494773093401.7069030079268; Wed, 23 Aug 2017 06:26:13 -0700 (PDT) Received: from localhost ([::1]:43735 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkVff-0006rZ-1h for importer@patchew.org; Wed, 23 Aug 2017 09:26:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48909) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkVep-0006WN-G2 for qemu-devel@nongnu.org; Wed, 23 Aug 2017 09:25:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dkVem-0000jD-Tu for qemu-devel@nongnu.org; Wed, 23 Aug 2017 09:25:19 -0400 Received: from smtp.citrix.com ([66.165.176.89]:58634) by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71) (envelope-from ) id 1dkVem-0000hg-OP for qemu-devel@nongnu.org; Wed, 23 Aug 2017 09:25:16 -0400 X-IronPort-AV: E=Sophos;i="5.41,417,1498521600"; d="scan'208";a="436559175" From: Ross Lagerwall To: Date: Wed, 23 Aug 2017 14:25:05 +0100 Message-ID: <20170823132505.1505-1-ross.lagerwall@citrix.com> X-Mailer: git-send-email 2.9.5 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 66.165.176.89 Subject: [Qemu-devel] [PATCH v2] xen: Emit RTC_CHANGE upon TIMEOFFSET ioreq X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Anthony Perard , xen-devel@lists.xenproject.org, Stefano Stabellini , Ross Lagerwall Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When the guest writes to the RTC, Xen emulates it and broadcasts a TIMEOFFSET ioreq. Emit an RTC_CHANGE QMP event to all QMP monitors when this happens rather than ignoring it so that something useful can be done with the information. This is the same event that QEMU generates when it emulates the RTC. This patch by itself doesn't affect any of the toolstacks that I checked; the libxl toolstack doesn't currently handle this event nor does the XAPI toolstack. If nothing handles the event, it is simply ignored. We plan on modifying XAPI to handle it. Signed-off-by: Ross Lagerwall Reviewed-by: Stefano Stabellini --- Changed in v2: * Expanded commit message. 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" =20 #include "qemu/error-report.h" @@ -967,6 +968,7 @@ static void handle_ioreq(XenIOState *state, ioreq_t *re= q) 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(); --=20 2.9.5