[PATCH v14 03/49] update qemuPrepareHostUSBDevices parameters to keep consistency

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

 



Update parameters from vm->def to specific name, hostdevs, nhostdevs to keep
consistentcy with PreparePCIDevices and PrepareSCSIDevices. And, at the same
time, make it reusable in later patch.

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

diff --git a/src/qemu/qemu_hostdev.c b/src/qemu/qemu_hostdev.c
index e4f6b1b..47c7f96 100644
--- a/src/qemu/qemu_hostdev.c
+++ b/src/qemu/qemu_hostdev.c
@@ -993,15 +993,15 @@ out:
 
 static int
 qemuPrepareHostUSBDevices(virQEMUDriverPtr driver,
-                          virDomainDefPtr def,
+                          const char *name,
+                          virDomainHostdevDefPtr *hostdevs,
+                          int nhostdevs,
                           bool coldBoot)
 {
     size_t i;
     int ret = -1;
     virUSBDeviceListPtr list;
     virUSBDevicePtr tmp;
-    virDomainHostdevDefPtr *hostdevs = def->hostdevs;
-    int nhostdevs = def->nhostdevs;
 
     /* To prevent situation where USB device is assigned to two domains
      * we need to keep a list of currently assigned USB devices.
@@ -1041,7 +1041,7 @@ qemuPrepareHostUSBDevices(virQEMUDriverPtr driver,
      * and add them do driver list. However, if something goes
      * wrong, perform rollback.
      */
-    if (qemuPrepareHostdevUSBDevices(driver, def->name, list) < 0)
+    if (qemuPrepareHostdevUSBDevices(driver, name, list) < 0)
         goto cleanup;
 
     /* Loop 2: Temporary list was successfully merged with
@@ -1201,7 +1201,8 @@ qemuPrepareHostDevices(virQEMUDriverPtr driver,
                                      qemuCaps) < 0)
         return -1;
 
-    if (qemuPrepareHostUSBDevices(driver, def, coldBoot) < 0)
+    if (qemuPrepareHostUSBDevices(driver, def->name,
+                                  def->hostdevs, def->nhostdevs, coldBoot) < 0)
         return -1;
 
     if (qemuPrepareHostdevSCSIDevices(driver, def->name,
-- 
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]