QAPI patches patches for 2022-02-28

-----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEENUvIs9frKmtoZ05fOHC0AOuRhlMFAmIcppYSHGFybWJydUBy
 ZWRoYXQuY29tAAoJEDhwtADrkYZTiQ4QALqUVA/STVXuHBmFcjYy2jn82XSkhsFl
 lVUFSf4OinE/Z189A8PgRzFtTt386auB5uxQff3Y4FldJupUFt32gWe+Fgi0RnsN
 +MTQbxgUzzF+ULkLxYSZxy/t6FRUstMcvVUbjR2beE4JMKaFDxCF05F2Ty12r2MW
 tbclpY6RoiljXwYoPtcg0UdTNH0QT1Jh17hEDo1Z9rmoe/kZsruSY1ecmPqM6k+w
 wAILGtveeF031Q2yLluJdx77Ysmh0kKmujZ06U80TbS86EfWrUKq/15A/YG3O7ig
 oUNO0w4BiL/AlJ//wMz3b0/t+cMvE4mDw/7jubsyCd5M9W38NNF5T141yIqb6lZr
 1bPhGlEAYNccwdqXS8Brnjz9p/ONJ4VhUNDAXxW1yl76DlLbW+lzVXsHyGvHbGsm
 9Sewkm/VMmGfc/TToPOCfIqRD2mKWleoOPfhP3pJVx1XItBOd3lR0ho6N2hA04aw
 lhmjSBJ0TT9yy/xBVF00eVL3Dcv37byv49Qk2ya1NEby46rFDxAzIb8zhrBBh1lH
 jXlIRttjvzZ+I3PkaVDWB4qZvjo5mJk/Of6tljtxX7p84B1czQS++AXQhldTE6C2
 aJCW+skrb1ioI+2kXGgSM4a9fGLJxm5+VVHjpgrszZsQUoqomw98VCIRDJgIax5U
 3XkyBvAr+KR1
 =A/bA
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2022-02-28' into staging

QAPI patches patches for 2022-02-28

# gpg: Signature made Mon 28 Feb 2022 10:40:22 GMT
# gpg:                using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
# gpg:                issuer "armbru@redhat.com"
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full]
# gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>" [full]
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653

* remotes/armbru/tags/pull-qapi-2022-02-28:
  qapi: Belatedly adjust limitations documentation
  rtc: Have event RTC_CHANGE identify the RTC by QOM path
  hw/rtc: Compile pl031 once-only
  qapi: Document some missing details of RTC_CHANGE event
  qapi: Move RTC_CHANGE back out of target schema
  qapi/migration: Fix examples document wrong field name for arguments
  qapi: Fix stale reference to scripts/qapi.py in a comment
  keyval: Fix grammar comment to cover downstream prefix
  scripts/qapi: minor delinting

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2022-03-01 10:43:35 +00:00
commit 648c15e4ec
14 changed files with 64 additions and 61 deletions

View File

@ -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"
@ -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);

View File

@ -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"
@ -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)

View File

@ -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'))

View File

@ -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 */
@ -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;

View File

@ -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.

View File

@ -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"]

View File

@ -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:
#

View File

@ -527,3 +527,29 @@
'data': { '*option': 'str' },
'returns': ['CommandLineOptionInfo'],
'allow-preconfig': true }
##
# @RTC_CHANGE:
#
# Emitted when the guest changes the RTC time.
#
# @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.
#
# Since: 0.13
#
# Example:
#
# <- { "event": "RTC_CHANGE",
# "data": { "offset": 78 },
# "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
#
##
{ 'event': 'RTC_CHANGE',
'data': { 'offset': 'int', 'qom-path': 'str' } }

View File

@ -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.
*/

View File

@ -25,8 +25,8 @@ from .gen import (
QAPIGenC,
QAPISchemaModularCVisitor,
build_params,
ifcontext,
gen_special_features,
ifcontext,
)
from .schema import (
QAPISchema,

View File

@ -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]

View File

@ -16,7 +16,11 @@ This work is licensed under the terms of the GNU GPL, version 2.
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,

View File

@ -21,7 +21,11 @@ from .common import (
indent,
mcgen,
)
from .gen import QAPISchemaModularCVisitor, gen_special_features, ifcontext
from .gen import (
QAPISchemaModularCVisitor,
gen_special_features,
ifcontext,
)
from .schema import (
QAPISchema,
QAPISchemaEnumMember,

View File

@ -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' | '?'
*