mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 03:25:20 +00:00
qemuBuildDeviceAddressStr: Prefer default alias for PCI bus
https://bugzilla.redhat.com/show_bug.cgi?id=1434451
Just like in 9324f67a57
we need to put default pci-root
alias onto the command line instead of the one provided by user.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
f66e5896ad
commit
937f319536
@ -318,9 +318,22 @@ qemuBuildDeviceAddressStr(virBufferPtr buf,
|
||||
|
||||
if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI &&
|
||||
cont->idx == info->addr.pci.bus) {
|
||||
contAlias = cont->info.alias;
|
||||
contIsPHB = virDomainControllerIsPSeriesPHB(cont);
|
||||
contTargetIndex = cont->opts.pciopts.targetIndex;
|
||||
|
||||
/* When domain has builtin pci-root controller we don't put it
|
||||
* onto cmd line. Therefore we can't set its alias. In that
|
||||
* case, use the default one. */
|
||||
if (!qemuDomainIsPSeries(domainDef) &&
|
||||
cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT) {
|
||||
if (virQEMUCapsHasPCIMultiBus(qemuCaps, domainDef))
|
||||
contAlias = "pci.0";
|
||||
else
|
||||
contAlias = "pci";
|
||||
} else if (cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT) {
|
||||
contAlias = "pcie.0";
|
||||
} else {
|
||||
contAlias = cont->info.alias;
|
||||
if (!contAlias) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Device alias was not set for PCI "
|
||||
@ -329,6 +342,7 @@ qemuBuildDeviceAddressStr(virBufferPtr buf,
|
||||
info->addr.pci.bus, devStr);
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -74,7 +74,9 @@
|
||||
<alias name='ua-SomeWeirdController'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
|
||||
</controller>
|
||||
<controller type='pci' index='0' model='pci-root'/>
|
||||
<controller type='pci' index='0' model='pci-root'>
|
||||
<alias name='ua-MyPCIRootController'/>
|
||||
</controller>
|
||||
<controller type='ide' index='0'>
|
||||
<alias name='ua-DoesAnybodyStillUseIDE'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
|
||||
|
Loading…
Reference in New Issue
Block a user