qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PULL 0/9] QAPI patches patches for 2022-02-28
@ 2022-02-28 11:26 Markus Armbruster
  2022-02-28 11:26 ` [PULL 1/9] scripts/qapi: minor delinting Markus Armbruster
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Markus Armbruster @ 2022-02-28 11:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell

The following changes since commit fa435db8ce1dff3b15e3f59a12f55f7b3a347b08:

  Merge remote-tracking branch 'remotes/jsnow-gitlab/tags/python-pull-request' into staging (2022-02-24 12:48:14 +0000)

are available in the Git repository at:

  git://repo.or.cz/qemu/armbru.git tags/pull-qapi-2022-02-28

for you to fetch changes up to 1428502c8c0c0cfbb04212558144fef970042cf3:

  qapi: Belatedly adjust limitations documentation (2022-02-28 11:39:35 +0100)

----------------------------------------------------------------
QAPI patches patches for 2022-02-28

----------------------------------------------------------------
Fabian Holler (1):
      qapi/migration: Fix examples document wrong field name for arguments

John Snow (1):
      scripts/qapi: minor delinting

Markus Armbruster (4):
      keyval: Fix grammar comment to cover downstream prefix
      qapi: Fix stale reference to scripts/qapi.py in a comment
      rtc: Have event RTC_CHANGE identify the RTC by QOM path
      qapi: Belatedly adjust limitations documentation

Peter Maydell (3):
      qapi: Move RTC_CHANGE back out of target schema
      qapi: Document some missing details of RTC_CHANGE event
      hw/rtc: Compile pl031 once-only

 qapi/compat.json         |  2 +-
 qapi/migration.json      | 10 +++++-----
 qapi/misc-target.json    | 33 ---------------------------------
 qapi/misc.json           | 26 ++++++++++++++++++++++++++
 hw/ppc/spapr_rtc.c       |  6 ++++--
 hw/rtc/mc146818rtc.c     |  5 +++--
 hw/rtc/pl031.c           |  5 +++--
 qapi/qapi-util.c         |  2 +-
 util/keyval.c            |  4 +++-
 hw/rtc/meson.build       |  2 +-
 scripts/qapi/commands.py |  2 +-
 scripts/qapi/pylintrc    | 16 ++++++----------
 scripts/qapi/types.py    |  6 +++++-
 scripts/qapi/visit.py    |  6 +++++-
 14 files changed, 64 insertions(+), 61 deletions(-)

-- 
2.35.1



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PULL 1/9] scripts/qapi: minor delinting
  2022-02-28 11:26 [PULL 0/9] QAPI patches patches for 2022-02-28 Markus Armbruster
@ 2022-02-28 11:26 ` Markus Armbruster
  2022-02-28 11:26 ` [PULL 2/9] keyval: Fix grammar comment to cover downstream prefix Markus Armbruster
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Markus Armbruster @ 2022-02-28 11:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, John Snow

From: John Snow <jsnow@redhat.com>

Get isort and pylint tools passing again.

Signed-off-by: John Snow <jsnow@redhat.com>
Message-Id: <20220211183650.2946895-1-jsnow@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
[Comment explaining good-names-rgxs tweaked]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 scripts/qapi/commands.py |  2 +-
 scripts/qapi/pylintrc    | 16 ++++++----------
 scripts/qapi/types.py    |  6 +++++-
 scripts/qapi/visit.py    |  6 +++++-
 4 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/scripts/qapi/commands.py b/scripts/qapi/commands.py
index 869d799ed2..38ca38a7b9 100644
--- a/scripts/qapi/commands.py
+++ b/scripts/qapi/commands.py
@@ -25,8 +25,8 @@
     QAPIGenC,
     QAPISchemaModularCVisitor,
     build_params,
-    ifcontext,
     gen_special_features,
+    ifcontext,
 )
 from .schema import (
     QAPISchema,
diff --git a/scripts/qapi/pylintrc b/scripts/qapi/pylintrc
index b259531a72..a724628203 100644
--- a/scripts/qapi/pylintrc
+++ b/scripts/qapi/pylintrc
@@ -34,16 +34,12 @@ disable=fixme,
 
 [BASIC]
 
-# Good variable names which should always be accepted, separated by a comma.
-good-names=i,
-           j,
-           k,
-           ex,
-           Run,
-           _,
-           fp,  # fp = open(...)
-           fd,  # fd = os.open(...)
-           ch,
+# Good variable names regexes, separated by a comma. If names match any regex,
+# they will always be accepted.
+#
+# Suppress complaints about short names.  PEP-8 is cool with them,
+# and so are we.
+good-names-rgxs=^[_a-z][_a-z0-9]?$
 
 [VARIABLES]
 
diff --git a/scripts/qapi/types.py b/scripts/qapi/types.py
index 3013329c24..477d027001 100644
--- a/scripts/qapi/types.py
+++ b/scripts/qapi/types.py
@@ -16,7 +16,11 @@
 from typing import List, Optional
 
 from .common import c_enum_const, c_name, mcgen
-from .gen import QAPISchemaModularCVisitor, gen_special_features, ifcontext
+from .gen import (
+    QAPISchemaModularCVisitor,
+    gen_special_features,
+    ifcontext,
+)
 from .schema import (
     QAPISchema,
     QAPISchemaEnumMember,
diff --git a/scripts/qapi/visit.py b/scripts/qapi/visit.py
index e13bbe4292..380fa197f5 100644
--- a/scripts/qapi/visit.py
+++ b/scripts/qapi/visit.py
@@ -21,7 +21,11 @@
     indent,
     mcgen,
 )
-from .gen import QAPISchemaModularCVisitor, gen_special_features, ifcontext
+from .gen import (
+    QAPISchemaModularCVisitor,
+    gen_special_features,
+    ifcontext,
+)
 from .schema import (
     QAPISchema,
     QAPISchemaEnumMember,
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PULL 2/9] keyval: Fix grammar comment to cover downstream prefix
  2022-02-28 11:26 [PULL 0/9] QAPI patches patches for 2022-02-28 Markus Armbruster
  2022-02-28 11:26 ` [PULL 1/9] scripts/qapi: minor delinting Markus Armbruster
