From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40674) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0wmE-0002Um-G9 for qemu-devel@nongnu.org; Wed, 08 Jan 2014 12:18:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W0wm7-0005x1-75 for qemu-devel@nongnu.org; Wed, 08 Jan 2014 12:18:46 -0500 Received: from mail-ea0-f172.google.com ([209.85.215.172]:47252) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0wm7-0005wr-0m for qemu-devel@nongnu.org; Wed, 08 Jan 2014 12:18:39 -0500 Received: by mail-ea0-f172.google.com with SMTP id q10so785939ead.17 for ; Wed, 08 Jan 2014 09:18:03 -0800 (PST) Date: Wed, 8 Jan 2014 18:17:49 +0100 From: Hani Benhabiles Message-ID: <20140108171749.GB3717@Inspiron-3521> References: <1389121639-17657-1-git-send-email-kroosec@gmail.com> <87a9f7c4d5.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87a9f7c4d5.fsf@blackfin.pond.sub.org> Subject: Re: [Qemu-devel] [PATCH] qdev: Assign a default device ID when none is provided. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: stefanha@redhat.com, qemu-devel@nongnu.org, aliguori@amazon.com, pbonzini@redhat.com, imammedo@redhat.com, afaerber@suse.de On Wed, Jan 08, 2014 at 08:36:06AM +0100, Markus Armbruster wrote: > Hani Benhabiles writes: > > > This would allow a user to be able to refer to the device when using commands > > like device_del. > > > > Signed-off-by: Hani Benhabiles > > No. > > Device IDs belong to the user. Any IDs the system picks automatically > can collide with the user's IDs. > > Management applications assume that they can pick any ID they want. > Your patch can introduce ID collisions, and thus make existing > configurations fail. > How can it lead to ID collisions ? For this reason, the loop in assign_device_name() specifically check that the ID doesn't exist already and uses the next value if it does. How would something like: (qemu) device_add virtio-net-pci ==> ID: virtio-net-pci.0 Be more problematic than: (qemu) device_add virtio-net-pci,id=virtio-net-pci.0 > If I remember correctly, a few legacy convenience options pick IDs for > historical reasons. If you use them, you need to be aware of the IDs > they pick. Management applications shouldn't use them. > > We've discussed this a couple of times already, by the way.