On Thu, 7 Jan 2021 17:43:54 +0100
Erik Skultety <eskultet(a)redhat.com> wrote:
>
> 4.Define a mdev device with the uuid specified, but the mdev device
> defined seems using another uuid. Maybe it make a little confusion
> about the use of uuid in the xml:
> #cat mdev.xml
> <device>
> <name>mdev_85531b6d_e5e4_41c1_aa2a_8844717f066a</name> ****
Yeah, the easy way out here is to document that the <name> element is
read only, but that would be wrong, because we allow specifying it
for domains, networks, interfaces, etc. So, we should give the end
user the option to specify whatever name they want and generate one
if none is provided.
Unfortunately, this appears to be difficult to achieve for persistent
devices. For mediated devices, we are using mdevctl as our backend
persistent device definition storage. But mdevctl doesn't provide a way
to attach additional metadata along with a mdev definition. So we would
need to either modify mdevctl to allow us to store additional data with
a device definition, or we would need to create (and keep synchronized)
a separate persistent storage for libvirt-specific metadata about
mediated devices.
It's also worth noting that 'nodedev-create' previously allowed you to
create vHBA devices in libvirt, but the 'name' element is explicitly
ignored (see
https://wiki.libvirt.org/page/NPIV_in_libvirt):
"NOTE: If you specify "name" for the vHBA, then it will be ignored.
The kernel will automatically pick the next SCSI host name in
sequence not already used."
That said, I do think that it will be useful or even necessary to be
able to create mdevs with a specific UUID, but I think that's a separate
issue than being able to specify the 'name' of the nodedev. It seems
better to do that by specifying a 'uuid' element within the mdev caps,
rather than trying to parse a UUID from an arbitrary name string. For
example:
<device>
<capability type='mdev'>
<type id='i915-GVTg_V5_8'/>
<uuid>901891a6-2077-4476-9465-53d8995b81b4</uuid>
</capability>
<parent>pci_0000_00_02_0</parent>
</device>
Thoughts?
Jonathon