RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
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 ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.6
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Erik Skultety
QA Contact: yafu
URL:
Whiteboard:
Depends On:
Blocks:
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:
Environment:
Last Closed: 2018-10-30 09:55:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:3113 0 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):
libvirt-4.3.0-1.el7.x86_64

How reproducible:
100%

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

# 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>
AuthorDate: Thu May 31 09:42:58 2018 +0200
Commit:     Erik Skultety <eskultet>
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>

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.

https://access.redhat.com/errata/RHSA-2018:3113


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