Bug 499561

Summary: libvirt does not automatically re-attach an assigned device in the host after guest shutdown
Product: [Fedora] Fedora Reporter: Mark McLoughlin <markmc>
Component: libvirtAssignee: Mark McLoughlin <markmc>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 11CC: berrange, clalance, crobinso, itamar, veillard, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: 0.6.2-17.fc11 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-04 00:09:55 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 480594    

Description Mark McLoughlin 2009-05-07 04:11:00 EDT


If you attach a device to a guest in "managed" mode, then libvirt automatically detaches the device from the host before starting the guest, but it doesn't automatically do it when the guest shuts down

This would be particularly noticeable if you were using virt-manager - you'd have to drop to the shell and do "virsh reattach" before you can use the device in the guest again.

Granted, libvirtd might not even be running when the guest dies, but is there anything we can do here for the common case?
Comment 1 Daniel Berrange 2009-05-07 05:12:43 EDT
Agreed, it should reset the device after guest shutdown and then re-attach the host OS drivers. 

We should assume libvirtd is running at time of guest shutdown. Any scenario where it wouldn't be running is a bug.
Comment 2 Daniel Berrange 2009-05-07 05:15:11 EDT
NB, we need to be careful in the reset to avoid outstanding DMA ops clobbering the host OS memory - see this note from xen


This might mean we need KVM todo a FLR in the guest cleanup path ?
Comment 3 Bug Zapper 2009-06-09 11:17:52 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:
Comment 4 Mark McLoughlin 2009-08-14 03:44:47 EDT
Patch committed upstream:

Comment 5 Fedora Update System 2009-08-19 12:35:03 EDT
libvirt-0.6.2-16.fc11 has been submitted as an update for Fedora 11.
Comment 6 Fedora Update System 2009-08-20 16:58:22 EDT
libvirt-0.6.2-17.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update libvirt'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-8790
Comment 7 Fedora Update System 2009-09-04 00:09:23 EDT
libvirt-0.6.2-17.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.