From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=48762 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OKYpl-00013W-3Z for qemu-devel@nongnu.org; Fri, 04 Jun 2010 11:29:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OKYpk-0007sm-91 for qemu-devel@nongnu.org; Fri, 04 Jun 2010 11:29:21 -0400 Received: from mail.codesourcery.com ([38.113.113.100]:49535) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OKYpj-0007sD-Sp for qemu-devel@nongnu.org; Fri, 04 Jun 2010 11:29:20 -0400 From: Paul Brook Subject: Re: [Qemu-devel] [PATCH] qdev: Reject duplicate and anti-social device IDs Date: Fri, 4 Jun 2010 16:28:29 +0100 References: <201006030751.37918.paul@codesourcery.com> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201006041628.30920.paul@codesourcery.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Anthony Liguori , Juan Quintela , Jan Kiszka , qemu-devel@nongnu.org, Luiz Capitulino , Blue Swirl , Jan Kiszka , Gerd Hoffmann , Avi Kivity > Paul Brook writes: > >> Also require IDs to start with a letter to provide for possible future > >> extensions. > > > > I'd go further than that, and require that user specified IDs match > > [A-Za-z][A-Za-z0-9_-]* > > I talked with Dan (cc'ed) to make sure we don't trample on existing > libvirt usage without need. What about > > [A-Za-z][A-Za-z0-9_-:.]* > > i.e. your regexp plus ':' and '.' in the second bracket? I was deliberately avoiding those as they're often used as separators - we already use ':' in other contexts so there's potential ambiguity and parsing/quoting issues. I'm not aware of any current issues with '.'. Paul P.S. Your regexp doesn't do what you think it does, but I know what you mean.