<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Hi,</p>
<p><br>
</p>
<p>From my experience once the process that has the file handle to the container terminates, the container is automatically destroyed and the groups released - I'm working with code that doesn't do any cleanup on exit at the moment and I've had no problems
 opening and reusing several devices in the same machine over and over...</p>
<p><br>
</p>
<p>Perhaps however, QEMU hasn't actually completely terminated, is there still a zombie process which might be keeping the file handles open?</p>
<p><br>
</p>
<p>-Chris</p>
<br>
<br>
<div style="color: rgb(0, 0, 0);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> vfio-users-bounces@redhat.com <vfio-users-bounces@redhat.com> on behalf of Chen, Xiaoguang <xiaoguang.chen@intel.com><br>
<b>Sent:</b> 03 November 2016 07:22<br>
<b>To:</b> vfio-users@redhat.com<br>
<b>Subject:</b> [vfio-users] reuse vfio pass through device problem</font>
<div> </div>
</div>
<div><font face="Calibri" size="2"><span style="font-size:11pt">
<div>Hi everyone,</div>
<div> </div>
<div>I pass through a network card to a linux guest using vfio.</div>
<div>Then I shut down the guest and boot the guest again but got problem:</div>
<div>qemu-system-x86_64: -device vfio-pci,host=0000:04:00.0: vfio error: 0000:04:00.0: failed to open /dev/vfio/11: Device or resource busy</div>
<div> </div>
<div>I checked the QEMU code and found that the error occured while opening the group.</div>
<div>When I booted the guest for the first time the group was added to a container but when the guest shut down the group was not deleted from the container. So I got error while opening the group.</div>
<div> </div>
<div>Does this work as design or a bug?</div>
<div><font face="Times New Roman"> </font></div>
<div><font face="Times New Roman"> </font></div>
<div><font face="Times New Roman"> </font></div>
</span></font></div>
</div>
</div>
</body>
</html>