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

Laine Stump laine at laine.org
Mon Dec 19 15:25:27 UTC 2016


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 4673cc7..a9ea266 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -890,21 +890,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);
 }
 
 
@@ -1643,8 +1633,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




More information about the libvir-list mailing list