qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

qapi: Use super() now we have Python 3

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200304155932.20452-4-armbru@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>

+43 -44
+2 -2
scripts/qapi/commands.py
··· 237 237 class QAPISchemaGenCommandVisitor(QAPISchemaModularCVisitor): 238 238 239 239 def __init__(self, prefix): 240 - QAPISchemaModularCVisitor.__init__( 241 - self, prefix, 'qapi-commands', 240 + super().__init__( 241 + prefix, 'qapi-commands', 242 242 ' * Schema-defined QAPI/QMP commands', None, __doc__) 243 243 self._regy = QAPIGenCCode(None) 244 244 self._visited_ret_types = {}
+2 -2
scripts/qapi/error.py
··· 35 35 col = (col + 7) % 8 + 1 36 36 else: 37 37 col += 1 38 - QAPIError.__init__(self, parser.info, col, msg) 38 + super().__init__(parser.info, col, msg) 39 39 40 40 41 41 class QAPISemError(QAPIError): 42 42 def __init__(self, info, msg): 43 - QAPIError.__init__(self, info, None, msg) 43 + super().__init__(info, None, msg)
+2 -2
scripts/qapi/events.py
··· 138 138 class QAPISchemaGenEventVisitor(QAPISchemaModularCVisitor): 139 139 140 140 def __init__(self, prefix): 141 - QAPISchemaModularCVisitor.__init__( 142 - self, prefix, 'qapi-events', 141 + super().__init__( 142 + prefix, 'qapi-events', 143 143 ' * Schema-defined QAPI/QMP events', None, __doc__) 144 144 self._event_enum_name = c_name(prefix + 'QAPIEvent', protect=False) 145 145 self._event_enum_members = []
+5 -5
scripts/qapi/gen.py
··· 82 82 class QAPIGenCCode(QAPIGen): 83 83 84 84 def __init__(self, fname): 85 - QAPIGen.__init__(self, fname) 85 + super().__init__(fname) 86 86 self._start_if = None 87 87 88 88 def start_if(self, ifcond): ··· 102 102 103 103 def get_content(self): 104 104 assert self._start_if is None 105 - return QAPIGen.get_content(self) 105 + return super().get_content() 106 106 107 107 108 108 class QAPIGenC(QAPIGenCCode): 109 109 110 110 def __init__(self, fname, blurb, pydoc): 111 - QAPIGenCCode.__init__(self, fname) 111 + super().__init__(fname) 112 112 self._blurb = blurb 113 113 self._copyright = '\n * '.join(re.findall(r'^Copyright .*', pydoc, 114 114 re.MULTILINE)) ··· 141 141 class QAPIGenH(QAPIGenC): 142 142 143 143 def _top(self): 144 - return QAPIGenC._top(self) + guardstart(self.fname) 144 + return super()._top() + guardstart(self.fname) 145 145 146 146 def _bottom(self): 147 147 return guardend(self.fname) ··· 176 176 class QAPIGenDoc(QAPIGen): 177 177 178 178 def _top(self): 179 - return (QAPIGen._top(self) 179 + return (super()._top() 180 180 + '@c AUTOMATICALLY GENERATED, DO NOT MODIFY\n\n') 181 181 182 182
+2 -2
scripts/qapi/introspect.py
··· 76 76 class QAPISchemaGenIntrospectVisitor(QAPISchemaMonolithicCVisitor): 77 77 78 78 def __init__(self, prefix, unmask): 79 - QAPISchemaMonolithicCVisitor.__init__( 80 - self, prefix, 'qapi-introspect', 79 + super().__init__( 80 + prefix, 'qapi-introspect', 81 81 ' * QAPI/QMP schema introspection', __doc__) 82 82 self._unmask = unmask 83 83 self._schema = None
+1 -1
scripts/qapi/parser.py
··· 320 320 321 321 class ArgSection(Section): 322 322 def __init__(self, name): 323 - QAPIDoc.Section.__init__(self, name) 323 + super().__init__(name) 324 324 self.member = None 325 325 326 326 def connect(self, member):
+25 -26
scripts/qapi/schema.py
··· 152 152 153 153 class QAPISchemaInclude(QAPISchemaEntity): 154 154 def __init__(self, sub_module, info): 155 - QAPISchemaEntity.__init__(self, None, info, None) 155 + super().__init__(None, info, None) 156 156 self._sub_module = sub_module 157 157 158 158 def visit(self, visitor): 159 - QAPISchemaEntity.visit(self, visitor) 159 + super().visit(visitor) 160 160 visitor.visit_include(self._sub_module.name, self.info) 161 161 162 162 ··· 202 202 meta = 'built-in' 203 203 204 204 def __init__(self, name, json_type, c_type): 205 - QAPISchemaType.__init__(self, name, None, None) 205 + super().__init__(name, None, None) 206 206 assert not c_type or isinstance(c_type, str) 207 207 assert json_type in ('string', 'number', 'int', 'boolean', 'null', 208 208 'value') ··· 227 227 return self.json_type() 228 228 229 229 def visit(self, visitor): 230 - QAPISchemaType.visit(self, visitor) 230 + super().visit(visitor) 231 231 visitor.visit_builtin_type(self.name, self.info, self.json_type()) 232 232 233 233 ··· 235 235 meta = 'enum' 236 236 237 237 def __init__(self, name, info, doc, ifcond, members, prefix): 238 - QAPISchemaType.__init__(self, name, info, doc, ifcond) 238 + super().__init__(name, info, doc, ifcond) 239 239 for m in members: 240 240 assert isinstance(m, QAPISchemaEnumMember) 241 241 m.set_defined_in(name) ··· 244 244 self.prefix = prefix 245 245 246 246 def check(self, schema): 247 - QAPISchemaType.check(self, schema) 247 + super().check(schema) 248 248 seen = {} 249 249 for m in self.members: 250 250 m.check_clash(self.info, seen) ··· 269 269 return 'string' 270 270 271 271 def visit(self, visitor): 272 - QAPISchemaType.visit(self, visitor) 272 + super().visit(visitor) 273 273 visitor.visit_enum_type(self.name, self.info, self.ifcond, 274 274 self.members, self.prefix) 275 275 ··· 278 278 meta = 'array' 279 279 280 280 def __init__(self, name, info, element_type): 281 - QAPISchemaType.__init__(self, name, info, None, None) 281 + super().__init__(name, info, None, None) 282 282 assert isinstance(element_type, str) 283 283 self._element_type_name = element_type 284 284 self.element_type = None 285 285 286 286 def check(self, schema): 287 - QAPISchemaType.check(self, schema) 287 + super().check(schema) 288 288 self.element_type = schema.resolve_type( 289 289 self._element_type_name, self.info, 290 290 self.info and self.info.defn_meta) ··· 314 314 return 'array of ' + elt_doc_type 315 315 316 316 def visit(self, visitor): 317 - QAPISchemaType.visit(self, visitor) 317 + super().visit(visitor) 318 318 visitor.visit_array_type(self.name, self.info, self.ifcond, 319 319 self.element_type) 320 320 ··· 329 329 # struct has local_members, optional base, and no variants 330 330 # flat union has base, variants, and no local_members 331 331 # simple union has local_members, variants, and no base 332 - QAPISchemaType.__init__(self, name, info, doc, ifcond, features) 332 + super().__init__(name, info, doc, ifcond, features) 333 333 self.meta = 'union' if variants else 'struct' 334 334 assert base is None or isinstance(base, str) 335 335 for m in local_members: ··· 356 356 raise QAPISemError(self.info, 357 357 "object %s contains itself" % self.name) 358 358 359 - QAPISchemaType.check(self, schema) 359 + super().check(schema) 360 360 assert self._checked and self.members is None 361 361 362 362 seen = OrderedDict() ··· 419 419 420 420 def c_name(self): 421 421 assert self.name != 'q_empty' 422 - return QAPISchemaType.c_name(self) 422 + return super().c_name() 423 423 424 424 def c_type(self): 425 425 assert not self.is_implicit() ··· 432 432 return 'object' 433 433 434 434 def visit(self, visitor): 435 - QAPISchemaType.visit(self, visitor) 435 + super().visit(visitor) 436 436 visitor.visit_object_type(self.name, self.info, self.ifcond, 437 437 self.base, self.local_members, self.variants, 438 438 self.features) ··· 506 506 507 507 class QAPISchemaObjectTypeMember(QAPISchemaMember): 508 508 def __init__(self, name, info, typ, optional, ifcond=None): 509 - QAPISchemaMember.__init__(self, name, info, ifcond) 509 + super().__init__(name, info, ifcond) 510 510 assert isinstance(typ, str) 511 511 assert isinstance(optional, bool) 512 512 self._type_name = typ ··· 614 614 role = 'branch' 615 615 616 616 def __init__(self, name, info, typ, ifcond=None): 617 - QAPISchemaObjectTypeMember.__init__(self, name, info, typ, 618 - False, ifcond) 617 + super().__init__(name, info, typ, False, ifcond) 619 618 620 619 621 620 class QAPISchemaAlternateType(QAPISchemaType): 622 621 meta = 'alternate' 623 622 624 623 def __init__(self, name, info, doc, ifcond, variants): 625 - QAPISchemaType.__init__(self, name, info, doc, ifcond) 624 + super().__init__(name, info, doc, ifcond) 626 625 assert isinstance(variants, QAPISchemaObjectTypeVariants) 627 626 assert variants.tag_member 628 627 variants.set_defined_in(name) ··· 630 629 self.variants = variants 631 630 632 631 def check(self, schema): 633 - QAPISchemaType.check(self, schema) 632 + super().check(schema) 634 633 self.variants.tag_member.check(schema) 635 634 # Not calling self.variants.check_clash(), because there's nothing 636 635 # to clash with ··· 680 679 return 'value' 681 680 682 681 def visit(self, visitor): 683 - QAPISchemaType.visit(self, visitor) 682 + super().visit(visitor) 684 683 visitor.visit_alternate_type(self.name, self.info, self.ifcond, 685 684 self.variants) 686 685 ··· 691 690 def __init__(self, name, info, doc, ifcond, arg_type, ret_type, 692 691 gen, success_response, boxed, allow_oob, allow_preconfig, 693 692 features): 694 - QAPISchemaEntity.__init__(self, name, info, doc, ifcond, features) 693 + super().__init__(name, info, doc, ifcond, features) 695 694 assert not arg_type or isinstance(arg_type, str) 696 695 assert not ret_type or isinstance(ret_type, str) 697 696 self._arg_type_name = arg_type ··· 705 704 self.allow_preconfig = allow_preconfig 706 705 707 706 def check(self, schema): 708 - QAPISchemaEntity.check(self, schema) 707 + super().check(schema) 709 708 if self._arg_type_name: 710 709 self.arg_type = schema.resolve_type( 711 710 self._arg_type_name, self.info, "command's 'data'") ··· 740 739 self.arg_type.connect_doc(doc) 741 740 742 741 def visit(self, visitor): 743 - QAPISchemaEntity.visit(self, visitor) 742 + super().visit(visitor) 744 743 visitor.visit_command(self.name, self.info, self.ifcond, 745 744 self.arg_type, self.ret_type, 746 745 self.gen, self.success_response, ··· 753 752 meta = 'event' 754 753 755 754 def __init__(self, name, info, doc, ifcond, arg_type, boxed): 756 - QAPISchemaEntity.__init__(self, name, info, doc, ifcond) 755 + super().__init__(name, info, doc, ifcond) 757 756 assert not arg_type or isinstance(arg_type, str) 758 757 self._arg_type_name = arg_type 759 758 self.arg_type = None 760 759 self.boxed = boxed 761 760 762 761 def check(self, schema): 763 - QAPISchemaEntity.check(self, schema) 762 + super().check(schema) 764 763 if self._arg_type_name: 765 764 self.arg_type = schema.resolve_type( 766 765 self._arg_type_name, self.info, "event's 'data'") ··· 782 781 self.arg_type.connect_doc(doc) 783 782 784 783 def visit(self, visitor): 785 - QAPISchemaEntity.visit(self, visitor) 784 + super().visit(visitor) 786 785 visitor.visit_event(self.name, self.info, self.ifcond, 787 786 self.arg_type, self.boxed) 788 787
+2 -2
scripts/qapi/types.py
··· 241 241 class QAPISchemaGenTypeVisitor(QAPISchemaModularCVisitor): 242 242 243 243 def __init__(self, prefix): 244 - QAPISchemaModularCVisitor.__init__( 245 - self, prefix, 'qapi-types', ' * Schema-defined QAPI types', 244 + super().__init__( 245 + prefix, 'qapi-types', ' * Schema-defined QAPI types', 246 246 ' * Built-in QAPI types', __doc__) 247 247 248 248 def _begin_system_module(self, name):
+2 -2
scripts/qapi/visit.py
··· 283 283 class QAPISchemaGenVisitVisitor(QAPISchemaModularCVisitor): 284 284 285 285 def __init__(self, prefix): 286 - QAPISchemaModularCVisitor.__init__( 287 - self, prefix, 'qapi-visit', ' * Schema-defined QAPI visitors', 286 + super().__init__( 287 + prefix, 'qapi-visit', ' * Schema-defined QAPI visitors', 288 288 ' * Built-in QAPI visitors', __doc__) 289 289 290 290 def _begin_system_module(self, name):