mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
extract general code from qemuUpdateActivePciHostdevs
Extract general code from qemuUpdateActivePciHostdevs to virHostdevUpdateActivePciHostdevs.
This commit is contained in:
parent
899b261127
commit
94d505ba15
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user