提交 94d505ba 编写于 作者: C Chunyan Liu 提交者: Daniel P. Berrange

extract general code from qemuUpdateActivePciHostdevs

Extract general code from qemuUpdateActivePciHostdevs to
virHostdevUpdateActivePciHostdevs.
上级 899b2611
......@@ -41,18 +41,14 @@
#define VIR_FROM_THIS VIR_FROM_QEMU
int
qemuUpdateActivePciHostdevs(virQEMUDriverPtr driver,
virDomainDefPtr def)
static int
virHostdevUpdateActivePciHostdevs(virHostdevManagerPtr mgr,
virDomainDefPtr def)
{
virDomainHostdevDefPtr hostdev = NULL;
virPCIDevicePtr dev = NULL;
size_t i;
int ret = -1;
virHostdevManagerPtr mgr = driver->hostdevMgr;
if (!def->nhostdevs)
return 0;
virObjectLock(mgr->activePciHostdevs);
virObjectLock(mgr->inactivePciHostdevs);
......@@ -103,6 +99,18 @@ cleanup:
return ret;
}
int
qemuUpdateActivePciHostdevs(virQEMUDriverPtr driver,
virDomainDefPtr def)
{
virHostdevManagerPtr mgr = driver->hostdevMgr;
if (!def->nhostdevs)
return 0;
return virHostdevUpdateActivePciHostdevs(mgr, def);
}
int
qemuUpdateActiveUsbHostdevs(virQEMUDriverPtr driver,
virDomainDefPtr def)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册