@ 2022-02-28 11:26 ` Markus Armbruster
  2022-02-28 11:26 ` [PULL 3/9] qapi: Fix stale reference to scripts/qapi.py in a comment Markus Armbruster
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Markus Armbruster @ 2022-02-28 11:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell

According to the grammar, a key __com.redhat_foo would be parsed as
two key fragments __com and redhat_foo.  It's actually parsed as a
single fragment.  Fix the grammar.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20220218145551.892787-2-armbru@redhat.com>
---
 util/keyval.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/util/keyval.c b/util/keyval.c
index 904337c8a1..0cf2e84dc8 100644
--- a/util/keyval.c
+++ b/util/keyval.c
@@ -16,7 +16,9 @@
  *   key-vals     = [ key-val { ',' key-val } [ ',' ] ]
  *   key-val      = key '=' val | help
  *   key          = key-fragment { '.' key-fragment }
- *   key-fragment = / [^=,.]+ /
+ *   key-fragment = qapi-name | index
+ *   qapi-name    = '__' / [a-z0-9.-]+ / '_' / [A-Za-z][A-Za-z0-9_-]* /
+ *   index        = / [0-9]+ /
  *   val          = { / [^,]+ / | ',,' }
  *   help         = 'help' | '?'
  *
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PULL 3/9] qapi: Fix stale reference to scripts/qapi.py in a comment
  2022-02-28 11:26 [PULL 0/9] QAPI patches patches for 2022-02-28 Markus Armbruster
  2022-02-28 11:26 ` [PULL 1/9] scripts/qapi: minor delinting Markus Armbruster
  2022-02-28 11:26 ` [PULL 2/9] keyval: Fix grammar comment to cover downstream prefix Markus Armbruster
@ 2022-02-28 11:26 ` Markus Armbruster
  2022-02-28 11:26 ` [PULL 4/9] qapi/migration: Fix examples document wrong field name for arguments Markus Armbruster
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Markus Armbruster @ 2022-02-28 11:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, Philippe Mathieu-Daudé

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20220218145551.892787-3-armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 qapi/qapi-util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qapi/qapi-util.c b/qapi/qapi-util.c
index fda7044539..63596e11c5 100644
--- a/qapi/qapi-util.c
+++ b/qapi/qapi-util.c
@@ -113,7 +113,7 @@ bool qapi_bool_parse(const char *name, const char *value, bool *obj, Error **err
  * may contain only letters, digits, hyphen and period.
  * The special exception for enumeration names is not implemented.
  * See docs/devel/qapi-code-gen.txt for more on QAPI naming rules.
- * Keep this consistent with scripts/qapi.py!
+ * Keep this consistent with scripts/qapi-gen.py!
  * If @complete, the parse fails unless it consumes @str completely.
  * Return its length on success, -1 on failure.
  */
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PULL 4/9] qapi/migration: Fix examples document wrong field name for arguments
  2022-02-28 11:26 [PULL 0/9] QAPI patches patches for 2022-02-28 Markus Armbruster
                   ` (2 preceding siblings ...)
  2022-02-28 11:26 ` [PULL 3/9] qapi: Fix stale reference to scripts/qapi.py in a comment Markus Armbruster
