[PATCH] qemu: Remove redundancy from qemuBuildControllerDevStr()

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

 



Several PCI controllers are handled the same and can thus
be squashed together.

Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
---
 src/qemu/qemu_command.c | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index ee4e0b20d..040ea65b6 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -2722,6 +2722,7 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,
                               def->info.alias);
             break;
         case VIR_DOMAIN_CONTROLLER_MODEL_PCI_EXPANDER_BUS:
+        case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_EXPANDER_BUS:
             virBufferAsprintf(&buf, "%s,bus_nr=%d,id=%s",
                               modelName, pciopts->busNr,
                               def->info.alias);
@@ -2730,29 +2731,15 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,
                                  pciopts->numaNode);
             break;
         case VIR_DOMAIN_CONTROLLER_MODEL_DMI_TO_PCI_BRIDGE:
-            virBufferAsprintf(&buf, "%s,id=%s", modelName, def->info.alias);
-            break;
-        case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT_PORT:
-            virBufferAsprintf(&buf, "%s,port=0x%x,chassis=%d,id=%s",
-                              modelName, pciopts->port,
-                              pciopts->chassis, def->info.alias);
-            break;
         case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_SWITCH_UPSTREAM_PORT:
             virBufferAsprintf(&buf, "%s,id=%s", modelName, def->info.alias);
             break;
+        case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT_PORT:
         case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_SWITCH_DOWNSTREAM_PORT:
             virBufferAsprintf(&buf, "%s,port=0x%x,chassis=%d,id=%s",
                               modelName, pciopts->port,
                               pciopts->chassis, def->info.alias);
             break;
-        case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_EXPANDER_BUS:
-            virBufferAsprintf(&buf, "%s,bus_nr=%d,id=%s",
-                              modelName, pciopts->busNr,
-                              def->info.alias);
-            if (pciopts->numaNode != -1)
-               virBufferAsprintf(&buf, ",numa_node=%d",
-                                 pciopts->numaNode);
-            break;
         case VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT:
             /* Skip the implicit one */
             if (pciopts->targetIndex == 0)
-- 
2.14.3

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

  Powered by Linux