提交 fb0ef7a6 编写于 作者: S Shivaprasad G Bhat 提交者: Ján Tomko

hostdev: Report the domain name for used hostdevs during nodedev-detach

The nodedev-detach can report the name of the domain using the device
just the way nodedev-reattach does it.
Signed-off-by: NShivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
Signed-off-by: NJán Tomko <jtomko@redhat.com>
上级 e3aa4c91
......@@ -1521,11 +1521,18 @@ int
virHostdevPCINodeDeviceDetach(virHostdevManagerPtr hostdev_mgr,
virPCIDevicePtr pci)
{
virPCIDeviceAddressPtr devAddr = NULL;
int ret = -1;
virObjectLock(hostdev_mgr->activePCIHostdevs);
virObjectLock(hostdev_mgr->inactivePCIHostdevs);
if (!(devAddr = virPCIDeviceGetAddress(pci)))
goto out;
if (virHostdevIsPCINodeDeviceUsed(devAddr, hostdev_mgr))
goto out;
if (virPCIDeviceDetach(pci, hostdev_mgr->activePCIHostdevs,
hostdev_mgr->inactivePCIHostdevs) < 0) {
goto out;
......@@ -1535,6 +1542,7 @@ virHostdevPCINodeDeviceDetach(virHostdevManagerPtr hostdev_mgr,
out:
virObjectUnlock(hostdev_mgr->inactivePCIHostdevs);
virObjectUnlock(hostdev_mgr->activePCIHostdevs);
VIR_FREE(devAddr);
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册