From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=59086 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OJ1ml-0008Ko-Nk for qemu-devel@nongnu.org; Mon, 31 May 2010 05:59:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OJ1mW-00027z-OQ for qemu-devel@nongnu.org; Mon, 31 May 2010 05:59:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:14832) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OJ1mW-00027t-Gu for qemu-devel@nongnu.org; Mon, 31 May 2010 05:59:40 -0400 Message-ID: <4C038882.3080007@redhat.com> Date: Mon, 31 May 2010 11:59:30 +0200 From: Gerd Hoffmann MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH v3 04/17] qdev: Give qtree names precedence over user-assigned IDs References: <3715da16813f7cdcb7ec023167a84a94e8a37089.1274612367.git.jan.kiszka@web.de> <4C021ED5.1080703@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 > 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". Oh. Well. Yes, better plug that. > @@ -242,6 +243,10 @@ DeviceState *qdev_device_add(QemuOpts *opts) > qdev = qdev_create_from_info(bus, info); > id = qemu_opts_id(opts); > if (id) { > + if (qdev_find_recursive(main_system_bus, id)) { > + qerror_report(QERR_DUPLICATE_ID, id, "device"); > + return NULL; > + } > qdev->id = id; > } > if (qemu_opt_foreach(opts, set_property, qdev, 1) != 0) { Looks good.. Acked-by: Gerd Hoffmann cheers, Gerd