From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53274) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWmmh-0006Pa-1U for qemu-devel@nongnu.org; Tue, 01 Sep 2015 10:43:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZWmme-0008Qw-8o for qemu-devel@nongnu.org; Tue, 01 Sep 2015 10:43:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45281) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWmme-0008Qs-1b for qemu-devel@nongnu.org; Tue, 01 Sep 2015 10:43:36 -0400 Date: Tue, 1 Sep 2015 16:43:32 +0200 From: Kevin Wolf Message-ID: <20150901144332.GG4304@noname.redhat.com> References: <87fv36j9j6.fsf@blackfin.pond.sub.org> <20150826172550.GJ11016@localhost.localdomain> <20150826180815.GK11016@localhost.localdomain> <20150826220151.GA2669@localhost.localdomain> <2CB0CE30-A638-4933-A1D6-F65CA4910E61@gmail.com> <20150827123234.GB2669@localhost.localdomain> <20150901123425.GE4304@noname.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] Should we auto-generate IDs? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Programmingkid Cc: Jeff Cody , Markus Armbruster , qemu-devel qemu-devel , Paolo Bonzini , jsnow@redhat.com, Andreas =?iso-8859-1?Q?F=E4rber?= Am 01.09.2015 um 16:18 hat Programmingkid geschrieben: > > On Sep 1, 2015, at 8:34 AM, Kevin Wolf wrote: > > > Am 27.08.2015 um 14:32 hat Jeff Cody geschrieben: > >> I'm not married to the ID generation scheme I proposed. > >> > >> What I am trying to do, however, is have a technical discussion on > >> generating an ID in a well-formed manner. And hopefully, in a way > >> that is useful to all interested subsystems, if possible. > >> > >> Do you disagree with the requirements I listed above? If so, it would > >> be useful to begin the discussion around that. For ease of > >> discussion, I'll list them again: > >> > >> * Reserved namespaces > >> * Uniqueness > >> * Non-predictable (to avoid inadvertently creating a de facto ABI) > >> > >> > >> . . . > >> > >> On the generation scheme proposed above: > >> > >> I understand that something you desire is an ID that is easier to > >> type. > >> > >> If we wanted to make it shorter, perhaps we could have the number > >> counter be variable length: > >> > >> qemu#ss#D#XY > >> | | | | > >> qemu reserved - | | | > >> | | | > >> subsystem name ---| | | > >> | | > >> counter --------| | > >> | > >> 2-digit random ---| > > > > Even with keeping all of the information in there we can shorten the ID > > a bit more: # at the start is enough to mark it as autogenerated, the > > subsystem seems nice to have in there anyway, and the # separators can > > be removed without making the ID less unique (assuming that subsystems > > never end in a digit). This results in an ID that looks like a three (or > > more) digit number for the subsystem, where the last two digits are > > random, like this: > > > > #block150 > > #block219 > > #block344 > > ... > > > > That seems easy to type and still fulfills all of the criteria. > > > > Kevin > > I do know that some really want an indicator that shows that an ID is auto-generated. But we could still do this and keep the ID short. What if the auto-generated ID just started with a character the user could never use at the beginning of the ID. I suggest we use an underscore to indicate machine-generated ID's. Something like this _1. It is very simple and effective. That's what I already did. # is a reserved character. I don't think something like #block150 is unreasonably long, it's a bit more descriptive than _1, and it fulfills all of Jeff's criteria, which _1 clearly doesn't. Kevin