提交 35e9c02c 编写于 作者: A Andrea Bolognani

qemu: Move skip for implicit PHB of pSeries guests

Performing the skip earlier will help us making the function
nicer later on. We also make the condition for the skip a bit
more precise, though that'a more for self-documenting purposes
and doesn't change anything in practice.
Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
上级 3424de62
...@@ -2732,6 +2732,13 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef, ...@@ -2732,6 +2732,13 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,
def->model != VIR_DOMAIN_CONTROLLER_MODEL_PCI_LAST) def->model != VIR_DOMAIN_CONTROLLER_MODEL_PCI_LAST)
modelName = virDomainControllerPCIModelNameTypeToString(pciopts->modelName); modelName = virDomainControllerPCIModelNameTypeToString(pciopts->modelName);
/* Skip the implicit PHB for pSeries guests */
if (def->model == VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT &&
pciopts->modelName == VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_SPAPR_PCI_HOST_BRIDGE &&
pciopts->targetIndex == 0) {
goto done;
}
switch ((virDomainControllerModelPCI) def->model) { switch ((virDomainControllerModelPCI) def->model) {
case VIR_DOMAIN_CONTROLLER_MODEL_PCI_BRIDGE: case VIR_DOMAIN_CONTROLLER_MODEL_PCI_BRIDGE:
virBufferAsprintf(&buf, "%s,chassis_nr=%d,id=%s", virBufferAsprintf(&buf, "%s,chassis_nr=%d,id=%s",
...@@ -2759,10 +2766,6 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef, ...@@ -2759,10 +2766,6 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,
pciopts->chassis, def->info.alias); pciopts->chassis, def->info.alias);
break; break;
case VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT: case VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT:
/* Skip the implicit one */
if (pciopts->targetIndex == 0)
goto done;
virBufferAsprintf(&buf, "%s,index=%d,id=%s", virBufferAsprintf(&buf, "%s,index=%d,id=%s",
modelName, pciopts->targetIndex, modelName, pciopts->targetIndex,
def->info.alias); def->info.alias);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册