Received: from eggs.gnu.org ([2001:4830:134:3::10]:47562) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWnuN-0004xe-Lr for qemu-devel@nongnu.org; Tue, 01 Sep 2015 11:55:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZWnuD-0001Ek-Rx for qemu-devel@nongnu.org; Tue, 01 Sep 2015 11:55:38 -0400 Received: from mail-qk0-x232.google.com ([2607:f8b0:400d:c09::232]:35459) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWnuD-0001Dw-Nz for qemu-devel@nongnu.org; Tue, 01 Sep 2015 11:55:29 -0400 Received: by qkcj187 with SMTP id j187so46747195qkc.2 for ; Tue, 01 Sep 2015 08:55:29 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Programmingkid In-Reply-To: <20150901144332.GG4304@noname.redhat.com> Date: Tue, 1 Sep 2015 11:55:27 -0400 Content-Transfer-Encoding: quoted-printable Message-Id: 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> <20150901144332.GG4304@noname.redhat.com> Subject: Re: [Qemu-devel] Should we auto-generate IDs? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Jeff Cody , Markus Armbruster , qemu-devel qemu-devel , Paolo Bonzini , jsnow@redhat.com, =?iso-8859-1?Q?Andreas_F=E4rber?= On Sep 1, 2015, at 10:43 AM, Kevin Wolf wrote: > Am 01.09.2015 um 16:18 hat Programmingkid geschrieben: >>=20 >> On Sep 1, 2015, at 8:34 AM, Kevin Wolf wrote: >>=20 >>> Am 27.08.2015 um 14:32 hat Jeff Cody geschrieben: >>>> I'm not married to the ID generation scheme I proposed. =20 >>>>=20 >>>> 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. >>>>=20 >>>> 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: >>>>=20 >>>> * Reserved namespaces >>>> * Uniqueness >>>> * Non-predictable (to avoid inadvertently creating a de facto ABI) >>>>=20 >>>>=20 >>>> . . . >>>>=20 >>>> On the generation scheme proposed above: >>>>=20 >>>> I understand that something you desire is an ID that is easier to >>>> type. >>>>=20 >>>> If we wanted to make it shorter, perhaps we could have the number >>>> counter be variable length: >>>>=20 >>>> qemu#ss#D#XY >>>> | | | | >>>> qemu reserved - | | | >>>> | | | >>>> subsystem name ---| | | >>>> | | >>>> counter --------| | >>>> | >>>> 2-digit random ---| >>>=20 >>> 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: >>>=20 >>> #block150 >>> #block219 >>> #block344 >>> ... >>>=20 >>> That seems easy to type and still fulfills all of the criteria. >>>=20 >>> Kevin >>=20 >> 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.=20 >=20 > 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. The rules aren't all necessary.=20=