[PATCH v2 09/11] qemu: remove qemuDomainPCIAddressReserveNextAddr()

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

 



This function is only called in two places, and the function itself is
just adding a single argument and calling
virDomainPCIAddressReserveNextAddr(), so we can remove it and instead
call virDomainPCIAddressReserveNextAddr() directly. (The main
motivation for doing this is to free up the name so that
qemuDomainPCIAddressReserveNextSlot() can be renamed in the next
patch, as its current name is now inaccurate and misleading).
---
 src/qemu/qemu_domain_address.c | 19 +++++--------------
 1 file changed, 5 insertions(+), 14 deletions(-)

diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index 2848733..f33cb9c 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -861,21 +861,11 @@ qemuDomainFillDevicePCIConnectFlags(virDomainDefPtr def,
 
 
 static int
-qemuDomainPCIAddressReserveNextAddr(virDomainPCIAddressSetPtr addrs,
-                                    virDomainDeviceInfoPtr dev,
-                                    unsigned int function)
-{
-    return virDomainPCIAddressReserveNextAddr(addrs, dev,
-                                              dev->pciConnectFlags,
-                                              function);
-}
-
-
-static int
 qemuDomainPCIAddressReserveNextSlot(virDomainPCIAddressSetPtr addrs,
                                     virDomainDeviceInfoPtr dev)
 {
-    return qemuDomainPCIAddressReserveNextAddr(addrs, dev, -1);
+    return virDomainPCIAddressReserveNextAddr(addrs, dev,
+                                              dev->pciConnectFlags, -1);
 }
 
 
@@ -1646,8 +1636,9 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
             } else {
                 /* This is the first part of the controller, so need
                  * to find a free slot & then reserve this function */
-                if (qemuDomainPCIAddressReserveNextAddr(addrs, &cont->info,
-                                                        addr.function) < 0) {
+                if (virDomainPCIAddressReserveNextAddr(addrs, &cont->info,
+                                                       cont->info.pciConnectFlags,
+                                                       addr.function) < 0) {
                     goto error;
                 }
 
-- 
2.7.4

--
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]