[PATCH v2 10/11] qemu: rename qemuDomainPCIAddressReserveNextSlot() to ...Addr()

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

 



This function doesn't actually reserve an entire slot any more, it
reserves a single PCI address, so this name is more appropriate.
---
 src/qemu/qemu_domain_address.c | 45 +++++++++++++++++++++---------------------
 1 file changed, 23 insertions(+), 22 deletions(-)

diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index f33cb9c..66ffa9c 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -861,7 +861,7 @@ qemuDomainFillDevicePCIConnectFlags(virDomainDefPtr def,
 
 
 static int
-qemuDomainPCIAddressReserveNextSlot(virDomainPCIAddressSetPtr addrs,
+qemuDomainPCIAddressReserveNextAddr(virDomainPCIAddressSetPtr addrs,
                                     virDomainDeviceInfoPtr dev)
 {
     return virDomainPCIAddressReserveNextAddr(addrs, dev,
@@ -1160,7 +1160,7 @@ qemuDomainValidateDevicePCISlotsPIIX3(virDomainDefPtr def,
 
             if (virDomainPCIAddressSlotInUse(addrs, &tmp_addr)) {
                 if (qemuDeviceVideoUsable) {
-                    if (qemuDomainPCIAddressReserveNextSlot(addrs,
+                    if (qemuDomainPCIAddressReserveNextAddr(addrs,
                                                             &primaryVideo->info) < 0) {
                         goto cleanup;
                     }
@@ -1352,7 +1352,7 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def,
 
             if (virDomainPCIAddressSlotInUse(addrs, &tmp_addr)) {
                 if (qemuDeviceVideoUsable) {
-                    if (qemuDomainPCIAddressReserveNextSlot(addrs,
+                    if (qemuDomainPCIAddressReserveNextAddr(addrs,
                                                             &primaryVideo->info) < 0)
                         goto cleanup;
                 } else {
@@ -1513,7 +1513,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
                 !virDeviceInfoPCIAddressWanted(&cont->info))
                 continue;
 
-            if (qemuDomainPCIAddressReserveNextSlot(addrs, &cont->info) < 0)
+            if (qemuDomainPCIAddressReserveNextAddr(addrs, &cont->info) < 0)
                 goto error;
         }
     }
@@ -1524,7 +1524,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
 
         /* Only support VirtIO-9p-pci so far. If that changes,
          * we might need to skip devices here */
-        if (qemuDomainPCIAddressReserveNextSlot(addrs, &def->fss[i]->info) < 0)
+        if (qemuDomainPCIAddressReserveNextAddr(addrs, &def->fss[i]->info) < 0)
             goto error;
     }
 
@@ -1541,7 +1541,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
             continue;
         }
 
-        if (qemuDomainPCIAddressReserveNextSlot(addrs, &net->info) < 0)
+        if (qemuDomainPCIAddressReserveNextAddr(addrs, &net->info) < 0)
             goto error;
     }
 
@@ -1559,7 +1559,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
             continue;
         }
 
-        if (qemuDomainPCIAddressReserveNextSlot(addrs, &sound->info) < 0)
+        if (qemuDomainPCIAddressReserveNextAddr(addrs, &sound->info) < 0)
             goto error;
     }
 
@@ -1645,7 +1645,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
                 cont->info.addr.pci.multi = addr.multi;
             }
         } else {
-            if (qemuDomainPCIAddressReserveNextSlot(addrs, &cont->info) < 0)
+            if (qemuDomainPCIAddressReserveNextAddr(addrs, &cont->info) < 0)
                  goto error;
         }
     }
@@ -1677,7 +1677,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
             goto error;
         }
 
-        if (qemuDomainPCIAddressReserveNextSlot(addrs, &def->disks[i]->info) < 0)
+        if (qemuDomainPCIAddressReserveNextAddr(addrs, &def->disks[i]->info) < 0)
             goto error;
     }
 
@@ -1689,7 +1689,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
             def->hostdevs[i]->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI)
             continue;
 
