Bug 1979761
Summary: | Can not define mdev device successfully when using xml dumped from mdev device defined by mdevctl | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 9 | Reporter: | yafu <yafu> |
Component: | libvirt | Assignee: | Jonathon Jongsma <jjongsma> |
libvirt sub component: | General | QA Contact: | zhentang <zhetang> |
Status: | CLOSED ERRATA | Docs Contact: | |
Severity: | unspecified | ||
Priority: | unspecified | CC: | jdenemar, lmen, virt-maint, xuzhang, yalzhang, zhguo |
Version: | 9.0 | Keywords: | AutomationTriaged, Reopened |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | libvirt-7.7.0-1.el9 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2022-05-17 12:45:04 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
yafu
2021-07-07 01:13:18 UTC
Good catch. Unfortunately this is a bit tricky to fix for all scenarios because of the fact that mdevctl supports defining mdevs for parent devices that do not actually exist (yet) on the host system. For active mdevs and for inactive mdevs whose parent devices are present, it's pretty straightforward to convert from '0000:5b:00.0' to 'pci_0000_5b_00_0'. But for those devices whose parents are not present on the host, there's no valid parent id that we can use in that field. I proposed a fix upstream that used the correct parent ID where possible but assigned "parentless" devices to the root "computer" device in libvirt. So for those devices with valid parents, dumping xml and defining should work. But for those without parents, dumping to xml and defining from that xml would still fail because the "computer" device is not a valid parent. Bulk update: Move RHEL-AV bugs to RHEL9. If necessary to resolve in RHEL8, then clone to the current RHEL8 release. The following commits should fully fix this issue. Included in release 7.6.0 51fbbfdce8141d5a25edcf66ba3a95ac23b29f94 nodedev: fix parent device of inactive mdevs Included in release 7.7.0 fdfe4b2837c3408edc57f6d3bf393dc16cd0ac64 nodedev: add internal virNodeDeviceObjListFind() a9c1febcf43544fb9b9e59e8b45161d11260d9aa nodedev: fix xml output for mdev parents in test suite e44408dd9c45cb4f5e41caef4a9d2b7d2b8eb528 nodedev: cache parent address in mdev caps d5ae634ba284fcb1aa40634ad3c0a9e820ec916a nodedev: Add parser validation for node devices 08d29eb3b1d2361b7c70eaf0e269165387cf2756 nodedev: add PostParse callback for nodedev parsing 3bd8181bc5548a0ce81107cbfb480dfdcba5679d nodedev: Handle inactive mdevs with the same UUID fcae7a44c3b3559d1d8e05543deee41db7a8fdb1 nodedev: look up mdevs by UUID and parent Since libvirt was recently rebased to 7.7.0, this issue should now be fixed as well. Verified on env: libvirt-7.8.0-1.el9 qemu-kvm-6.1.0-5.el9 verified on Env: libvirt-7.8.0-1.el9 Mdev device defined success. # virsh nodedev-dumpxml mdev_83a54ae7_09b1_4046_b0e2_b31de31505a0_0000_00_02_0 <device> <name>mdev_83a54ae7_09b1_4046_b0e2_b31de31505a0_0000_00_02_0</name> <parent>pci_0000_00_02_0</parent> <capability type='mdev'> <type id='nvidia-262'/> <uuid>83a54ae7-09b1-4046-b0e2-b31de31505a0</uuid> <iommuGroup number='0'/> </capability> </device> # virsh nodedev-dumpxml mdev_83a54ae7_09b1_4046_b0e2_b31de31505a0_0000_00_02_0 >mdevtest.xml # virsh nodedev-undefine mdev_83a54ae7_09b1_4046_b0e2_b31de31505a0_0000_00_02_0 Undefined node device 'mdev_83a54ae7_09b1_4046_b0e2_b31de31505a0_0000_00_02_0' # virsh nodedev-define mdevtest.xml Node device 'mdev_83a54ae7_09b1_4046_b0e2_b31de31505a0_0000_00_02_0' defined from 'mdevtest.xml' Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (new packages: libvirt), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2022:2390 |