Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2019-10-2…
Browse files Browse the repository at this point in the history
…2-v3' into staging

QAPI patches for 2019-10-22

# gpg: Signature made Tue 22 Oct 2019 15:56:36 BST
# 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-2019-10-22-v3:
  qapi: Allow introspecting fix for savevm's cooperation with blockdev
  tests/qapi-schema: Cover feature documentation comments
  tests: qapi: Test 'features' of commands
  qapi: Add feature flags to commands
  tests/qapi-schema: Tidy up test output indentation
  qapi: Clear scripts/qapi/doc.py executable bits again
  qapi: Split up scripts/qapi/common.py
  qapi: Move gen_enum(), gen_enum_lookup() back to qapi/types.py
  qapi: Speed up frontend tests
  qapi: Eliminate accidental global frontend state
  qapi: Store pragma state in QAPISourceInfo, not global state
  qapi: Don't suppress doc generation without pragma doc-required

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
pm215 committed Oct 23, 2019
2 parents ec97eb6 + 5f76a7a commit 69717d0
Show file tree
Hide file tree
Showing 390 changed files with 3,116 additions and 2,961 deletions.
13 changes: 10 additions & 3 deletions Makefile
Expand Up @@ -582,13 +582,20 @@ qemu-ga$(EXESUF): QEMU_CFLAGS += -I qga/qapi-generated
qemu-keymap$(EXESUF): LIBS += $(XKBCOMMON_LIBS)
qemu-keymap$(EXESUF): QEMU_CFLAGS += $(XKBCOMMON_CFLAGS)

qapi-py = $(SRC_PATH)/scripts/qapi/commands.py \
qapi-py = $(SRC_PATH)/scripts/qapi/__init__.py \
$(SRC_PATH)/scripts/qapi/commands.py \
$(SRC_PATH)/scripts/qapi/common.py \
$(SRC_PATH)/scripts/qapi/doc.py \
$(SRC_PATH)/scripts/qapi/error.py \
$(SRC_PATH)/scripts/qapi/events.py \
$(SRC_PATH)/scripts/qapi/expr.py \
$(SRC_PATH)/scripts/qapi/gen.py \
$(SRC_PATH)/scripts/qapi/introspect.py \
$(SRC_PATH)/scripts/qapi/parser.py \
$(SRC_PATH)/scripts/qapi/schema.py \
$(SRC_PATH)/scripts/qapi/source.py \
$(SRC_PATH)/scripts/qapi/types.py \
$(SRC_PATH)/scripts/qapi/visit.py \
$(SRC_PATH)/scripts/qapi/common.py \
$(SRC_PATH)/scripts/qapi/doc.py \
$(SRC_PATH)/scripts/qapi-gen.py

qga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h \
Expand Down
10 changes: 6 additions & 4 deletions docs/devel/qapi-code-gen.txt
Expand Up @@ -457,7 +457,8 @@ Syntax:
'*gen': false,
'*allow-oob': true,
'*allow-preconfig': true,
'*if': COND }
'*if': COND,
'*features': FEATURES }

Member 'command' names the command.

Expand Down Expand Up @@ -640,9 +641,10 @@ change in the QMP syntax (usually by allowing values or operations
that previously resulted in an error). QMP clients may still need to
know whether the extension is available.

For this purpose, a list of features can be specified for a struct type.
This is exposed to the client as a list of string, where each string
signals that this build of QEMU shows a certain behaviour.
For this purpose, a list of features can be specified for a command or
struct type. This is exposed to the client as a list of strings,
where each string signals that this build of QEMU shows a certain
behaviour.

Each member of the 'features' array defines a feature. It can either
be { 'name': STRING, '*if': COND }, or STRING, which is shorthand for
Expand Down
6 changes: 5 additions & 1 deletion qapi/introspect.json
Expand Up @@ -266,13 +266,17 @@
# @allow-oob: whether the command allows out-of-band execution,
# defaults to false (Since: 2.12)
#
# @features: names of features associated with the command, in no particular
# order. (since 4.2)
#
# TODO: @success-response (currently irrelevant, because it's QGA, not QMP)
#
# Since: 2.5
##
{ 'struct': 'SchemaInfoCommand',
'data': { 'arg-type': 'str', 'ret-type': 'str',
'*allow-oob': 'bool' } }
'*allow-oob': 'bool',
'*features': [ 'str' ] } }

##
# @SchemaInfoEvent:
Expand Down
9 changes: 8 additions & 1 deletion qapi/misc.json
Expand Up @@ -1020,6 +1020,12 @@
#
# @cpu-index: The CPU to use for commands that require an implicit CPU
#
# Features:
# @savevm-monitor-nodes: If present, HMP command savevm only snapshots
# monitor-owned nodes if they have no parents.
# This allows the use of 'savevm' with
# -blockdev. (since 4.2)
#
# Returns: the output of the command as a string
#
# Since: 0.14.0
Expand Down Expand Up @@ -1047,7 +1053,8 @@
##
{ 'command': 'human-monitor-command',
'data': {'command-line': 'str', '*cpu-index': 'int'},
'returns': 'str' }
'returns': 'str',
'features': [ 'savevm-monitor-nodes' ] }

##
# @change:
Expand Down
10 changes: 6 additions & 4 deletions scripts/qapi-gen.py
Expand Up @@ -5,16 +5,18 @@
# See the COPYING file in the top-level directory.

from __future__ import print_function

import argparse
import re
import sys
from qapi.common import QAPIError, QAPISchema
from qapi.types import gen_types
from qapi.visit import gen_visit

from qapi.commands import gen_commands
from qapi.doc import gen_doc
from qapi.events import gen_events
from qapi.introspect import gen_introspect
from qapi.doc import gen_doc
from qapi.schema import QAPIError, QAPISchema
from qapi.types import gen_types
from qapi.visit import gen_visit


def main(argv):
Expand Down
4 changes: 3 additions & 1 deletion scripts/qapi/commands.py
Expand Up @@ -14,6 +14,7 @@
"""

from qapi.common import *
from qapi.gen import QAPIGenCCode, QAPISchemaModularCVisitor, ifcontext


def gen_command_decl(name, arg_type, boxed, ret_type):
Expand Down Expand Up @@ -276,7 +277,8 @@ def visit_end(self):
genc.add(gen_registry(self._regy.get_content(), self._prefix))

def visit_command(self, name, info, ifcond, arg_type, ret_type, gen,
success_response, boxed, allow_oob, allow_preconfig):
success_response, boxed, allow_oob, allow_preconfig,
features):
if not gen:
return
# FIXME: If T is a user-defined type, the user is responsible
Expand Down

0 comments on commit 69717d0

Please sign in to comment.