From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 77D7AC433F5 for ; Fri, 24 Sep 2021 13:38:11 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DC7BC6103B for ; Fri, 24 Sep 2021 13:38:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org DC7BC6103B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:39314 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mTlOz-00011n-VU for qemu-devel@archiver.kernel.org; Fri, 24 Sep 2021 09:38:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59624) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mTlNQ-0007N5-PJ for qemu-devel@nongnu.org; Fri, 24 Sep 2021 09:36:32 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:43301) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mTlNN-0008DJ-9l for qemu-devel@nongnu.org; Fri, 24 Sep 2021 09:36:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632490587; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=O0CmkOaEjq8u5/AGn4aw3SejtQjbEi8csO/TnshE0qg=; b=Gtu5KldBeoj8qKURzVkrI6ZMQOQc4avdxN8isxwnCLB/FUR/DqogULAnLTA9iZ6pv/l8Uq q7zmb2piKGqoY6zjDQBD6Jf9uvwRwSlmp2JNqLdU7wMm+qIZl5uj+Q5bWGjVCkBhdP2tPa XpeYBXzN8H2T49/qgqraTruDIoyLNAw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-460-2FLGHHQtMSWGPeTeBV5s5A-1; Fri, 24 Sep 2021 09:36:26 -0400 X-MC-Unique: 2FLGHHQtMSWGPeTeBV5s5A-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A9BF1100C662; Fri, 24 Sep 2021 13:36:25 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-14.ams2.redhat.com [10.36.112.14]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C13335D9DE; Fri, 24 Sep 2021 13:35:53 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 5D867113865F; Fri, 24 Sep 2021 15:35:52 +0200 (CEST) From: Markus Armbruster To: Peter Maydell Subject: Re: [Qemu-devel] [PULL 18/18] qapi: move RTC_CHANGE to the target schema References: <20190218140607.31998-1-armbru@redhat.com> <20190218140607.31998-19-armbru@redhat.com> <874kaarwou.fsf@dusky.pond.sub.org> Date: Fri, 24 Sep 2021 15:35:52 +0200 In-Reply-To: (Peter Maydell's message of "Fri, 24 Sep 2021 13:39:29 +0100") Message-ID: <87sfxup03r.fsf@dusky.pond.sub.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=armbru@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.473, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?Q?Marc-Andr=C3=A9?= Lureau , =?utf-8?Q?Daniel_P=2E_Berrang=C3=A9?= , QEMU Developers , Eric Auger Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Peter Maydell writes: > On Fri, 24 Sept 2021 at 13:21, Markus Armbruster wrot= e: >> ... this isn't really *target*-specific, it's *device*-specific: some >> devices implement the event, some don't. >> >> Ideally, we'd just fix that. > > Would you want to tell the far end "this machine simply does > not have an RTC device at all (because the hardware it's emulating > doesn't have one) and so you won't get RTC_CHANGE events" ? Well, RTC_CHANGE is "Emitted when the guest changes the RTC time." If the guest doesn't *have* an RTC... > A good first step for getting more devices to implement the > RTC_CHANGE support would be if there was any documentation on how > to do it. The JSON schema says the offset should be "offset between > base RTC clock (as specified by -rtc base), and new RTC clock value", > but there aren't any hints (either there or elsewhere) as to how a > device is supposed to determine that value, and there's no > documentation of what the behaviour or intent is of the > qemu_timedate_diff() function that the existing implementations > use to calculate the offset. RTC_CHANGE is from the bad old times, I'm afraid: commit 80cd34787fc0fc31b1a341c7b8d8e729c1b6ea58 Author: Luiz Capitulino Date: Thu Feb 25 12:11:44 2010 -0300 QMP: Introduce RTC_CHANGE event Emitted whenever the RTC time changes. Signed-off-by: Luiz Capitulino Signed-off-by: Anthony Liguori No hint at why or how to use it. I figure this is the matching libvirt commit: commit 32e6ac9c2601e19715d18f743cf805a3466d3385 Author: Daniel P. Berrang=C3=A9 Date: Thu Mar 18 18:28:15 2010 +0000 Add support for an explicit RTC change event This introduces a new event type VIR_DOMAIN_EVENT_ID_RTC_CHANGE This event includes the new UTC offset measured in seconds. Thus there is a new callback definition for this event type typedef void (*virConnectDomainEventRTCChangeCallback)(virConnectP= tr conn, virDomainPt= r dom, long long u= tcoffset, void *opaqu= e); If the guest XML configuration for the is set to offset=3D'variable', then the XML will automatically be updated with the new UTC offset value. This ensures that during migration/save/restore the new offset is preserved. * daemon/remote.c: Dispatch RTC change events to client * examples/domain-events/events-c/event-test.c: Watch for RTC change events * include/libvirt/libvirt.h.in: Define new RTC change event ID and callback signature * src/conf/domain_event.c, src/conf/domain_event.h, src/libvirt_private.syms: Extend API to handle RTC change events * src/qemu/qemu_driver.c: Connect to the QEMU monitor event for RTC changes and emit a libvirt RTC change event * src/remote/remote_driver.c: Receive and dispatch RTC change events to application * src/remote/remote_protocol.x: Wire protocol definition for RTC change events * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h, src/qemu/qemu_monitor_json.c: Watch for RTC_CHANGE event from QEMU monitor Suggests it might be needed for migration. How today's libvirt uses RTC_CHANGE would be good to know. I don't have the time to ferret it out myself. Daniel, do you know? If not, who else might? > Side note: probably the JSON schema should document the units > for 'offset'. Code inspection suggests it wants seconds. Doc bug, patch would be lovely. > Side side note: the JSON event doesn't seem to contemplate > the possibility that a machine might have more than one RTC... Right. It clearly needs an additional member @qom-path identifying the RTC device.