Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 554958

Summary: PCI Hot Unplug for HVM guest are always failed
Product: Red Hat Enterprise Linux 5 Reporter: Yewei Shao <mshao>
Component: xenAssignee: Xen Maintainance List <xen-maint>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 5.5CC: ddugger, jiajun.xu, minovotn, mrezanin, xen-maint
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-03-18 17:22:54 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Yewei Shao 2010-01-13 07:37:47 UTC
Description of problem:
First, using PCI Hot Plug for HVM guest, then trying to use PCI Hot Unplug for HVM guest is always failed.

Version-Release number of selected component (if applicable):
xen-3.0.3-103.el5

How reproducible:
always

Steps to Reproduce:
1.let pci device that you want to assign to HVM guest must have been hidden from domain0 and not assigned to other guest. If not, please hide it first:
   # echo -n {pci_idenfier} > /sys/bus/pci/drivers/{native_dirver}/unbind
   # echo -n {pci_idenfier} > /sys/bus/pci/drivers/pciback/new_slot
   # echo -n {pci_idenfier} > /sys/bus/pci/drivers/pciback/bind
Check that pci device has been hidden from domain0 successfully, in domain0:
   # xm pci-list-assignable-devices
2.Attach the pci device to the HVM guest with xm pci-attach:
   # xm pci-attach <Domain> <domain:bus:slot.func> [virtual slot]
3.In domain0, check pci device that assigned to the guest:
   # xm pci-list $domain_id
4. Detach pci device that you want to hot unplug from HVM guest:
   # xm pci-detach <Domain> <domain:bus:slot.func> 

Actual results:
It always failed, and report the following error message:
Error: Timed out waiting for device model action
Usage: xm pci-detach <Domain> <domain:bus:slot.fun>
Remove a domain's pass-through pci device

Expected results:
The PCI can hot unplug from HVM guest.

Additional info:

Comment 2 Xu Jiajun 2010-03-18 01:14:07 UTC
Hi Yewei,
Could you provide the lspci output of the NIC you used for hotplug/hot-unplug testing? Is it a generic failure or only specific for PCI NIC? 
Have you loaded acpiphp module in guest before doing hotplug/hot-unplug testing? By default, RHEL5 won't load the module, which is needed for device hotplug.

And it will be helpful if you provide the xend log as well as qemu log for the failure.

BTW, I tested RHEL5.5 Beta, GA Snapshot 2 & 4, PCI/PCIe NIC hotplug/hot-unplug can work in these release candidates on our machines.

Thanks a lot.

Comment 3 Yewei Shao 2010-03-18 02:07:33 UTC
Hi xu jianjun,

From your comment #2, you have mentioned that we should load acpiphp module since rhel5 won't load the module. So I load this module manually and with this module loaded, the pci can be hotplug and hot-unplug. So the reason that this bug happens is that we do not load the acpiphp module manually which needed for device hotplug.
So this bug is no more exist now, please help us to close this bug. Thanks.

Comment 4 Bill Burns 2010-03-18 17:22:54 UTC
Closing per reporter's request.

Comment 5 Paolo Bonzini 2010-04-08 15:48:59 UTC
This bug was closed during 5.5 development and it's being removed from the internal tracking bugs (which are now for 5.6).