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

qapi: Document flaws in checking of names

We don't actually enforce our "other than downstream extensions [...],
all names should begin with a letter" rule. Add a FIXME.

We should reject names that differ only in '_' vs. '.' vs. '-',
because they're liable to clash in generated C. Add a FIXME.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>

+4
+4
scripts/qapi.py
··· 341 341 342 342 return find_enum(discriminator_type) 343 343 344 + # FIXME should enforce "other than downstream extensions [...], all 345 + # names should begin with a letter". 344 346 valid_name = re.compile('^[a-zA-Z_][a-zA-Z0-9_.-]*$') 345 347 def check_name(expr_info, source, name, allow_optional = False, 346 348 enum_member = False): ··· 367 369 def add_name(name, info, meta, implicit = False): 368 370 global all_names 369 371 check_name(info, "'%s'" % meta, name) 372 + # FIXME should reject names that differ only in '_' vs. '.' 373 + # vs. '-', because they're liable to clash in generated C. 370 374 if name in all_names: 371 375 raise QAPIExprError(info, 372 376 "%s '%s' is already defined"