For techincal discussions on design it's better to post to the
development list.
On Mon, Feb 27, 2017 at 16:41:28 +0100, Francesco Romani wrote:
Hi,
Hi,
Currently libvirt supports metadata in the domain XML. This is very
convenient for data related to the VM, but it is a little awkward for
devices. Let's pretend I want to have extradata (say, a specific port
for a virtual switch) related to a device (say, a NIC). Nowadays I can
store that data in the metadata section, but I need some kind of mapping
to correlate this piece of information to the specific device.
I can use the device alias, but this is not available when the device is
created. This is also more complex when doing hotplug/hotunplug, because
I need to do update device and update metadata; if either fails, the
entire operation must be considered failed.
It would be nice to be able to attach metadata to the device, and this
is what I'm asking for/proposing in this mail.
Would it be possible in a future libvirt release?
In general I don't have a problem with this and if it would make the
life of mgmt tools easier I don't see a reason why not.
There's one problem though. For setter (or getter) APIs for the metadata
you need a way how to uniquely identify a device on which you want to
operate. There's no such way currently in use in libvirt so you need to
come up with something to do it.
The identifier is also desired for the metadata change event which would
go with the APIs.
It might be possible to do this even without APIs but the usefulnes
would be rather limited as it was with the domain metadata.