All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kurz <groug@kaod.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	qemu-devel@nongnu.org, "Markus Armbruster" <armbru@redhat.com>,
	"Eric Auger" <eric.auger@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Eric Blake" <eblake@redhat.com>,
	"David Gibson" <david@gibson.dropbear.id.au>
Subject: Re: [PATCH 1/2] qapi: Move RTC_CHANGE back out of target schema
Date: Fri, 24 Sep 2021 16:07:07 +0200	[thread overview]
Message-ID: <20210924160707.6f76ac09@bahia.huguette> (raw)
In-Reply-To: <20210924140142.31398-2-peter.maydell@linaro.org>

On Fri, 24 Sep 2021 15:01:41 +0100
Peter Maydell <peter.maydell@linaro.org> wrote:

> This commit effectively reverts commit 183e4281a30962, which moved
> the RTC_CHANGE event to the target schema.  That change was an
> attempt to make the event target-specific to improve introspection,
> but the event isn't really target-specific: it's machine or device
> specific.  Putting RTC_CHANGE in the target schema with an ifdef list
> reduces maintainability (by adding an if: list with a long list of
> targets that needs to be manually updated as architectures are added
> or removed or as new devices gain the RTC_CHANGE functionality) and
> increases compile time (by preventing RTC devices which emit the
> event from being "compile once" rather than "compile once per
> target", because qapi-events-misc-target.h uses TARGET_* ifdefs,
> which are poisoned in "compile once" files.)
> 
> Move RTC_CHANGE back to misc.json.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---

For the ppc part,

Acked-by: Greg Kurz <groug@kaod.org>

>  qapi/misc-target.json | 33 ---------------------------------
>  qapi/misc.json        | 22 ++++++++++++++++++++++
>  hw/ppc/spapr_rtc.c    |  2 +-
>  hw/rtc/mc146818rtc.c  |  2 +-
>  4 files changed, 24 insertions(+), 35 deletions(-)
> 
> diff --git a/qapi/misc-target.json b/qapi/misc-target.json
> index 3b05ad3dbfb..f442421e838 100644
> --- a/qapi/misc-target.json
> +++ b/qapi/misc-target.json
> @@ -2,39 +2,6 @@
>  # vim: filetype=python
>  #
>  
> -##
> -# @RTC_CHANGE:
> -#
> -# Emitted when the guest changes the RTC time.
> -#
> -# @offset: offset between base RTC clock (as specified by -rtc base), and
> -#          new RTC clock value
> -#
> -# Note: This event is rate-limited.
> -#
> -# Since: 0.13
> -#
> -# Example:
> -#
> -# <-   { "event": "RTC_CHANGE",
> -#        "data": { "offset": 78 },
> -#        "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
> -#
> -##
> -{ 'event': 'RTC_CHANGE',
> -  'data': { 'offset': 'int' },
> -  'if': { 'any': [ 'TARGET_ALPHA',
> -                   'TARGET_ARM',
> -                   'TARGET_HPPA',
> -                   'TARGET_I386',
> -                   'TARGET_MIPS',
> -                   'TARGET_MIPS64',
> -                   'TARGET_PPC',
> -                   'TARGET_PPC64',
> -                   'TARGET_S390X',
> -                   'TARGET_SH4',
> -                   'TARGET_SPARC' ] } }
> -
>  ##
>  # @rtc-reset-reinjection:
>  #
> diff --git a/qapi/misc.json b/qapi/misc.json
> index 5c2ca3b5566..ce7edd3f7bf 100644
> --- a/qapi/misc.json
> +++ b/qapi/misc.json
> @@ -523,3 +523,25 @@
>   'data': { '*option': 'str' },
>   'returns': ['CommandLineOptionInfo'],
>   'allow-preconfig': true }
> +
> +##
> +# @RTC_CHANGE:
> +#
> +# Emitted when the guest changes the RTC time.
> +#
> +# @offset: offset between base RTC clock (as specified by -rtc base), and
> +#          new RTC clock value
> +#
> +# Note: This event is rate-limited.
> +#
> +# Since: 0.13
> +#
> +# Example:
> +#
> +# <-   { "event": "RTC_CHANGE",
> +#        "data": { "offset": 78 },
> +#        "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
> +#
> +##
> +{ 'event': 'RTC_CHANGE',
> +  'data': { 'offset': 'int' } }
> diff --git a/hw/ppc/spapr_rtc.c b/hw/ppc/spapr_rtc.c
> index fba4dfca358..7a185d45400 100644
> --- a/hw/ppc/spapr_rtc.c
> +++ b/hw/ppc/spapr_rtc.c
> @@ -32,7 +32,7 @@
>  #include "hw/ppc/spapr.h"
>  #include "migration/vmstate.h"
>  #include "qapi/error.h"
> -#include "qapi/qapi-events-misc-target.h"
> +#include "qapi/qapi-events-misc.h"
>  #include "qemu/cutils.h"
>  #include "qemu/module.h"
>  
> diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c
> index 4fbafddb226..5ecf96142a1 100644
> --- a/hw/rtc/mc146818rtc.c
> +++ b/hw/rtc/mc146818rtc.c
> @@ -40,7 +40,7 @@
>  #include "hw/rtc/mc146818rtc_regs.h"
>  #include "migration/vmstate.h"
>  #include "qapi/error.h"
> -#include "qapi/qapi-events-misc-target.h"
> +#include "qapi/qapi-events-misc.h"
>  #include "qapi/visitor.h"
>  #include "hw/rtc/mc146818rtc_regs.h"
>  



  reply	other threads:[~2021-09-24 14:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-24 14:01 [PATCH 0/2] qapi: Move RTC_CHANGE back out of target schema Peter Maydell
2021-09-24 14:01 ` [PATCH 1/2] " Peter Maydell
2021-09-24 14:07   ` Greg Kurz [this message]
2021-09-24 14:01 ` [PATCH 2/2] qapi: Document the units for the offset argument to RTC_CHANGE Peter Maydell
2021-09-25  7:43 ` [PATCH 0/2] qapi: Move RTC_CHANGE back out of target schema Markus Armbruster
2022-02-21 18:06   ` Peter Maydell
2022-02-22 11:35     ` Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210924160707.6f76ac09@bahia.huguette \
    --to=groug@kaod.org \
    --cc=armbru@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=eblake@redhat.com \
    --cc=eric.auger@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.