提交 08ae9026 编写于 作者: C Chunyan Liu 提交者: Daniel P. Berrange

extract general code from qemuDomainReAttachHostUsbDevices

Extract general code from qemuDomainReAttachHostUsbDevices to
virHostdevDomainReAttachHostUsbDevices.
上级 5035f75f
...@@ -316,15 +316,13 @@ qemuDomainReAttachHostdevDevices(virQEMUDriverPtr driver, ...@@ -316,15 +316,13 @@ qemuDomainReAttachHostdevDevices(virQEMUDriverPtr driver,
virObjectUnref(cfg); virObjectUnref(cfg);
} }
static void
void virHostdevReAttachUsbHostdevs(virHostdevManagerPtr hostdev_mgr,
qemuDomainReAttachHostUsbDevices(virQEMUDriverPtr driver,
const char *name, const char *name,
virDomainHostdevDefPtr *hostdevs, virDomainHostdevDefPtr *hostdevs,
int nhostdevs) int nhostdevs)
{ {
size_t i; size_t i;
virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr;
virObjectLock(hostdev_mgr->activeUsbHostdevs); virObjectLock(hostdev_mgr->activeUsbHostdevs);
for (i = 0; i < nhostdevs; i++) { for (i = 0; i < nhostdevs; i++) {
...@@ -383,6 +381,17 @@ qemuDomainReAttachHostUsbDevices(virQEMUDriverPtr driver, ...@@ -383,6 +381,17 @@ qemuDomainReAttachHostUsbDevices(virQEMUDriverPtr driver,
virObjectUnlock(hostdev_mgr->activeUsbHostdevs); virObjectUnlock(hostdev_mgr->activeUsbHostdevs);
} }
void
qemuDomainReAttachHostUsbDevices(virQEMUDriverPtr driver,
const char *name,
virDomainHostdevDefPtr *hostdevs,
int nhostdevs)
{
virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr;
virHostdevReAttachUsbHostdevs(hostdev_mgr, name, hostdevs, nhostdevs);
}
void void
qemuDomainReAttachHostScsiDevices(virQEMUDriverPtr driver, qemuDomainReAttachHostScsiDevices(virQEMUDriverPtr driver,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册