Bug 1489670

Summary: Hot-unplugging a vhost network device leaks references to VFIOPCIDevice's
Product: Red Hat Enterprise Linux 7 Reporter: Sergio Lopez <slopezpa>
Component: qemu-kvm-rhevAssignee: Alex Williamson <alex.williamson>
Status: CLOSED ERRATA QA Contact: Yanan Fu <yfu>
Severity: high Docs Contact:
Priority: high    
Version: 7.3CC: alex.williamson, chayang, jen, jherrman, jinzhao, jjung, juzhang, knoel, michen, mrezanin, pezhang, rhodain, slopezpa, virt-maint, xiywang, yfu
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: qemu-kvm-rhev-2.10.0-2.el7 Doc Type: Bug Fix
Doc Text:
Hot-unplugging Virtual Function I/O (VFIO) devices previously failed when performed after hot-unplugging a vhost network device. This update fixes the underlying code, and the VFIO device is unplugged correctly in the described circumstances.
Story Points: ---
Clone Of:
: 1490742 (view as bug list) Environment:
Last Closed: 2018-04-11 00:33:01 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:
Bug Depends On:    
Bug Blocks: 1490742    

Description Sergio Lopez 2017-09-08 05:42:55 UTC
Hot-unplugging a vhost network device leaks references to VFIOPCIDevice's. This causes that, when trying to hot-unplug one of those VFIO devices, QEMU can't finalize it properly because the references never reach 0.

So far, we've identified the following scenarios (100% reproducible):

---
 1. Start a VM with both a VIRTIO network device and a VFIO hostdev.
 2. Hot-unplug the VIRTIO device.
 3. Hot-unplug the VFIO -> QEMU can't finalize the device: ref=2
---
 1. Start a VM with just a VFIO hostdev.
 2. Hot-plug the VIRTIO device.
 3. Hot-unplug the VFIO -> QEMU can't finalize the device: ref=2
---
 1. Start a VM with just a VFIO hostdev.
 2. Hot-plug the VIRTIO device.
 3. Hot-unplug the VIRTIO device.
 4. Hot-unplug the VFIO -> QEMU can't finalize the device: ref=2
---

There's a patch for this posted in QEMU's mailing list:

 - http://lists.nongnu.org/archive/html/qemu-devel/2017-09/msg01787.html

Comment 16 Miroslav Rezanina 2017-10-13 10:26:23 UTC
Fix included in qemu-kvm-rhev-2.10.0-2.el7

Comment 20 errata-xmlrpc 2018-04-11 00:33:01 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:1104