On Sep 3, 2015, at 10:43 AM, Jeff Cody wrote: > On Thu, Sep 03, 2015 at 10:34:04AM -0400, Programmingkid wrote: >> It has been over a week since we first started talking about this >> subject. A lot of opinions have been flying around. Does this issue >> look like it is starting to be fixed? I just have to say I don't >> think it has been solved yet. Having device_del use a QOM path does >> not sound very good. It is actually easier and faster for the user >> to restart QEMU with a new ID for some device than to have to look >> up some QOM path. Having a user-friendly system for creating ID's >> should be a priority. > > Please see my v2 patch series (you were CC'ed on it): > > > [PATCH v2 1/2] util - add automated ID generation utility > [PATCH v2 2/2] block: auto-generated node-names > > The first patch is a qemu-wide utility to generate IDs. > > The scheme seems to have some consensus, and a few r-b's (it is > also derived from this conversation thread). > > The second patch is using it in the block layer, for node-names; it > should be trivial to see how to use it for qdev. > > Would you like me to roll a v3, with a qdev patch added in? > > Thanks, > Jeff
Yes, thank you for them. The first patch does provide a function that generates an ID, but it doesn't actually give the ID to anything. A third patch might be needed that actually puts the id_generate() function to use. I use USB devices that I would like to be able to remove during QEMU's usage. Any ID generating system would be very useful. In qdev-monitor.c there is a function called qdev_device_add(). That is where I would use your id_generate() function.