@ 2022-02-28 11:26 ` Markus Armbruster
  2022-02-28 11:26 ` [PULL 5/9] qapi: Move RTC_CHANGE back out of target schema Markus Armbruster
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Markus Armbruster @ 2022-02-28 11:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, Fabian Holler

From: Fabian Holler <fabian.holler@simplesurance.de>

The examples for the snapshot-* and calc-dirty-rate commands document
that arguments for the commands are passed in a 'data' field.
This is wrong, passing them in a "data" field results in
the error:
  {"error": {"class": "GenericError", "desc": "QMP input member 'data'
		       is unexpected"}}
Arguments are expected to be passed in an field called "arguments".

Replace "data" with "arguments" in the snapshot-* and calc-dirty-rate
command examples.

Signed-off-by: Fabian Holler <fabian.holler@simplesurance.de>
Message-Id: <20220222170116.63105-1-fabian.holler@simplesurance.de>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 qapi/migration.json | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/qapi/migration.json b/qapi/migration.json
index 5975a0e104..18e2610e88 100644
--- a/qapi/migration.json
+++ b/qapi/migration.json
@@ -1843,8 +1843,8 @@
 # Since: 5.2
 #
 # Example:
-#   {"command": "calc-dirty-rate", "data": {"calc-time": 1,
-#                                           'sample-pages': 512} }
+#   {"command": "calc-dirty-rate", "arguments": {"calc-time": 1,
+#                                                'sample-pages': 512} }
 #
 ##
 { 'command': 'calc-dirty-rate', 'data': {'calc-time': 'int64',
@@ -1888,7 +1888,7 @@
 # Example:
 #
 # -> { "execute": "snapshot-save",
-#      "data": {
+#      "arguments": {
 #         "job-id": "snapsave0",
 #         "tag": "my-snap",
 #         "vmstate": "disk0",
@@ -1949,7 +1949,7 @@
 # Example:
 #
 # -> { "execute": "snapshot-load",
-#      "data": {
+#      "arguments": {
 #         "job-id": "snapload0",
 #         "tag": "my-snap",
 #         "vmstate": "disk0",
@@ -2002,7 +2002,7 @@
 # Example:
 #
 # -> { "execute": "snapshot-delete",
-#      "data": {
+#      "arguments": {
 #         "job-id": "snapdelete0",
 #         "tag": "my-snap",
 #         "devices": ["disk0", "disk1"]
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PULL 5/9] qapi: Move RTC_CHANGE back out of target schema
  2022-02-28 11:26 [PULL 0/9] QAPI patches patches for 2022-02-28 Markus Armbruster
                   ` (3 preceding siblings ...)
  2022-02-28 11:26 ` [PULL 4/9] qapi/migration: Fix examples document wrong field name for arguments Markus Armbruster
@ 2022-02-28 11:26 ` Markus Armbruster
  2022-02-28 11:26 ` [PULL 6/9] qapi: Document some missing details of RTC_CHANGE event Markus Armbruster
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Markus Armbruster @ 2022-02-28 11:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, Greg Kurz, Philippe Mathieu-Daudé

From: Peter Maydell <peter.maydell@linaro.org>

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>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Greg Kurz <groug@kaod.org>
Message-Id: <20220221192123.749970-2-peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 qapi/misc-target.json | 33 ---------------------------------
 qapi/misc.json        | 22 ++++++++++++++++++++++
 hw/ppc/spapr_rtc.c    |  2 +-
 hw/rtc/mc146818rtc.c  |  2 +-
 hw/rtc/pl031.c        |  2 +-
 5 files changed, 25 insertions(+), 36 deletions(-)

diff --git a/qapi/misc-target.json b/qapi/misc-target.json
index 4bc45d2474..036c5e4a91 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 e8054f415b..7a70eaa3ff 100644
--- a/qapi/misc.json
+++ b/qapi/misc.json
@@ -527,3 +527,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 94a5510e4e..79677cf550 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 e61a0cced4..57c514e15c 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"
 
diff --git a/hw/rtc/pl031.c b/hw/rtc/pl031.c
index 38d9d3c2f3..60167c778f 100644
--- a/hw/rtc/pl031.c
+++ b/hw/rtc/pl031.c
@@ -24,7 +24,7 @@
 #include "qemu/log.h"
 #include "qemu/module.h"
 #include "trace.h"
-#include "qapi/qapi-events-misc-target.h"
+#include "qapi/qapi-events-misc.h"
 
 #define RTC_DR      0x00    /* Data read register */
 #define RTC_MR      0x04    /* Match register */
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PULL 6/9] qapi: Document some missing details of RTC_CHANGE event
  2022-02-28 11:26 [PULL 0/9] QAPI patches patches for 2022-02-28 Markus Armbruster
                   ` (4 preceding siblings ...)
  2022-02-28 11:26 ` [PULL 5/9] qapi: Move RTC_CHANGE back out of target schema Markus Armbruster
@ 2022-02-28 11:26 ` Markus Armbruster
  2022-02-28 11:26 ` [PULL 7/9] hw/rtc: Compile pl031 once-only Markus Armbruster
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Markus Armbruster @ 2022-02-28 11:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, Philippe Mathieu-Daudé

From: Peter Maydell <peter.maydell@linaro.org>

The RTC_CHANGE event's documentation is missing some details:
 * the offset argument is in units of seconds
 * it isn't guaranteed that the RTC will implement the event

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20220221192123.749970-3-peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 qapi/misc.json | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/qapi/misc.json b/qapi/misc.json
index 7a70eaa3ff..0ab235e41f 100644
--- a/qapi/misc.json
+++ b/qapi/misc.json
@@ -533,10 +533,12 @@
 #
 # Emitted when the guest changes the RTC time.
 #
-# @offset: offset between base RTC clock (as specified by -rtc base), and
-#          new RTC clock value
+# @offset: offset in seconds between base RTC clock (as specified
+#          by -rtc base), and new RTC clock value
 #
 # Note: This event is rate-limited.
+#       It is not guaranteed that the RTC in the system implements
+#       this event, or even that the system has an RTC at all.
 #
 # Since: 0.13
 #
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PULL 7/9] hw/rtc: Compile pl031 once-only
  2022-02-28 11:26 [PULL 0/9] QAPI patches patches for 2022-02-28 Markus Armbruster
                   ` (5 preceding siblings ...)
  2022-02-28 11:26 ` [PULL 6/9] qapi: Document some missing details of RTC_CHANGE event Markus Armbruster
@ 2022-02-28 11:26 ` Markus Armbruster
  2022-02-28 11:26 ` [PULL 8/9] rtc: Have event RTC_CHANGE identify the RTC by QOM path Markus Armbruster
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Markus Armbruster @ 2022-02-28 11:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, Philippe Mathieu-Daudé

From: Peter Maydell <peter.maydell@linaro.org>

Now that the RTC_CHANGE event is no longer target-specific,
we can move the pl031 back to a compile-once source file
rather than a compile-per-target one.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20220221192123.749970-4-peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 hw/rtc/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/rtc/meson.build b/hw/rtc/meson.build
index 8fd8d8f9a7..7cecdee5dd 100644
--- a/hw/rtc/meson.build
+++ b/hw/rtc/meson.build
@@ -2,7 +2,7 @@
 softmmu_ss.add(when: 'CONFIG_DS1338', if_true: files('ds1338.c'))
 softmmu_ss.add(when: 'CONFIG_M41T80', if_true: files('m41t80.c'))
 softmmu_ss.add(when: 'CONFIG_M48T59', if_true: files('m48t59.c'))
-specific_ss.add(when: 'CONFIG_PL031', if_true: files('pl031.c'))
+softmmu_ss.add(when: 'CONFIG_PL031', if_true: files('pl031.c'))
 softmmu_ss.add(when: 'CONFIG_TWL92230', if_true: files('twl92230.c'))
 softmmu_ss.add(when: ['CONFIG_ISA_BUS', 'CONFIG_M48T59'], if_true: files('m48t59-isa.c'))
 softmmu_ss.add(when: 'CONFIG_XLNX_ZYNQMP', if_true: files('xlnx-zynqmp-rtc.c'))
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PULL 8/9] rtc: Have event RTC_CHANGE identify the RTC by QOM path
  2022-02-28 11:26 [PULL 0/9] QAPI patches patches for 2022-02-28 Markus Armbruster
                   ` (6 preceding siblings ...)
  2022-02-28 11:26 ` [PULL 7/9] hw/rtc: Compile pl031 once-only Markus Armbruster
