Bug 1583927 - "Unexpected hostdev type while encoding audit message: 4" when attach a mdev device.
Summary: "Unexpected hostdev type while encoding audit message: 4" when attach a mdev ...
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.6
Hardware: x86_64
OS: Linux
Target Milestone: rc
: ---
Assignee: Erik Skultety
QA Contact: yafu
Depends On:
TreeView+ depends on / blocked
Reported: 2018-05-30 03:26 UTC by Fangge Jin
Modified: 2018-10-30 09:57 UTC (History)
3 users (show)

Fixed In Version: libvirt-4.4.0-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2018-10-30 09:55:31 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:3113 None None None 2018-10-30 09:57:51 UTC

Description Fangge Jin 2018-05-30 03:26:24 UTC
Description of problem:
"Unexpected hostdev type while encoding audit message: 4" when attach a mdev hostdev.

Version-Release number of selected component (if applicable):

How reproducible:

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'> 
      <address uuid='7bb8579b-55ca-4f4d-b70f-498a583c1e6e'/> 
   <alias name='ua-0febf033-9953-40e1-b803-2df42b0bac4e'/>

# 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

Actual results:
Warning when log audit message for mdev device.

Expected results:
Audit log is recorded successfully

Additional info:

Comment 2 Erik Skultety 2018-05-31 10:16:19 UTC
Fixed upstream by:
Refs: v4.4.0-rc1-7-ge0fae78ad5
Author:     Erik Skultety <eskultet@redhat.com>
AuthorDate: Thu May 31 09:42:58 2018 +0200
Commit:     Erik Skultety <eskultet@redhat.com>
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.

    Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1583927

    Signed-off-by: Erik Skultety <eskultet@redhat.com>

Comment 4 yafu 2018-08-31 03:09:35 UTC
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.

Comment 6 errata-xmlrpc 2018-10-30 09:55:31 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.