Merge tag 'pull-qapi-2023-10-19' of https://repo.or.cz/qemu/armbru into 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>
diff --git a/qapi/compat.json b/qapi/compat.json
index f4c1983..42034d9 100644
--- a/qapi/compat.json
+++ b/qapi/compat.json
@@ -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.
diff --git a/scripts/qapi/gen.py b/scripts/qapi/gen.py
index bf5716b..5412716 100644
--- a/scripts/qapi/gen.py
+++ b/scripts/qapi/gen.py
@@ -13,8 +13,8 @@
 
 from contextlib import contextmanager
 import os
-import sys
 import re
+import sys
 from typing import (
     Dict,
     Iterator,
diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
index 22e7bcc..bf31018 100644
--- a/scripts/qapi/parser.py
+++ b/scripts/qapi/parser.py
@@ -22,6 +22,7 @@
     Dict,
     List,
     Mapping,
+    Match,
     Optional,
     Set,
     Union,
@@ -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:
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index 231ebf6..d739e55 100644
--- a/scripts/qapi/schema.py
+++ b/scripts/qapi/schema.py
@@ -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)