-        if (qemuDomainPCIAddressReserveNextSlot(addrs,
+        if (qemuDomainPCIAddressReserveNextAddr(addrs,
                                                 def->hostdevs[i]->info) < 0)
             goto error;
     }
@@ -1699,7 +1699,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
         def->memballoon->model == VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO &&
         virDeviceInfoPCIAddressWanted(&def->memballoon->info)) {
 
-        if (qemuDomainPCIAddressReserveNextSlot(addrs,
+        if (qemuDomainPCIAddressReserveNextAddr(addrs,
                                                 &def->memballoon->info) < 0)
             goto error;
     }
@@ -1710,7 +1710,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
             !virDeviceInfoPCIAddressWanted(&def->rngs[i]->info))
             continue;
 
-        if (qemuDomainPCIAddressReserveNextSlot(addrs, &def->rngs[i]->info) < 0)
+        if (qemuDomainPCIAddressReserveNextAddr(addrs, &def->rngs[i]->info) < 0)
             goto error;
     }
 
@@ -1718,7 +1718,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
     if (def->watchdog &&
         def->watchdog->model == VIR_DOMAIN_WATCHDOG_MODEL_I6300ESB &&
         virDeviceInfoPCIAddressWanted(&def->watchdog->info)) {
-        if (qemuDomainPCIAddressReserveNextSlot(addrs, &def->watchdog->info) < 0)
+        if (qemuDomainPCIAddressReserveNextAddr(addrs, &def->watchdog->info) < 0)
             goto error;
     }
 
@@ -1726,7 +1726,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
      * assigned address. */
     if (def->nvideos > 0 &&
         virDeviceInfoPCIAddressWanted(&def->videos[0]->info)) {
-        if (qemuDomainPCIAddressReserveNextSlot(addrs, &def->videos[0]->info) < 0)
+        if (qemuDomainPCIAddressReserveNextAddr(addrs, &def->videos[0]->info) < 0)
             goto error;
     }
 
@@ -1734,7 +1734,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
         if (!virDeviceInfoPCIAddressWanted(&def->videos[i]->info))
             continue;
 
-        if (qemuDomainPCIAddressReserveNextSlot(addrs, &def->videos[i]->info) < 0)
+        if (qemuDomainPCIAddressReserveNextAddr(addrs, &def->videos[i]->info) < 0)
             goto error;
     }
 
@@ -1743,7 +1743,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
         if (!virDeviceInfoPCIAddressWanted(&def->shmems[i]->info))
             continue;
 
-        if (qemuDomainPCIAddressReserveNextSlot(addrs, &def->shmems[i]->info) < 0)
+        if (qemuDomainPCIAddressReserveNextAddr(addrs, &def->shmems[i]->info) < 0)
             goto error;
     }
     for (i = 0; i < def->ninputs; i++) {
@@ -1751,7 +1751,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
             !virDeviceInfoPCIAddressWanted(&def->inputs[i]->info))
             continue;
 
-        if (qemuDomainPCIAddressReserveNextSlot(addrs, &def->inputs[i]->info) < 0)
+        if (qemuDomainPCIAddressReserveNextAddr(addrs, &def->inputs[i]->info) < 0)
             goto error;
     }
     for (i = 0; i < def->nparallels; i++) {
@@ -1764,7 +1764,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
             !virDeviceInfoPCIAddressWanted(&chr->info))
             continue;
 
-        if (qemuDomainPCIAddressReserveNextSlot(addrs, &chr->info) < 0)
+        if (qemuDomainPCIAddressReserveNextAddr(addrs, &chr->info) < 0)
             goto error;
     }
     for (i = 0; i < def->nchannels; i++) {
@@ -1982,7 +1982,7 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def,
                 }
             }
             if (!buses_reserved &&
-                qemuDomainPCIAddressReserveNextSlot(addrs, &info) < 0)
+                qemuDomainPCIAddressReserveNextAddr(addrs, &info) < 0)
                 goto cleanup;
         }
 
@@ -2012,7 +2012,7 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def,
             /* if there isn't an empty pcie-root-port, this will
              * cause one to be added
              */
-            if (qemuDomainPCIAddressReserveNextSlot(addrs, &info) < 0)
+            if (qemuDomainPCIAddressReserveNextAddr(addrs, &info) < 0)
                goto cleanup;
         }
 
@@ -2052,9 +2052,10 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def,
             dev.data.controller = def->controllers[contIndex];
             /* set connect flags so it will be properly addressed */
             qemuDomainFillDevicePCIConnectFlags(def, &dev, qemuCaps, driver);
-            if (qemuDomainPCIAddressReserveNextSlot(addrs,
-                                                    &dev.data.controller->info) < 0)
+            if (qemuDomainPCIAddressReserveNextAddr(addrs,
+                                                    &dev.data.controller->info) < 0) {
                 goto cleanup;
+            }
         }
 
         nbuses = addrs->nbuses;
-- 
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]