[PATCH v14 31/49] extract general code from qemuDomainReAttachHostUsbDevices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Extract general code from qemuDomainReAttachHostUsbDevices to
virHostdevDomainReAttachHostUsbDevices.

Signed-off-by: Chunyan Liu <cyliu@xxxxxxxx>
---
 src/qemu/qemu_hostdev.c | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/src/qemu/qemu_hostdev.c b/src/qemu/qemu_hostdev.c
index 32825a4..3d6396b 100644
--- a/src/qemu/qemu_hostdev.c
+++ b/src/qemu/qemu_hostdev.c
@@ -316,15 +316,13 @@ qemuDomainReAttachHostdevDevices(virQEMUDriverPtr driver,
     virObjectUnref(cfg);
 }
 
-
-void
-qemuDomainReAttachHostUsbDevices(virQEMUDriverPtr driver,
-                                 const char *name,
-                                 virDomainHostdevDefPtr *hostdevs,
-                                 int nhostdevs)
+static void
+virHostdevReAttachUsbHostdevs(virHostdevManagerPtr hostdev_mgr,
+                              const char *name,
+                              virDomainHostdevDefPtr *hostdevs,
+                              int nhostdevs)
 {
     size_t i;
-    virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr;
 
     virObjectLock(hostdev_mgr->activeUsbHostdevs);
     for (i = 0; i < nhostdevs; i++) {
@@ -383,6 +381,17 @@ qemuDomainReAttachHostUsbDevices(virQEMUDriverPtr driver,
     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
 qemuDomainReAttachHostScsiDevices(virQEMUDriverPtr driver,
-- 
1.9.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]