On Wed, Jan 08, 2014 at 06:34:01PM +0100, Paolo Bonzini wrote: > Il 08/01/2014 18:17, Hani Benhabiles ha scritto: > > 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 > > (qemu) device_add virtio-net-pci > (qemu) device_add virtio-net-pci,id=virtio-net-pci.0 > > works without your patches, fails with them (IIUC).
It would fail with a clear and descriptive message (Duplicate ID) which is no different than when a user uses tries to do so manually. Without the patch, how does a user unplug a device for which he didn't specify an ID (eg. forgotten, added quickly...) It is even more confusing with other commands like info networks. (qemu) device_add virtio-net-pci (qemu) device_add virtio-net-pci,id=foo (qemu) info network virtio-net-pci.0: index=0,type=nic,model=virtio-net-pci,macaddr=52:54:00:12:34:56 foo: index=0,type=nic,model=virtio-net-pci,macaddr=52:54:00:12:34:57 (qemu) device_del foo (qemu) device_del virtio-net-pci.0 Device 'virtio-net-pci.0' not found If the naming scheme is an issue, could something like starting it with one or two underscores better suited ? Cheers, Hani.