On Aug 27, 2015, at 10:01 AM, Eric Blake wrote: > On 08/27/2015 07:51 AM, Daniel P. Berrange wrote: >> On Thu, Aug 27, 2015 at 09:39:10AM -0400, Programmingkid wrote: >>> >>>> Better still might be fixing things to where we add a global command >>>> line option that outright fails any attempt to create an unnamed object. >>>> The option would be off by default for back-compat. But management >>>> apps like libvirt can turn it on once they are prepared to name every >>>> object they create (which in turn may imply fixing any remaining >>>> interfaces that cannot name an object to add in that ability for >>>> management to pass in a name). Then there would be no unnamed objects, >>>> no ambiguity, and no need to generate names. >>> >>> I do agree with giving every device an ID, but I don't think failing if the >>> user >>> forgets to give one is necessary. If libvirt doesn't give devices and ID, it >>> would probably benefit from having QEMU do it for libvirt. > > No, you're misunderstanding our argument. The moment there is more than > one device with an auto-assigned name is the moment that management > doesn't know which device got which name, so it's better for management > to pick a name in the first place.
Ok. I see. You might be assuming that QEMU will be the only one to give a device an ID. The ID will ONLY be given if the user or libvirt *doesn't* give it. So libvirt would be able to function just fine with an ID generating system. >> >> Libvirt always gives an explicit ID. > > Except it doesn't, yet. Libvirt still needs to be taught to name all > node devices (and I'm slowly trying to work on patches towards that goal). Well if Libvirt doesn't give an ID to a device, then it won't be able to use monitor commands that depend on the ID. This sounds like a completely different problem. > >> It is impossible to rely on QEMU >> assigning IDs, because there is no reliable way to identify what ID >> QEMU assigned to each device after the fact. Other management apps >> would have the same problem, so auto-generated IDs are pretty useless >> in that respect. > > It's not to say that auto-generated names would be useless when running > qemu manually from the command line, but I agree that management > probably can't safely rely on auto-generated names, and therefore > solving the issue of auto-generating names is less important. What if we change this so that management applications could actually query devices and their properties. I'm thinking some kind of JSON-like output. Something like 'info all-devices'. It prints the device name, location, and ID. This list should be easy to parse by Libvirt.