extract general code from qemuUpdateActivePciHostdevs

Extract general code from qemuUpdateActivePciHostdevs to
virHostdevUpdateActivePciHostdevs.
This commit is contained in:
Chunyan Liu 2014-03-06 12:32:42 +08:00 committed by Daniel P. Berrange
parent 899b261127
commit 94d505ba15

View File

@ -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)