[libvirt PATCH v3 00/21] Add support for persistent mediated devices

Erik Skultety eskultet at redhat.com
Thu Jan 7 16:43:54 UTC 2021

On Tue, Jan 05, 2021 at 11:50:11AM +0800, Yan Fu wrote:
> Tested with v6.10.0-283-g1948d4e61e.
> 1.Can define/start/destroy mdev device successfully;
> 2.'virsh nodedev-list' has no '--active' option, which is inconsistent with
> the description in the patch:
> # virsh nodedev-list --active
> error: command 'nodedev-list' doesn't support option --active
> 3.virsh client hang when trying to destroy a mdev device which is using by
> a vm, and after that all 'virsh nodev*' cmds will hang. If restarting
> llibvirtd after that, libvirtd will hang.

It hangs because underneath a write to the 'remove' sysfs attribute is now
blocking for some reason and since we're relying on mdevctl to do it for us,
hence "it hangs". I'm not trying to make an excuse, it's plain wrong. I'd love
to rely on such a basic functionality, but it looks like we'll have to go with
a extremely ugly workaround and try to get the list of active domains from the
nodedev driver and see whether any of them has the device assigned before we
try to destroy the mdev via the nodedev driver.

However, in my testing libvirtd never hung after a restart, can you elaborate
on that?

> 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.


More information about the libvir-list mailing list