@ 2022-02-28 11:26 ` Markus Armbruster
  2022-02-28 11:26 ` [PULL 9/9] qapi: Belatedly adjust limitations documentation Markus Armbruster
  2022-03-01 13:25 ` [PULL 0/9] QAPI patches patches for 2022-02-28 Peter Maydell
  9 siblings, 0 replies; 11+ messages in thread
From: Markus Armbruster @ 2022-02-28 11:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, Philippe Mathieu-Daudé

Event RTC_CHANGE is "emitted when the guest changes the RTC time" (and
the RTC supports the event).  What if there's more than one RTC?
Which one changed?  New @qom-path identifies it.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <87a6ejnm80.fsf@pond.sub.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 qapi/misc.json       | 4 +++-
 hw/ppc/spapr_rtc.c   | 4 +++-
 hw/rtc/mc146818rtc.c | 3 ++-
 hw/rtc/pl031.c       | 3 ++-
 4 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/qapi/misc.json b/qapi/misc.json
index 0ab235e41f..b83cc39029 100644
--- a/qapi/misc.json
+++ b/qapi/misc.json
@@ -536,6 +536,8 @@
 # @offset: offset in seconds between base RTC clock (as specified
 #          by -rtc base), and new RTC clock value
 #
+# @qom-path: path to the RTC object in the QOM tree
+#
 # Note: This event is rate-limited.
 #       It is not guaranteed that the RTC in the system implements
 #       this event, or even that the system has an RTC at all.
@@ -550,4 +552,4 @@
 #
 ##
 { 'event': 'RTC_CHANGE',
-  'data': { 'offset': 'int' } }
+  'data': { 'offset': 'int', 'qom-path': 'str' } }
diff --git a/hw/ppc/spapr_rtc.c b/hw/ppc/spapr_rtc.c
index 79677cf550..d55b4b0c50 100644
--- a/hw/ppc/spapr_rtc.c
+++ b/hw/ppc/spapr_rtc.c
@@ -97,6 +97,7 @@ static void rtas_set_time_of_day(PowerPCCPU *cpu, SpaprMachineState *spapr,
                                  uint32_t nret, target_ulong rets)
 {
     SpaprRtcState *rtc = &spapr->rtc;
+    g_autofree const char *qom_path = NULL;
     struct tm tm;
     time_t new_s;
     int64_t host_ns;
@@ -120,7 +121,8 @@ static void rtas_set_time_of_day(PowerPCCPU *cpu, SpaprMachineState *spapr,
     }
 
     /* Generate a monitor event for the change */
-    qapi_event_send_rtc_change(qemu_timedate_diff(&tm));
+    qom_path = object_get_canonical_path(OBJECT(rtc));
+    qapi_event_send_rtc_change(qemu_timedate_diff(&tm), qom_path);
 
     host_ns = qemu_clock_get_ns(rtc_clock);
 
diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c
index 57c514e15c..ac9a60c90e 100644
--- a/hw/rtc/mc146818rtc.c
+++ b/hw/rtc/mc146818rtc.c
@@ -611,12 +611,13 @@ static void rtc_get_time(RTCState *s, struct tm *tm)
 static void rtc_set_time(RTCState *s)
 {
     struct tm tm;
+    g_autofree const char *qom_path = object_get_canonical_path(OBJECT(s));
 
     rtc_get_time(s, &tm);
     s->base_rtc = mktimegm(&tm);
     s->last_update = qemu_clock_get_ns(rtc_clock);
 
-    qapi_event_send_rtc_change(qemu_timedate_diff(&tm));
+    qapi_event_send_rtc_change(qemu_timedate_diff(&tm), qom_path);
 }
 
 static void rtc_set_cmos(RTCState *s, const struct tm *tm)
diff --git a/hw/rtc/pl031.c b/hw/rtc/pl031.c
index 60167c778f..b01d0e75d1 100644
--- a/hw/rtc/pl031.c
+++ b/hw/rtc/pl031.c
@@ -138,12 +138,13 @@ static void pl031_write(void * opaque, hwaddr offset,
 
     switch (offset) {
     case RTC_LR: {
+        g_autofree const char *qom_path = object_get_canonical_path(opaque);
         struct tm tm;
 
         s->tick_offset += value - pl031_get_count(s);
 
         qemu_get_timedate(&tm, s->tick_offset);
-        qapi_event_send_rtc_change(qemu_timedate_diff(&tm));
+        qapi_event_send_rtc_change(qemu_timedate_diff(&tm), qom_path);
 
         pl031_set_alarm(s);
         break;
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PULL 9/9] qapi: Belatedly adjust limitations documentation
  2022-02-28 11:26 [PULL 0/9] QAPI patches patches for 2022-02-28 Markus Armbruster
                   ` (7 preceding siblings ...)
  2022-02-28 11:26 ` [PULL 8/9] rtc: Have event RTC_CHANGE identify the RTC by QOM path Markus Armbruster
@ 2022-02-28 11:26 ` Markus Armbruster
  2022-03-01 13:25 ` [PULL 0/9] QAPI patches patches for 2022-02-28 Peter Maydell
  9 siblings, 0 replies; 11+ messages in thread
From: Markus Armbruster @ 2022-02-28 11:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, Eric Blake, Philippe Mathieu-Daudé

Commit 57df0dff1a "qapi: Extend -compat to set policy for unstable
interfaces" (v6.2.0) took care of covering experimental features, but
neglected to adjust a comment suggesting to cover it.  Adjust it now.

Fixes: 57df0dff1a1f4c846aa74a082bfd595a8a990015
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20220225084538.218876-1-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 qapi/compat.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qapi/compat.json b/qapi/compat.json
index c53b69fe3f..39b52872d5 100644
--- a/qapi/compat.json
+++ b/qapi/compat.json
@@ -41,7 +41,7 @@
 #
 # Limitation: covers only syntactic aspects of QMP, i.e. stuff tagged
 # with feature 'deprecated'.  We may want to extend it to cover
-# semantic aspects, CLI, and experimental features.
+# semantic aspects and CLI.
 #
 # Limitation: deprecated-output policy @hide is not implemented for
 # enumeration values.  They behave the same as with policy @accept.
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PULL 0/9] QAPI patches patches for 2022-02-28
  2022-02-28 11:26 [PULL 0/9] QAPI patches patches for 2022-02-28 Markus Armbruster
                   ` (8 preceding siblings ...)
  2022-02-28 11:26 ` [PULL 9/9] qapi: Belatedly adjust limitations documentation Markus Armbruster
@ 2022-03-01 13:25 ` Peter Maydell
  9 siblings, 0 replies; 11+ messages in thread
