Skip to content

Commit

Permalink
Merge tag 'pull-qapi-2023-10-19' of https://repo.or.cz/qemu/armbru in…
Browse files Browse the repository at this point in the history
…to staging

QAPI patches patches for 2023-10-19

# -----BEGIN PGP SIGNATURE-----
#
# iQJGBAABCAAwFiEENUvIs9frKmtoZ05fOHC0AOuRhlMFAmUxNoISHGFybWJydUBy
# ZWRoYXQuY29tAAoJEDhwtADrkYZTZ6EP+wdGaoxiodAAOxRWQVAt0mViFGNclRmD
# 8vHNpTfJMdimPOjN+3yd6IQgyrrR6ocr5aDa71GH/eKU4sitaN1DB5cqB7nPaB57
# 7pIY3fTR3GeTM8M3SyGvqIVs7C5slDb+RAMMraajoj7MdfSWRsiHKgRslFnIvG3y
# g9Y40vxqell8YRGuduxd+QcoHDOXVzJCcZ8BXu2tFYbkFet35XEtG/47Xqe9+ah9
# uav4KOGt6dAb2Zp1i7m0Fxdydmvgi3UfYMfDXm2jWLc7dlaSJnOvGfrDFpvxn09b
# t9qaVo7BXHN9BdgZN/JC/tbwd7SUC5Zf6KjuV/+BzV6M60hAulrF5Ig3Ot+1+4SE
# UV3Xk/OWyzUv2Z6u/DHiMuUUIBlX2/Coug75smXTH1Z3kOXvGgeQ7XZQJbIH9tZu
# R+3maW4yDoPm5Y9GS61v+PtY3696DS3SBKYz+FuYFFfKBiq1L1Z3kNPh00x7WFxy
# s5BNJ3shD20aV4Psw0bYFgvI/uL6rAbGvbtX24AWehYxLCw2MeBFoDsLFw4hTX2J
# Q3F4SRkUF03lZK8NIcg6glb2IKMxn6+XtziNsGD1uLG8p85y3CyFtC4rf+TAQGtK
# aLADaAYluoSoOC+Gv5oJJeCwMXpFnsKnA2aYZIVxRbwaj25PK3vg7WxyJpSgqW10
# AKpBhmiNJKtK
# =KDfs
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 19 Oct 2023 07:00:34 PDT
# 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

* tag 'pull-qapi-2023-10-19' of https://repo.or.cz/qemu/armbru:
  qapi: provide a friendly string representation of QAPI classes
  qapi: Belatedly update CompatPolicy documentation for unstable
  qapi: re-establish linting baseline

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
  • Loading branch information
stefanhaRH committed Oct 20, 2023
2 parents 1712520 + e307a81 commit fc00b60
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions qapi/compat.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
# This is intended for testing users of the management interfaces.
#
# Limitation: covers only syntactic aspects of QMP, i.e. stuff tagged
# with feature 'deprecated'. We may want to extend it to cover
# semantic aspects and CLI.
# with feature 'deprecated' or 'unstable'. We may want to extend it
# to cover semantic aspects and CLI.
#
# Limitation: deprecated-output policy @hide is not implemented for
# enumeration values. They behave the same as with policy @accept.
Expand Down
2 changes: 1 addition & 1 deletion scripts/qapi/gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

from contextlib import contextmanager
import os
import sys
import re
import sys
from typing import (
Dict,
Iterator,
Expand Down
5 changes: 3 additions & 2 deletions scripts/qapi/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
Dict,
List,
Mapping,
Match,
Optional,
Set,
Union,
Expand Down Expand Up @@ -563,11 +564,11 @@ def end_comment(self) -> None:
self._switch_section(QAPIDoc.NullSection(self._parser))

@staticmethod
def _match_at_name_colon(string: str):
def _match_at_name_colon(string: str) -> Optional[Match[str]]:
return re.match(r'@([^:]*): *', string)

@staticmethod
def _match_section_tag(string: str):
def _match_section_tag(string: str) -> Optional[Match[str]]:
return re.match(r'(Returns|Since|Notes?|Examples?|TODO): *', string)

def _append_body_line(self, line: str) -> None:
Expand Down
5 changes: 5 additions & 0 deletions scripts/qapi/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ def __init__(self, name: str, info, doc, ifcond=None, features=None):
self.features = features or []
self._checked = False

def __repr__(self):
if self.name is None:
return "<%s at 0x%x>" % (type(self).__name__, id(self))
return "<%s:%s at 0x%x>" % type(self).__name__, self.name, id(self)

def c_name(self):
return c_name(self.name)

Expand Down

0 comments on commit fc00b60

Please sign in to comment.