qemu: refactor qemuBuildControllerDevStr to eliminate future duplicate code
The PCI case of the switch statement in this function contains another switch statement with a case for each model. Currently every model except pci-root and pcie-root has a check for index > 0 (since only those two can have index==0), and the function should never be called for those two anyway. If we move the check for !pci[e]-root to the top of the pci case, then we can move the check for index > 0 out of the individual model cases. This will save repeating that check for the three new controller models about to be added.
Showing
想要评论请 注册 或 登录