From: Peter Maydell @ 2022-03-01 13:25 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel

On Mon, 28 Feb 2022 at 11:26, Markus Armbruster <armbru@redhat.com> wrote:
>
> The following changes since commit fa435db8ce1dff3b15e3f59a12f55f7b3a347b08:
>
>   Merge remote-tracking branch 'remotes/jsnow-gitlab/tags/python-pull-request' into staging (2022-02-24 12:48:14 +0000)
>
> are available in the Git repository at:
>
>   git://repo.or.cz/qemu/armbru.git tags/pull-qapi-2022-02-28
>
> for you to fetch changes up to 1428502c8c0c0cfbb04212558144fef970042cf3:
>
>   qapi: Belatedly adjust limitations documentation (2022-02-28 11:39:35 +0100)
>
> ----------------------------------------------------------------
> QAPI patches patches for 2022-02-28
>


Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/7.0
for any user-visible changes.

-- PMM


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-03-01 13:27 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-28 11:26 [PULL 0/9] QAPI patches patches for 2022-02-28 Markus Armbruster
2022-02-28 11:26 ` [PULL 1/9] scripts/qapi: minor delinting Markus Armbruster
2022-02-28 11:26 ` [PULL 2/9] keyval: Fix grammar comment to cover downstream prefix Markus Armbruster
2022-02-28 11:26 ` [PULL 3/9] qapi: Fix stale reference to scripts/qapi.py in a comment Markus Armbruster
2022-02-28 11:26 ` [PULL 4/9] qapi/migration: Fix examples document wrong field name for arguments Markus Armbruster
2022-02-28 11:26 ` [PULL 5/9] qapi: Move RTC_CHANGE back out of target schema Markus Armbruster
2022-02-28 11:26 ` [PULL 6/9] qapi: Document some missing details of RTC_CHANGE event Markus Armbruster
2022-02-28 11:26 ` [PULL 7/9] hw/rtc: Compile pl031 once-only Markus Armbruster
2022-02-28 11:26 ` [PULL 8/9] rtc: Have event RTC_CHANGE identify the RTC by QOM path Markus Armbruster
2022-02-28 11:26 ` [PULL 9/9] qapi: Belatedly adjust limitations documentation Markus Armbruster
2022-03-01 13:25 ` [PULL 0/9] QAPI patches patches for 2022-02-28 Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).