Markus Armbruster <arm...@redhat.com> writes: > Thomas Huth <th...@redhat.com> writes: > >> On 23/05/2023 14.31, Markus Armbruster wrote: >> ... >>> To stop creating more moles, we need to reserve IDs for the system's >>> use, and let the system pick only reserved IDs going forward. >> >> Just something to add here: We already have a function for generating >> internal IDs, the id_generate() function in util/id.c ... our
id_generate() generates IDs of the form #<subsystem><number>, where <number> counts up. Suitable for IDs that are not part of the stable interface. When a system-picked ID needs to be part of the stable interface, we pick it in some other way. >> convention is that we use "#" as prefix for those, so for new code >> (which is not affected by migration backward compatibility problems), >> we should maybe take care of always using that prefix for internal >> IDs, too. > > Valid point. I propose to move towards the QAPI naming rules for user-picked IDs: must begin with a letter, and contain only ASCII letters, digits, hyphen, and underscore.