Description of problem:
"Unexpected hostdev type while encoding audit message: 4" when attach a mdev hostdev.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
0.Prepare mdev device
1.Start a guest
2.Attach mdev device to guest:
# cat /tmp/mdev.xml
<hostdev mode='subsystem' type='mdev' model='vfio-pci'>
# virsh attach-device 1 /tmp/mdev.xml
Device attached successfully
3.Check libvirtd log:
2018-05-30 03:20:57.241+0000: 19704: warning : virDomainAuditHostdev:424 : Unexpected hostdev type while encoding audit message: 4
Warning when log audit message for mdev device.
Audit log is recorded successfully
Fixed upstream by:
Author: Erik Skultety <email@example.com>
AuthorDate: Thu May 31 09:42:58 2018 +0200
Commit: Erik Skultety <firstname.lastname@example.org>
CommitDate: Thu May 31 12:09:50 2018 +0200
audit: Enforce enum switch type cast in virDomainAuditHostdev
There was a missing enum for mdev causing a strange 'unknown device type'
warning when hot-plugging mdev.
Signed-off-by: Erik Skultety <email@example.com>
Reproduced with libvirt-4.3.0-1.el7.x86_64.
Verified with libvirt-4.5.0-7.el7.x86_64.
Test steps are the same as comment 0. And no warning "Unexpected hostdev type while encoding audit message" in libvirtd.log when attaching a mdev device.
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, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.