From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=60838 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OJA90-0007N5-9S for qemu-devel@nongnu.org; Mon, 31 May 2010 14:55:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OJA8z-0005Om-8o for qemu-devel@nongnu.org; Mon, 31 May 2010 14:55:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44234) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OJA8z-0005OR-0e for qemu-devel@nongnu.org; Mon, 31 May 2010 14:55:25 -0400 Message-ID: <4C040614.4090801@redhat.com> Date: Mon, 31 May 2010 20:55:16 +0200 From: Gerd Hoffmann MIME-Version: 1.0 References: <3715da16813f7cdcb7ec023167a84a94e8a37089.1274612367.git.jan.kiszka@web.de> <4C021ED5.1080703@redhat.com> <4C038882.3080007@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH] qdev: Reject duplicate and anti-social device IDs 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 , Avi Kivity On 05/31/10 16:13, Markus Armbruster wrote: > We need Device IDs to be unique and not contain '/' so device tree > nodes can always be unambigously referenced by tree path. > > We already have some protection against duplicate IDs, but it got > holes: > > * We don't assign IDs to default devices. > > * -device and device_add use the ID of a qemu_device_opts. Which > rejects duplicate IDs. > > * pci_add nic -net use either the ID or option "name" of > qemu_net_opts. And there's our hole. Reproducible with "-net user > -net nic,id=foo -device lsi,id=foo". > > Also require IDs to start with a letter to provide for possible future > extensions. > Acked-by: Gerd Hoffmann cheers, Gerd