On 2/13/24 14:43, Boris Fiuczynski wrote:
> Tangentially related:
>
> Almost all of the other API objects can update their persistent
> definition from an XML file by calling the $(OBJECT)DefineXML command
> to replace the existing definition. The Node device API does not yet
> support doing that, maybe we should strive for a bit more API
> consistency here and implement that as well.
>
> Clearly the DefineXML() API will only operate on a persistent
> definition, so if we want to provide a way to update a live device,
> we'll need a new API, which is presumably where this one comes in...
Correct.
I will take a look at how to align virNodeDeviceDefineXML
The current libvirt code does not prevent to define an existing mdev and
does call mdevctl which reports that mdevctl cowardly refuses to
overwrite the existing config as an internal error.
# virsh nodedev-define vfio-ccw-mdev-c60c_new-attr-set1.xml
error: Failed to define node device from
'vfio-ccw-mdev-c60c_new-attr-set1.xml'
error: internal error: Unable to define mediated device: Error: Cowardly
refusing to overwrite existing config for
0.0.0008/c60cc60c-c60c-c60c-c60c-c60cc60cc60c
Instead of handling this in libvirt by detecting on define if a
persistent config already exists and instead of calling 'mdevctl define'
using 'mdevctl modify' for the update should mdevctl become brave by
removing its refusal?
--
Mit freundlichen Grüßen/Kind regards
Boris Fiuczynski
IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Wolfgang Wendt
Geschäftsführung: David Faller
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294