mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-25 14:05:18 +00:00
extract general code from qemuDomainReAttachHostdevDevices
This commit is contained in:
parent
24786df527
commit
66dbc559a2
@ -1283,18 +1283,18 @@ qemuReattachPciDevice(virPCIDevicePtr dev, virHostdevManagerPtr mgr)
|
|||||||
virPCIDeviceFree(dev);
|
virPCIDeviceFree(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* @oldStateDir:
|
||||||
void
|
* For upgrade purpose: see virHostdevNetConfigRestore
|
||||||
qemuDomainReAttachHostdevDevices(virQEMUDriverPtr driver,
|
*/
|
||||||
const char *name,
|
static void
|
||||||
virDomainHostdevDefPtr *hostdevs,
|
virHostdevReAttachPCIDevices(virHostdevManagerPtr hostdev_mgr,
|
||||||
int nhostdevs)
|
const char *name,
|
||||||
|
virDomainHostdevDefPtr *hostdevs,
|
||||||
|
int nhostdevs,
|
||||||
|
char *oldStateDir)
|
||||||
{
|
{
|
||||||
virPCIDeviceListPtr pcidevs;
|
virPCIDeviceListPtr pcidevs;
|
||||||
size_t i;
|
size_t i;
|
||||||
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
|
|
||||||
char *oldStateDir = cfg->stateDir;
|
|
||||||
virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr;
|
|
||||||
|
|
||||||
virObjectLock(hostdev_mgr->activePciHostdevs);
|
virObjectLock(hostdev_mgr->activePciHostdevs);
|
||||||
virObjectLock(hostdev_mgr->inactivePciHostdevs);
|
virObjectLock(hostdev_mgr->inactivePciHostdevs);
|
||||||
@ -1369,6 +1369,21 @@ qemuDomainReAttachHostdevDevices(virQEMUDriverPtr driver,
|
|||||||
cleanup:
|
cleanup:
|
||||||
virObjectUnlock(hostdev_mgr->activePciHostdevs);
|
virObjectUnlock(hostdev_mgr->activePciHostdevs);
|
||||||
virObjectUnlock(hostdev_mgr->inactivePciHostdevs);
|
virObjectUnlock(hostdev_mgr->inactivePciHostdevs);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
qemuDomainReAttachHostdevDevices(virQEMUDriverPtr driver,
|
||||||
|
const char *name,
|
||||||
|
virDomainHostdevDefPtr *hostdevs,
|
||||||
|
int nhostdevs)
|
||||||
|
{
|
||||||
|
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
|
||||||
|
char *oldStateDir = cfg->stateDir;
|
||||||
|
virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr;
|
||||||
|
|
||||||
|
virHostdevReAttachPCIDevices(hostdev_mgr, name,
|
||||||
|
hostdevs, nhostdevs, oldStateDir);
|
||||||
|
|
||||||
virObjectUnref(cfg);
|
virObjectUnref(cfg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user